简体   繁体   中英

Gcloud load balancing to the same host for two TCP connections

I'm using GCP like in the following schema:

  1. TCP balancer -> backend-service -> MIG(my app) with auto scaling.

"My app" accepts commands on a TCP port (A) and sends notifications on another TCP port(B) for subscriber.

I'm running my tests against TCP LB's IP - my tests connect to port B on a startup(ie one of instances of "my app") and also my tests make a connection to port A for each test.

ie I've faced with a case when port A and port B are terminated/connected to different hosts.

I am not sure how to circumvent this case.

I have mitigated the issue using --session-affinity=CLIENT_IP for backend-services configuration, Ie all connections from one IP are directed to the same target.

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