- 论坛徽章:
- 0
|
遇到同样的报错已经几天了……翻了很多帖没解决……求求求求回复QAQ
centos7
jkd1.7.0_79
tomcat7
zabbix 2-4-6
都安装好了
我是在同一台服务器上,想用zabbix通过jmx监控同一台上面的tomcat,可是zabbix的页面主机后面不是有图标吗?绿色的是正常,红色的有报错,我的JMX项一直是红色的,报错是:
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.Con
下面是我做的配置:
zabbix_java/settings配置:
LISTEN_IP="0.0.0.0"
LISTEN_PORT=10052
PID_FILE="/tmp/zabbix_java.pid"
START_POLLERS=5
配置zabbix_server.conf:
LogFile=/data/zabbix/zabbix_server.log
DebugLevel=4
DBHost=******
DBName=***
DBUser=*****
DBPassword=*******
DBPort=****
JavaGatway=127.0.0.1
GavaGatewayPort=10052
StartJavaPollers=5
查看 zabbix_agentd.conf
LogFile=/var/log/zabbix_agentd.log
DebugLevel=3
Server=127.0.0.1,***我的内网IP***
ServerActive=****我的内网IP***:10051
Hostname=zabbix
tomcat配置:catalina.sh
export CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=12345
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=zabbix"
(这个hostname跟我的zabbix页面上的主机名一样,我也试过改成IP地址但还是一样的报错。)
配置conf/server.xml
在<LISTENER classname *****>下面添加了一排:
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="12345" rmiServerPortPlatform="12346" />
就是这排!!!我跟着教程加的,别人加了就能监听了为啥我的tomcat就不能启动了?日志报错:
Dec 05, 2015 11:12:44 AM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start using conf/server.xml: Error at (35, 144) : No class name specified for Listener
Dec 05, 2015 11:12:44 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.
一直没找到解决的办法,我删了这排<Listener>之后tomcat就正常启动了。
可是zabbix网页上JMX的标志一直是红的,报错java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.Con
我的zabbix server端和tomcat客户端在同一台服务器上,师父说地址设成外网ip就会被当作是远程访问,所以应该跟在两台服务器上的配置没有区别啊。
我看到有人跟我遇到同样的问题,下面的回复说是RMI远程没开。可是怎么开啊?
另外我的防火墙配置里是打开了端口12345的,但是查端口的时候用命令iptables -ntlp看不到12345被占用,用iptables -S也看不到12345开启,一个端口都看不到……我安好了telnet服务,可以telnet ***.***.***.*** 我自己外网IP ,是通的.telnet 外网IP 10050 也是通的,但是telnet IP地址 12345就不通了。我应该用什么命令才算开启12345端口呢?
一共三个问题:
1.zabbix的页面JMX报错:java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.
使用测试命令:java -jar cmdline-jmxremote.jar - zabbix:12345 java.lang:type=Memory NonHeapMemoryUsage
报错:Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: zabbix; nested exception is:
java.net.ConnectException: Connection refused]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:26
at org.archive.jmx.Client.execute(Client.java:225)
at org.archive.jmx.Client.main(Client.java:154)
2.我在tomcat/conf/server.xml里添加了<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="12345" rmiServerPortPlatform="12346" 后tomcat日志报错如上提到,不能正常启动tomcat
3.我用如下命令
iptables -A input -p tcp --dport 12345 -j ACCEPT
和在/etc/sysconfig/iptables里写入:-A INPUT -m state --state NEW -m tcp -p tcp --dport 12345:65535 -j ACCEPT
均没有开启端口12345,怎么回事?该怎么办?
求回复QAQ 求……回……复……QQQQAQQQQQ |
|