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

通过界面设置weigh,重新上线的服务如果IP不变,权重还是0 #12033

Closed
yoboygo opened this issue Apr 26, 2024 · 2 comments
Closed
Labels
kind/question Category issues related to questions or problems

Comments

@yoboygo
Copy link

yoboygo commented Apr 26, 2024

我在后台界面上设置了一个服务的权重为0,然后重启了服务,添加了参数:spring.cloud.nacos.discovery.weight=1,新上线的服务权重还是0。测试发现只有服务停机大概1分钟左右,新上线的服务权重才会按照参数注册。
请问关于这个机制有没有详细的说明?如果我想实现服务的权重按照client端的启动参数注册,覆盖nacos server端的配置,需要做那些配置?谢谢!

@KomachiSion
Copy link
Collaborator

https://nacos.io/docs/latest/guide/user/open-api/#2.3

通过该接口更新的元数据拥有更高的优先级,且具有记忆能力;会在对应实例删除后,依旧存在一段时间,如果在此期间实例重新注册,该元数据依旧生效;您可以通过nacos.naming.clean.expired-metadata.expired-time及nacos.naming.clean.expired-metadata.interval对记忆时间进行修改

@KomachiSion KomachiSion added the kind/question Category issues related to questions or problems label Apr 29, 2024
@yoboygo
Copy link
Author

yoboygo commented Apr 29, 2024

感谢您的回复,谢谢!

@KomachiSion KomachiSion closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

2 participants