天天看点

一次cloudstack启动cloudstack-agent报错的处理过程

故障现象:Centos7.3使用yum安装完cloudstack-agent后,尝试启动cloudstack-agent服务,看了下,服务无法正常启动,要么就是启动后,马上就停止了,查看日志发现如下报错:

<code># cat /var/log/cloudstack/agent/agent.log </code>

<code>2017-11-16 23:30:24,507 WARN  [cloud.resource.ServerResourceBase] (main:null) (logid:) Nics are not specified </code><code>in</code> <code>properties </code><code>file</code><code>/db</code><code>, will try to autodiscover</code>

<code>2017-11-16 23:30:24,512 INFO  [cloud.resource.ServerResourceBase] (main:null) (logid:) Designating private to be nic br0</code>

<code>2017-11-16 23:30:24,534 INFO  [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one</code>

<code>2017-11-16 23:30:24,787 INFO  [org.reflections.Reflections] (main:null) (logid:) Reflections took 51 ms to scan 1 urls, producing 7 keys and 10 values </code>

<code>2017-11-16 23:30:24,802 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent: Failed to get private nic name</code>

<code>2017-11-16 23:30:35,350 INFO  [cloud.agent.AgentShell] (main:null) (logid:) Agent started</code>

<code>2017-11-16 23:30:35,352 INFO  [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.9.2.0</code>

<code>2017-11-16 23:30:35,354 INFO  [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at </code><code>/etc/cloudstack/agent/agent</code><code>.properties</code>

<code>2017-11-16 23:30:35,358 INFO  [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties </code><code>file</code> <code>for</code> <code>storage</code>

<code>2017-11-16 23:30:35,359 INFO  [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant </code><code>time</code> <code>backoff algorithm</code>

<code>2017-11-16 23:30:35,373 INFO  [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at </code><code>/etc/cloudstack/agent/log4j-cloud</code><code>.xml</code>

<code>2017-11-16 23:30:35,385 INFO  [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings </code><code>for</code> <code>IPv6 preference </code><code>for</code> <code>agent connection</code>

<code>2017-11-16 23:30:35,509 INFO  [cloud.agent.Agent] (main:null) (logid:) </code><code>id</code> <code>is </code>

<code>2017-11-16 23:30:35,512 WARN  [cloud.resource.ServerResourceBase] (main:null) (logid:) Nics are not specified </code><code>in</code> <code>properties </code><code>file</code><code>/db</code><code>, will try to autodiscover</code>

<code>2017-11-16 23:30:35,518 INFO  [cloud.resource.ServerResourceBase] (main:null) (logid:) Designating private to be nic br0</code>

<code>2017-11-16 23:30:35,543 INFO  [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one</code>

<code>2017-11-16 23:30:35,807 INFO  [org.reflections.Reflections] (main:null) (logid:) Reflections took 49 ms to scan 1 urls, producing 7 keys and 10 values </code>

<code>2017-11-16 23:30:35,822 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent: Failed to get private nic name</code>

然后我发现我的systemctl start cloudstack-agent,服务根本不起来,一开始有点陷入误区,查了很多办法,都没法解决问题。

尝试解决方法(添加主机):

<a href="https://s1.51cto.com/oss/201711/16/71511d9de7d19f52528be1cd07aa33bb.png" target="_blank"></a>

输入主机名称,用户名,密码

<a href="https://s1.51cto.com/oss/201711/16/f29d8c6b14bf9a771c0e22d2522b8903.png" target="_blank"></a>

添加成功后,我们查看下cloudstack下agent的状态

<code># cat /etc/cloudstack/agent/agent.properties </code>

<code>#Storage</code>

<code>#Thu Nov 16 23:35:18 CST 2017</code>

<code>guest.network.device=br0</code>

<code>workers=5</code>

<code>private.network.device=br0</code>

<code>port=8250</code>

<code>resource=com.cloud.hypervisor.kvm.resource.LibvirtComputingResource</code>

<code>pod=1</code>

<code>zone=1</code>

<code>hypervisor.</code><code>type</code><code>=kvm</code>

<code>guid=a9e231ac-d361-3d25-9692-efeb9e35bf3d</code>

<code>public.network.device=br0</code>

<code>cluster=1</code>

<code>local</code><code>.storage.uuid=2a89854c-a9f6-46e1-8378-767a25ddb0ec</code>

<code>domr.scripts.</code><code>dir</code><code>=scripts</code><code>/network/domr/kvm</code>

<code>LibvirtComputingResource.</code><code>id</code><code>=7</code>

<code>host=172.16.2.1</code>

当我们遇到当前没法处理的时候,不妨试着往下一步走,人生不也是如此么。

本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1982661,如需转载请自行联系原作者

继续阅读