java.net.UnknownHostException: elog: Name or service not known
时间: 2023-10-21 17:58:19 浏览: 284
这个错误是由于Java程序无法解析"elog"这个主机名或服务名导致的。通常,这个错误是由于服务器的hosts文件中没有配置当前主机名对应的IP地址所引起的。要解决这个问题,你可以按照以下步骤操作:首先,使用命令"vim /etc/hosts"编辑hosts文件,添加你的映射IP和主机名,例如"192.168.*.* elog"。然后,使用命令"/etc/init.d/network restart"来刷新hosts文件,使其生效。通过这样的操作,你就可以解决"java.net.UnknownHostException: elog: Name or service not known"的问题了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Caused by: java.net.UnknownHostException: openapi.alipay.com](https://download.csdn.net/download/u011496822/10749662)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [java.net.UnknownHostException: [hostName]: [hostName]: Name or service not known](https://blog.csdn.net/weixin_45433817/article/details/131544000)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [第二十九回:Flink启动异常之java.net.UnknownHostException: xxxx: Name or service not known](https://blog.csdn.net/yy339452689/article/details/124092932)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文