简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM