一、故障现象
cloudstack添加宿主机,报错“unable to add the host”,然后虚拟机宿主机也没法添加到cloudstack的管理。
二、处理过程
然后查看了下宿主机的/var/log/cloudstack/agent/agent.log日志,没有发现有什么异常,查看管理的日志,也没有发现蛛丝马迹,正当没有头绪的时候,同事说要不再看下/var/log/message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# tail -30 /var/log/messages
Dec 4 19:23:42 cloudstack5 systemd: Started CloudStack Agent.
Dec 4 19:23:42 cloudstack5 systemd: Starting CloudStack Agent...
Dec 4 19:23:42 cloudstack5 sh:
/bin/sh
:
/usr/lib/jvm/jre/bin/java
: No such
file
or directory
Dec 4 19:23:42 cloudstack5 systemd: cloudstack-agent.service: main process exited, code=exited, status=1
/FAILURE
Dec 4 19:23:42 cloudstack5 systemd: Unit cloudstack-agent.service entered failed state.
Dec 4 19:23:42 cloudstack5 systemd: cloudstack-agent.service failed.
Dec 4 19:23:52 cloudstack5 systemd: cloudstack-agent.service holdoff
time
over, scheduling restart.
Dec 4 19:23:52 cloudstack5 systemd: Started CloudStack Agent.
Dec 4 19:23:52 cloudstack5 systemd: Starting CloudStack Agent...
Dec 4 19:23:52 cloudstack5 sh:
/bin/sh
:
/usr/lib/jvm/jre/bin/java
: No such
file
or directory
Dec 4 19:23:52 cloudstack5 systemd: cloudstack-agent.service: main process exited, code=exited, status=1
/FAILURE
Dec 4 19:23:52 cloudstack5 systemd: Unit cloudstack-agent.service entered failed state.
Dec 4 19:23:52 cloudstack5 systemd: cloudstack-agent.service failed.
Dec 4 19:24:03 cloudstack5 systemd: cloudstack-agent.service holdoff
time
over, scheduling restart.
|
如上信息,可以知道提示的信息可能与java相关,但我看了下,我的java版本是安装了的,版本是jdk1.8.0_144-1.8.0_144-fcs.x86_64
后面对比了下其它宿主机的java版本,发现都是java-1.8.0-openjdk.x86_64,于是:
1
2
|
# yum remove jdk1.8.0_144-1.8.0_144-fcs.x86_64
# yum install java-1.8.0-openjdk.x86_64
|
然后重新添加宿主机,问题得到解决。
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/2047398,如需转载请自行联系原作者