虚拟化平台cloudstack(4)——几个异常

时间:2024-04-16 14:06:30

cloudstack主机添加不成功

CloudStack正常启动,添加区域、提供点和群集都正常,但是添加主机时提示添加不成功。

先添加主机:

然后出现提示:

在网上找了一圈,基本上没什么回复,没办法,还得自己搞。

查看日志

进入/var/log/cloud/managerment,看管理服务器的日志:

tail -f management-server.log

查看日志发现出现异常信息:

2013-06-27 09:07:19,659 INFO  [cloud.resource.ResourceManagerImpl] (catalina-exec-17:null) Trying to add a new host at http://192.168.74.143 in data center 3
2013-06-27 09:07:19,664 WARN  [kvm.discoverer.KvmServerDiscoverer] (catalina-exec-17:null)  can\'t setup agent, due to java.io.IOException: There was a problem while connecting to 192.168.74.143:22 - There was a problem while connecting to 192.168.74.143:22
2013-06-27 09:07:19,664 WARN  [cloud.resource.ResourceManagerImpl] (catalina-exec-17:null) Unable to find the server resources at http://192.168.74.143
2013-06-27 09:07:19,664 WARN  [api.commands.AddHostCmd] (catalina-exec-17:null) Exception: 
com.cloud.exception.DiscoveryException: Unable to add the host
    at com.cloud.resource.ResourceManagerImpl.discoverHostsFull(ResourceManagerImpl.java:737)
    at com.cloud.resource.ResourceManagerImpl.discoverHosts(ResourceManagerImpl.java:544)
    at com.cloud.api.commands.AddHostCmd.execute(AddHostCmd.java:140)
    at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:138)
    at com.cloud.api.ApiServer.queueCommand(ApiServer.java:544)
    at com.cloud.api.ApiServer.handleRequest(ApiServer.java:423)
    at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:312)
    at com.cloud.api.ApiServlet.doGet(ApiServlet.java:64)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:744)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2282)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
2013-06-27 09:07:19,666 WARN  [cloud.api.ApiDispatcher] (catalina-exec-17:null) class com.cloud.api.ServerApiException : Unable to add the host

查看VT是否打开

因为没打开VT,所以导致不能添加Host的异常,打开VT后,再次添加,添加成功!

cloudstack当修改mysql的bind_address时导致连接不成功

修改参数后导致tomcat不能启动,查看日志,得到如下信息:

2013-07-01 23:55:48,703 WARN  [cluster.dao.ManagementServerHostDaoImpl] (Cluster-Heartbeat-1:null) Unexpected exception, 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 1 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

在网上查了一些资料:

修改MySQL的参数了,wait_timeout最大为31536000即1年,在my.cnf中加入:

[mysqld]
wait_timeout=31536000
interactive_timeout=31536000

重启生效,需要同时修改这两个参数。

还是不行,于是

注释掉这行,如:#bind-address = 127.0.0.1

或者改为: bind-address = 0.0.0.0

允许任意IP访问;

如果指定ip,那么不知道为什么本机就不能访问,会导致一些异常,所以我修改为任意IP都可以访问,再重新授权。

grant all privileges on *.* to root@"%" identified by "password" with grant option;

   flush privileges;

重启mysql

sudo /etc/init.d/mysql restart

然后重新启动

sudo /etc/init.d/cloud-management restart

一切正常。

cloudstack注册ISO时提示connection refused

当注册模板的时候,配置好apache,并且在本地测试可以下载。

但是上传模板的时候还是提示拒绝连接:

进入Cloudstack的管理界面进行全局配置

搜索secstorage关键字,找到一个叫做“secstorage.allowed.internal.sites”的配置参数,设置为 可访问的IP如(192.168.1.1/24),敲回车确认即可。这个参数是说,Web服务器的网段在192.168.1.*;然后到管理节点的命令行重启服务: # service cloud-management restart  
重新登陆界面,在此添加ISO模版,就不会出现“connection refused”的错误。