SocketCluster / socketcluster

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

SocketCluster version 16.0.1 SCC problem in minikube k8 #567

Closed lecoleco closed 2 years ago

lecoleco commented 2 years ago

Hi, i try to use scc in minikube and get that.

SCC-broker

scc-broker@8.0.0 start /usr/src SCC_STATE_SERVER_HOST='127.0.0.1' SCC_BROKER_SERVER_LOG_LEVEL=3 SCC_BROKER_SERVER_PORT='8888' node server.js The scc-broker instance is listening on port 8888 Error [SocketProtocolError]: Socket hung up at AGClientSocket._destroy (/usr/src/node_modules/socketcluster-client/lib/clientsocket.js:690:15) at AGTransport.onOpenAbort (/usr/src/node_modules/socketcluster-client/lib/clientsocket.js:378:16) at AGTransport._destroy (/usr/src/node_modules/socketcluster-client/lib/transport.js:266:10) at WebSocket.AGTransport.wsSocket.onerror (/usr/src/node_modules/socketcluster-client/lib/transport.js:91:12) at WebSocket.onError (/usr/src/node_modules/ws/lib/event-target.js:140:16) at WebSocket.emit (events.js:223:5) at emitErrorAndClose (/usr/src/node_modules/ws/lib/websocket.js:895:13) at ClientRequest. (/usr/src/node_modules/ws/lib/websocket.js:752:5) at ClientRequest.emit (events.js:223:5) at Socket.socketErrorListener (_http_client.js:415:9) { name: 'SocketProtocolError', message: 'Socket hung up', code: 1006 }

If i call like that on terminal (scc-state, scc-broker, scc-worker) all separated . work good

SCC_STATE_SERVER_HOST='127.0.0.1' SCC_BROKER_SERVER_LOG_LEVEL=3 SCC_BROKER_SERVER_PORT='8888' node server.js

but like that kubectl create -f scc-broker-deployment.yaml not working.

SCC-state

scc-state@8.0.2 start /usr/src node server.js Waiting 5000ms for initial scc-broker instances before allowing scc-worker instances to join The scc-state instance is listening on port 7777 State server is now allowing scc-worker instances to join the cluster The scc-worker instance d17e4ce4-a1db-4fcc-b7bd-d17e1f80f815 at address 172.17.0.5 joined the cluster on socket Tn7SibuHR6oOufZ5AAAA

SCC-worker

socketcluster-sample@1.0.0 start:docker /usr/src ./node_modules/nodemon/bin/nodemon.js /usr/src/app/server.js [nodemon] 2.0.15 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node /usr/src/app/server.js [Active] SocketCluster worker with PID 54 is listening on port 8000


Error [SCCError]: Could not find a matching subscribe target scc-broker for the semServer channel - The scc-broker may be down at Object.NoMatchingSubscribeTargetError (/usr/src/app/node_modules/scc-broker-client/cluster-broker-client.js:34:15) at ClusterBrokerClient.subscribe (/usr/src/app/node_modules/scc-broker-client/cluster-broker-client.js:188:29) at /usr/src/app/node_modules/scc-broker-client/index.js:166:23 at processTicksAndRejections (internal/process/task_queues.js:94:5) { name: 'SCCError' }

What i do wrong?

Thanks