我问这个与我之前的帖子有关。我已经阅读了一些内容,但没有看到对我的评论 Diego 的回答的明确答案。
Service Fabric - 如何保留或保护我的硬编码端口
更新:当我充实这一点时,我认为问题真的变成了你能否在一个虚拟机上拥有多个节点。它不是关于节点类型,而是节点本身。 所以问题是:我可以拥有一个多 IP 的 VM 来托管 Service Fabric,然后在其上托管两个不同类型的节点吗?
这样我就可以解决上述问题,并有一个用于外部访问的节点类型和一个用于内部访问的第二个节点类型,而不是硬编码一个超出集群设置期间使用范围的端口。
我想我会变得贪婪并在这里提出后续问题:
如果我不能拥有多个 IP,那么使用范围之外的端口有什么需要担心的。服务结构会将该端口号用于其他任何事情吗?
例如,我不希望 Service Fabric 仅仅因为端口超出范围而认为微服务需要像所有其他微服务一样进行管理?
例如,在我的 onPrem ClusterConfig.Windows.MultiMachine.json 文件中,我当前拥有:
"nodes": [
{
"nodeName": "vm0",
"iPAddress": "Server1.DomainName.net",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r0",
"upgradeDomain": "UD0"
},
{
"nodeName": "vm1",
"iPAddress": "Server2.DomainName.net",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r1",
"upgradeDomain": "UD1"
},
{
"nodeName": "vm2",
"iPAddress": "Server3.DomainName.net",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r2",
"upgradeDomain": "UD2"
}
]
"nodeTypes": [
{
"name": "NodeType0",
"clientConnectionEndpointPort": "19000",
"clusterConnectionEndpointPort": "19001",
"leaseDriverEndpointPort": "19002",
"serviceConnectionEndpointPort": "19003",
"httpGatewayEndpointPort": "19080",
"reverseProxyEndpointPort": "19081",
"applicationPorts": {
"startPort": "20001",
"endPort": "20100"
},
"isPrimary": true
}
],
我可以在 IP 1 和 4、2 和 5 以及 3 和 6 在同一个 VM 上的情况下做这样的事情吗?请注意,这两种节点类型的起始端口和结束端口未拆分以允许硬编码的 WebAPI 端点。
"nodes": [
{
"nodeName": "vm0",
"iPAddress": "IPAddress_1",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r0",
"upgradeDomain": "UD0"
},
{
"nodeName": "vm1",
"iPAddress": "IPAddress_2",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r1",
"upgradeDomain": "UD1"
},
{
"nodeName": "vm2",
"iPAddress": "IPAddress_3",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r2",
"upgradeDomain": "UD2"
}
]
"nodes": [
{
"nodeName": "vm3",
"iPAddress": "IPAddress_4",
"nodeTypeRef": "NodeType1",
"faultDomain": "fd:/dc1/r0",
"upgradeDomain": "UD0"
},
{
"nodeName": "vm4",
"iPAddress": "IPAddress_5",
"nodeTypeRef": "NodeType1",
"faultDomain": "fd:/dc1/r1",
"upgradeDomain": "UD1"
},
{
"nodeName": "vm5",
"iPAddress": "IPAddress_6",
"nodeTypeRef": "NodeType1",
"faultDomain": "fd:/dc1/r2",
"upgradeDomain": "UD2"
}
]
"nodeTypes": [
{
"name": "NodeType0",
"clientConnectionEndpointPort": "19000",
"clusterConnectionEndpointPort": "19001",
"leaseDriverEndpointPort": "19002",
"serviceConnectionEndpointPort": "19003",
"httpGatewayEndpointPort": "19080",
"reverseProxyEndpointPort": "19081",
"applicationPorts": {
"startPort": "20001",
"endPort": "20500"
},
"isPrimary": true
}
"name": "NodeType1",
"clientConnectionEndpointPort": "19000",
"clusterConnectionEndpointPort": "19001",
"leaseDriverEndpointPort": "19002",
"serviceConnectionEndpointPort": "19003",
"httpGatewayEndpointPort": "19080",
"reverseProxyEndpointPort": "19081",
"applicationPorts": {
"startPort": "20501",
"endPort": "21000"
},
],
在此先感谢,格雷格