upsync_lb ip_hash不生效,寻求解答
各位好, upstream erp-sales { #server 10.6.125.38:8080 max_fails=3 fail_timeout=10s; #ip_hash; server 127.0.0.2:1111 down; upsync 10.6.124.175:2379/v2/keys/upstreams/erp-sales upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off; upsync_lb ip_hash; upsync_dump_path /data/nginx/consul/conf/upstream.erp-sales; check interval=3000 rise=2 fall=3 timeout=1000 type=http; check_http_send "HEAD /glhealthcheck/status HTTP/1.0\r\n\r\n"; check_http_expect_alive http_2xx http_3xx;
在日志中,发现请求还是轮询请求到不同的服务器上
有遇到同类问题的同学,麻烦指点一二,谢谢
这样配置不使用upsync_lb 就能可以了 upstream erp-sales { ip_hash; server 127.0.0.2:1111 down; upsync 10.6.124.175:2379/v2/keys/upstreams/erp-sales upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off; upsync_dump_path /data/nginx/consul/conf/upstream.erp-sales; check interval=3000 rise=2 fall=3 timeout=1000 type=http; check_http_send "HEAD /glhealthcheck/status HTTP/1.0\r\n\r\n"; check_http_expect_alive http_2xx http_3xx;