SocketCluster / socketcluster

Highly scalable realtime pub/sub and RPC framework
https://socketcluster.io
MIT License
6.14k stars 313 forks source link

[Question] ca scc-brokers run locally #495

Open huyhoangk50 opened 5 years ago

huyhoangk50 commented 5 years ago

To connect between scc-cluster we need scc-state and scc-brokers right? I have deployed a scc-state and scc-brokers in a public ip and it works. But if the scc-state is in a public network and scc-brokers are in local network(same network with ssc-cluster), scc-clusters cannot connect to each others. Can any one tell me why? Because I have an ideal of connect all scc-clusters without a centralized server. I mean each scc-cluster will connect to a local scc-broker, scc-state just make the connection between sc-brokers. So that, the data can be transformed between them. Is that possible with this project? Thanks

happilymarrieddad commented 5 years ago

@huyhoangk50 yea, I've run it locally and remotely. What does your config look like?

huyhoangk50 commented 5 years ago

@happilymarrieddad can you tell me how you have ran remotely. Thanks

pub-sub_system_component_diagram I just pull code from git hub and run the model like this diagram.

In ssc-state repo: node server.js. In Scc-Broker repo: SCC_STATE_SERVER_HOST='35.229.77.94' SCC_BROKER_SERVER_PORT='8888' node server The scc-state shown a notification: "The scc-broker instance 72c8791c-7fa9-4d1d-ba7d-75f8f37c0cf7 at address ::ffff:203.205.35.185 on port 8888 joined the cluster on socket uA8ruWXQ4Ambl-LoAAAo" Then in Sc-Server repo: SCC_STATE_SERVER_HOST='35.229.77.94' SOCKETCLUSTER_PORT='8000' node server The scc-state shown a notification: "The scc-broker instance 72c8791c-7fa9-4d1d-ba7d-75f8f37c0cf7 at address ::ffff:203.205.35.185 on port 8888 left the cluster on socket uA8ruWXQ4Ambl-LoAAAo" After a while the Sc-Server shown a notification:

{ SocketProtocolError: Client connection establishment timed out at SCClientSocket._onSCClose (/Users/macbook/Documents/OhmniLabsWork/scc-testing/myApp/node_modules/socketcluster-client/lib/scclientsocket.js:632:15) at SCTransport. (/Users/macbook/Documents/OhmniLabsWork/scc-testing/myApp/node_modules/socketcluster-client/lib/scclientsocket.js:304:12) at SCTransport.Emitter.emit (/Users/macbook/Documents/OhmniLabsWork/scc-testing/myApp/node_modules/socketcluster-client/node_modules/component-emitter/index.js:133:20) at SCTransport._onClose (/Users/macbook/Documents/OhmniLabsWork/scc-testing/myApp/node_modules/socketcluster-client/lib/sctransport.js:217:28) at Timeout. (/Users/macbook/Documents/OhmniLabsWork/scc-testing/myApp/node_modules/socketcluster-client/lib/sctransport.js:86:10) at ontimeout (timers.js:460:11) at tryOnTimeout (timers.js:298:5) at Timer.listOnTimeout (timers.js:261:5) name: 'SocketProtocolError', message: 'Client connection establishment timed out', code: 4007 }

Can you tell me if I did something wrong.