Service id not legal hostname (gp_emergencydrill)
时间: 2024-04-28 10:18:53 浏览: 120
回答: 报错"Service id not legal hostname"的原因是微服务的命名不能使用下划线"_",只能使用中划线"-"。这是因为Spring Cloud无法识别下划线作为服务名的一部分。所以你需要将服务名中的下划线改成中划线。例如,将"service_a"改成"service-a"。这样修改后,再次启动项目,就不会报这个错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Spring Cloud Service id not legal hostname (service_name)异常处理](https://blog.csdn.net/weistin/article/details/103720627)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [service id not legal hostname (workspace_tnn_taoyan)](https://blog.csdn.net/weixin_55613352/article/details/126060250)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文