alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.38k stars 8.16k forks source link

Is it able to use discovery without registering itself? #3675

Closed craynic closed 1 day ago

craynic commented 1 month ago

Which Component Nacos Discovery

Describe what problem you have encountered Scenario: I start a local instance for development. It needs to call dev deployments, but it shouldn't be called by dev deployments.

Describe what information you have read There is no option to disable auto registering according to the doc. I tried marking the instance offline on nacos web. It worked, while it turned online every time I restart the instance. It's annoyed to click the offline button every time I restart the instance. I tried setting -Dspring.cloud.nacos.discovery.weight=0. It worked, while it is not documented. I'm afraid this will not function some day. So what's the formal way to do this?

yuluo-yx commented 1 month ago

You can try spring.cloud.nacos.discovery.register-enabled=false

craynic commented 1 month ago

Cool. Hope it documented in wiki.

yuluo-yx commented 1 month ago

https://sca.aliyun.com/en-us/docs/2023.0.0.0-RC1/user-guide/nacos/advanced-guide/#configuration-items-1

It's documented, but it doesn't look like the documentation has been updated, so we'll update this configuration item later!

github-actions[bot] commented 1 week ago

This issue has been open 30 days with no activity. This will be closed in 7 days.

github-actions[bot] commented 1 day ago

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.