- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试编写一个封装来获取服务结构的本地反向代理的 uri,但我很难决定如何实现端口的可配置性(在服务中称为“HttpApplicationGatewayEndpoint”) list 或 ARM 模板中的“reverseProxyEndpointPort”)。我认为最好的方法是从结构客户端调用“GetClusterManifestAsync”并从那里解析它,但出于某些原因我也不喜欢这样做。其一,该调用返回一个字符串 xml blob,它无法防止 list 架构发生更改。我还没有找到一种方法来查询集群管理器以找出我当前所在的节点类型,因此,如果出于某种愚蠢的原因,集群具有多个节点类型,并且每个节点类型都有不同的反向代理端口(只是这里是防御性编码员),这可能会失败。动态发现该端口号似乎需要付出巨大的努力,而且我之前肯定错过了 Fabric api 中的内容,所以关于如何解决这个问题有什么建议吗?
编辑:
我从示例项目中看到它从服务中的配置包获取端口号。我宁愿不必这样做,因为那样我将不得不为每个需要使用它来读取配置并传递它的服务编写大量的样板文件。由于这在运行时或多或少是一个常量,那么在我看来,这可以被视为这样并从结构客户端的某个地方获取?
最佳答案
在对象浏览器中花费了一段时间后,我能够找到正确完成此操作所需的各个部分。
public class ReverseProxyPortResolver
{
/// <summary>
/// Represents the port that the current fabric node is configured
/// to use when using a reverse proxy on localhost
/// </summary>
public static AsyncLazy<int> ReverseProxyPort = new AsyncLazy<int>(async ()=>
{
//Get the cluster manifest from the fabric client & deserialize it into a hardened object
ClusterManifestType deserializedManifest;
using (var cl = new FabricClient())
{
var manifestStr = await cl.ClusterManager.GetClusterManifestAsync().ConfigureAwait(false);
var serializer = new XmlSerializer(typeof(ClusterManifestType));
using (var reader = new StringReader(manifestStr))
{
deserializedManifest = (ClusterManifestType)serializer.Deserialize(reader);
}
}
//Fetch the setting from the correct node type
var nodeType = GetNodeType();
var nodeTypeSettings = deserializedManifest.NodeTypes.Single(x => x.Name.Equals(nodeType));
return int.Parse(nodeTypeSettings.Endpoints.HttpApplicationGatewayEndpoint.Port);
});
private static string GetNodeType()
{
try
{
return FabricRuntime.GetNodeContext().NodeType;
}
catch (FabricConnectionDeniedException)
{
//this code was invoked from a non-fabric started application
//likely a unit test
return "NodeType0";
}
}
}
在这次调查中,我得到的消息是任何服务结构 xml 的所有模式都存储在名为 System.Fabric.Management.ServiceModel
的程序集中。
关于azure - Service Fabric 反向代理端口可配置性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44012427/
我刚刚偶然发现Fabric并且文档并没有真正说明它是如何工作的。 我有根据的猜测是您需要在客户端和服务器端都安装它。 Python 代码存储在客户端,并在命令运行时通过 Fabric 的有线协议(pr
以下是我对 Hyperledger Fabric 系统的理解。如果有任何不正确的地方,请告诉我。 1) 所以我们有同行(背书人、 anchor 人、将军(拥有分类帐的人)、排序人)。此外,当我们设置结
我部署了一个持久性级别为 Silver 的全新 Service Fabric 集群,fabric:/System/InfrastructureService/FE 服务运行状况不佳,并出现以下错误:
我对使用 Fabric 很感兴趣,api 在未连接到互联网时如何工作? 我发现 firebase(与此工具类似的工具)会将数据存储在本地,然后对服务器进行批量更新。但是,超过 72 小时的任何内容都不
Fabric CA Server 和 Fabric CA Client 的功能是什么? Fabric CA 服务器和 Fabric CA 客户端的角色是什么? 谢谢 最佳答案 Fabric CA 提供
我想在不同的环境中使用相同的应用程序,我在 documentation 中找到了它, Apps with Multiple Environments Let’s say you have an app
我目前正在尝试学习 Hyperledger Fabric,我设法了解了如何设置网络(Orderer、Peers 等),但现在是链代码的一部分。 但是,我发现两个不同的 git 存储库(据我所知)可用于
我在 following this tutorial 时遇到错误 cannot convert from 'System.Fabric.StatelessServiceContext' to 'Sys
在我没有改变任何东西之前它可以工作,但今天我收到了这个错误,这里是我的 gradle buildscript { repositories { mavenCentral() maven
Fabric beta 手动分发有时不会发送邀请电子邮件,即使在它向该人显示“已邀请”的网页中也是如此。如果我点击重新发送邀请,那个人就会收到。我的 QA 团队人员必须一直来找我重新发送邀请。我知道
默认情况下,Hyperledger Fabric 在将许多证书保存到区 block 链之前将其存储在交易中。无论如何或任何想法/技术来最小化区 block 链中的交易大小? 任何想法都非常有用! 最佳
我是 Hyperledger Fabric 的新手。我正在阅读 Fabric 的文档最新版本,但我不清楚 Fabric 的共识。 Fabric 使用的共识是什么?它是如何工作的?请解释。 最佳答案 我
我是 Hyperledger Fabric 的新手,我正在尝试在本地向服务器注册 Fabric 客户端。这是我到目前为止所做的。 go get -u github.com/hyperledger/fa
Hyperledger Fabric 中链和状态数据库的主要区别是什么。我很困惑它们是否相同。 最佳答案 Hyperledger Fabric 中有两个“存储”数据的地方: 账本 状态数据库 账本是真
我尝试将图像上传到分类帐中(将图像转换为 base64 字符串并将其作为交易中的 arg 传递)。 当我发送大小为 30 kb 的图像时,它工作正常,但是对于 100 kb 的图像,我的交易失败了,指
我正在尝试在初始化 Fabric CA 服务器后注册管理员: fabric-ca-server init -b “admin:adminpw” 并启动 CA 服务器: fabric-ca-serve
我正在使用来自 super 账本fabric firstsample的cryptogen工具,它未在 crypto-config/peerorganisation/org1.example.com/m
我离开了一家公司,用于访问 Fabric 的电子邮件已被删除。 现在我在同一家公司工作,他们用相同的句柄重新创建了电子邮件。我不知道这是否是问题所在,但我没有收到任何包含报告的电子邮件,也没有收到 B
如果我有 1 个组织 orgA ,在这个组织下我有 2 个用户:user1和 user2 , 在 orgA 中也有 1 个对等点,让我们称之为 peer0 . 现在想象一下,user1的证书在orgA
全部, 据我所知,在 Hyperledger Fabric 环境中,orderer 将消息传递给 peer。如果有离线对等。恢复到 ON-LINE 时,消息如何传递给对端? orderer如何知道pe
我是一名优秀的程序员,十分优秀!