sophie0000
sophie0000
openresty 1.15.8.2 etcd同步时,如果upstream ip发生了变化,配置信息是更新了 但是请求到此应用的时候,openresty 还是会请求已经替换了的ip 从我们测试的结果来看 当upstream ip发生变化时,发出10个请求 ,会有部分请求访问之前老的ip,但是也会有部分请求访问新的ip,这样就会造成,当请求落到老ip的时候就会502,当请求到新ip的时候,就正常。 请问这种情况是什么原因导致的呢?
在upstream文件中,这么配置 ,但是没有生效ip_hash不起作用,请帮忙看下 upstream backend_xxx_xxx { upsync xx-xxxx-etcd-xxx.xxx.org:2335/v2/keys/xxx/xxx/xxx/config/upstream/backend_xxx_xxx upsync_timeout=6m upsync_interval=5000ms upsync_type=etcd strong_dependency=off; upsync_dump_path /opt/xxx/xxx/upsync-upstream/backend_xxx_xxx.conf; upsync_lb ip_hash; include /opt/xxx/xxx/upsync-upstream/backend_xxx_xxx.conf; }
If it is the same timestamp, the generated IDs will be the same