安装zookeeper和dubbo后发现,登录dubbo监控中心404。
1 在dubbo的logs目录中查看日志
tail -f stdout.log
结果报错
java.lang.IllegalStateException: Failed to start jetty server on 172.22.215.120:8080, cause: Address already in use
查看占用端口的进程
netstat -apn | grep 8080
结果为
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 379/java
tcp 0 0 172.22.215.120:8080 66.249.65.223:63942 TIME_WAIT -
删除对应的进程,此处为379
kill -9 379
2 网页报错无法连接
解决进程问题后网页继续报错:
Unable to round-trip http request to upstream: dial tcp 121.40.177.15:8080: connectex: No connection could be made because the target machine actively refused it.
解决方法:
关闭lantern等fanqiang软件。
3 Zookeeper与Dubbo的兼容性问题
关闭蓝灯后,网页直接无法连接,继续查看stdout.log日志,结果为:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
log4j:WARN No appenders could be found for logger (com.alibaba.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
前面几条信息是关于jdk1.8的,看了一下,感觉并不是jdk的问题导致的。有可能是本身zookeeper和dubbo的问题,后来看了一下自己用的zookeeper和dubbo版本,发现zookeeper用的最新版,而dubbo用的老版本。卸载zookeeper使用旧版本zookeeper,或者dubbo升级新版本即可正常显示监控中心。