How to load balancing multiple Netty TCP socket server with nginx stream module?

1.3k views Asked by At

I need load balancing tcp socket connections to multiple netty.io server. At nginx 1.9, it has stream-module, it support load balancing tcp socket. I test success with 1 traccar server. Nginx listener port 5095 and forward package to port 5005 of traccar server. But with multiple server, problem will happen. DeviceX open socket to serverA, but will send package to serverB.

Please give me advice! Thank you very much.

1

There are 1 answers

0
Tan Nguyen Ba On BEST ANSWER

I test with module stream.I have 3 server X,Y,Z, and 3 client A,B,C. And I don't see problem loss connected as I think. ClientA open socket to serverX,and communication is always send to ServerX. If ClientA close connection socket and reopen it, clientA will communicate to ServerY, and communication is always send to ServerY.