1. 程式人生 > >CloudStack: unable to add the host

CloudStack: unable to add the host

cloudstack

一、故障現象

cloudstack添加宿主機,報錯“unable to add the host”,然後虛擬機宿主機也沒法添加到cloudstack的管理。


二、處理過程

然後查看了下宿主機的/var/log/cloudstack/agent/agent.log日誌,沒有發現有什麽異常,查看管理的日誌,也沒有發現蛛絲馬跡,正當沒有頭緒的時候,同事說要不再看下/var/log/message

# 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,於是:

#  yum remove jdk1.8.0_144-1.8.0_144-fcs.x86_64
#  yum install java-1.8.0-openjdk.x86_64

然後重新添加宿主機,問題得到解決。




CloudStack: unable to add the host