首页

关于mycat配置启动报"java.net.MalformedURLException...UnknownHostException..未知的名称或服务"错误问题

标签:MalformedURLException,mycat异常日志,UnknownHostException,ERROR错误,wrapper.log,代理抛出异常错误,未知的名称或服务     发布时间:2019-05-22   

一、前言

关于通过mycat配置mysql分库分表配置(详细配置教程参考其他文章页面)时启动,打开logs/wrapper.log日志报"错误: 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos-cluster-s19423: centos-cluster-s19423: 未知的名称或服务..sun.management.AgentConfigurationError.."错误异常,详情日志如下>>

STATUS | wrapper  | 2019/05/07 06:41:27 | Launching a JVM...@b@INFO   | jvm 5    | 2019/05/07 06:41:27 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0@b@ERROR  | wrapper  | 2019/05/07 06:41:32 | JVM exited while loading the application.@b@INFO   | jvm 5    | 2019/05/07 06:41:32 | 错误: 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos-cluster-s19423: centos-cluster-s19423: 未知的名称或服务@b@INFO   | jvm 5    | 2019/05/07 06:41:32 | sun.management.AgentConfigurationError: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos-cluster-s19423: centos-cluster-s19423: 未知的名称或服务@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:480)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at sun.management.Agent.startAgent(Agent.java:262)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at sun.management.Agent.startAgent(Agent.java:452)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 | Caused by: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: centos-cluster-s19423: centos-cluster-s19423: 未知的名称或服务@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:289)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:253)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:739)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       at sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:468)@b@INFO   | jvm 5    | 2019/05/07 06:41:32 |       ... 2 more@b@FATAL  | wrapper  | 2019/05/07 06:41:32 | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.@b@FATAL  | wrapper  | 2019/05/07 06:41:32 |   There may be a configuration problem: please check the logs.@b@STATUS | wrapper  | 2019/05/07 06:41:32 | <-- Wrapper Stopped@b@STATUS | wrapper  | 2019/05/12 16:46:08 | --> Wrapper Started as Daemon

二、解决方法

在本地域名中增加本地127.0.0.1映射centos-cluster-s19423主机名配置,具体如下所示,再重启mycat问题即可解决了

[root@centos-cluster-s19423 ~]# vi /etc/hosts@b@127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4@b@::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 @b@127.0.0.1   centos-cluster-s19423