我正在尝试实现这个解决方案 (在Win10 x64上),但是由于某种原因,所有的SocketCluster节点都拒绝彼此通信。

所以这是我的孩子。配置:
我确保国家和经纪人都在监听:
TCP [::]:7777 [::]:0 LISTENING
TCP [::]:8888 [::]:0 LISTENING据我所知,BrokerServer和SocketCluster节点都应该连接到StatusServer(?)
我可以成功地将BrokerServer连接到StateServer,但是每当我尝试连接任何SocketCluster服务时,它都会报告'socket悬挂‘错误。
StateServer
SC Cluster State Server is listening on port 7777
Sever d08298c6-523f-4c1b-9fcc-efd4e92fab22 at address undefined on port 8888 joined the cluster
Client 10612bde-514f-40d3-9340-7179a1901376 at address undefined joined the cluster
Cluster state converged to active:["ws://[undefined]:8888"]SocketCluster实例:
{ SocketProtocolError: Socket hung up
at Emitter.SCSocket._onSCClose (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\socketcluster-client\lib\scsocket.js:596:15)
at Emitter.<anonymous> (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\socketcluster-client\lib\scsocket.js:285:12)
at Emitter.emit (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\component-emitter\index.js:131:20)
at Emitter.SCEmitter.emit (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\sc-emitter\index.js:28:26)
at Emitter.SCTransport._onClose (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\socketcluster-client\lib\sctransport.js:175:30)
at WebSocket.wsSocket.onerror (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\socketcluster-client\lib\sctransport.js:104:12)
at WebSocket.onError (C:\Users\Alex\AppData\Roaming\npm\node_modules\sc-cluster-broker-client\node_modules\ws\lib\WebSocket.js:452:14)
at emitOne (events.js:96:13)
at WebSocket.emit (events.js:188:7)
at WebSocket.EventEmitter.emit (C:\Users\Alex\AppData\Roaming\npm\node_modules\socketcluster\node_modules\sc-domain\index.js:12:31)
name: 'SocketProtocolError',
message: 'Socket hung up',
code: 1006 }发布于 2017-12-30 21:18:57
您是否有可能在Docker容器中运行这些实例?
根据从状态服务器获得的日志输出(地址未定义),scc状态实例似乎无法计算实例的IP地址。这种情况的发生有几个原因。例如,在Docker容器中运行实例可能会模糊该实例的实际IP地址。在Windows上运行SCC也可能导致类似的问题。
这个问题的解决方案是在启动每个实例时设置一个SCC_INSTANCE_IP环境变量--这个环境变量应该保存其他实例可以用来连接到它的实例的IP地址(如果使用Docker,可以使用docker inspect命令查找特定容器的专用网络IP地址)。
SCC_INSTANCE_IP可以是私有IP地址、公共IP地址或主机名。
发布于 2016-12-05 08:02:09
事实证明,在Windows上水平缩放集群还没有正常工作(使用当前版本v.1.2.1)。由于某种原因,两个SocketCluster节点都没有与brokerServer通信。
https://stackoverflow.com/questions/40876822
复制相似问题