Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upsync_lb ip_hash不生效,寻求解答 #321

Open
caibird1990 opened this issue May 23, 2023 · 1 comment
Open

upsync_lb ip_hash不生效,寻求解答 #321

caibird1990 opened this issue May 23, 2023 · 1 comment

Comments

@caibird1990
Copy link

各位好,
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;

在日志中,发现请求还是轮询请求到不同的服务器上
image
有遇到同类问题的同学,麻烦指点一二,谢谢

@DUET151
Copy link

DUET151 commented Jul 25, 2023

这样配置不使用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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants