Centos6

按照官方指南安裝 CloudStack 得到找不到 URL 404 錯誤

  • May 24, 2017

請遵循此安裝指南:

https://docs.cloudstack.apache.org/projects/cloudstack-installation/en/latest/qig.html

執行安裝命令時:

# yum -y install cloudstack-management

它有一個找不到 ULR 404 錯誤。是不是官方文件變壞的原因?

這是圖片


添加

從日誌中我看到:

...
com.cloud.utils.exception.CloudRuntimeException: No database selected for the transaction
2017-04-21 05:28:10,385 ERROR [c.c.c.ClusterManagerImpl] (Cluster-Heartbeat-1:ctx-a3d78589) (logid:c556482a) Unexpected exception in cluster heartbeat
java.lang.RuntimeException: No database selected for the transaction
Caused by: com.cloud.utils.exception.CloudRuntimeException: No database selected for the transaction
2017-04-21 05:28:11,884 WARN  [c.c.c.d.ManagementServerHostDaoImpl] (Cluster-Heartbeat-1:ctx-69287ea3) (logid:ee11e3ed) Unexpected exception,
com.cloud.utils.exception.CloudRuntimeException: No database selected for the transaction
2017-04-21 05:28:11,885 ERROR [c.c.c.ClusterManagerImpl] (Cluster-Heartbeat-1:ctx-69287ea3) (logid:ee11e3ed) Unexpected exception in cluster heartbeat
java.lang.RuntimeException: No database selected for the transaction
Caused by: com.cloud.utils.exception.CloudRuntimeException: No database selected for the transaction
2017-04-21 05:28:12,784 ERROR [c.c.u.d.ConnectionConcierge] (ConnectionConcierge-1:ctx-c609b238) (logid:80cc65b8) Unable to keep the db connection for LockMaster1
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
   at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3520)
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
2017-04-21 07:24:23,824 ERROR [c.c.u.d.Merovingian2] (main:null) (logid:) Unable to get a new db connection
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
   at com.cloud.utils.db.TransactionLegacy.getStandaloneConnectionWithException(TransactionLegacy.java:212)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
2017-04-21 07:24:23,862 WARN  [o.a.c.s.m.c.ResourceApplicationContext] (main:null) (logid:) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lockMasterListener' defined in URL [jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-server-4.9.2.0.jar!/META-INF/cloudstack/system/spring-server-system-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cloud.server.LockMasterListener]: Constructor threw exception; nested exception is com.cloud.utils.exception.CloudRuntimeException: Unable to initialize a connection to the database for locking purposes
2017-04-24 01:19:18,333 ERROR [c.c.u.d.Merovingian2] (main:null) (logid:) Unable to get a new db connection
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
   at com.cloud.utils.db.TransactionLegacy.getStandaloneConnectionWithException(TransactionLegacy.java:212)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Caused by: java.net.SocketException: Network is unreachable (connect failed)
2017-04-24 01:19:18,387 WARN  [o.a.c.s.m.c.ResourceApplicationContext] (main:null) (logid:) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lockMasterListener' defined in URL [jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-server-4.9.2.0.jar!/META-INF/cloudstack/system/spring-server-system-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cloud.server.LockMasterListener]: Constructor threw exception; nested exception is com.cloud.utils.exception.CloudRuntimeException: Unable to initialize a connection to the database for locking purposes
2017-04-24 01:47:42,075 ERROR [c.c.u.d.Merovingian2] (main:null) (logid:) Unable to get a new db connection
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
   at com.cloud.utils.db.TransactionLegacy.getStandaloneConnectionWithException(TransactionLegacy.java:212)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
2017-04-24 01:47:42,111 WARN  [o.a.c.s.m.c.ResourceApplicationContext] (main:null) (logid:) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lockMasterListener' defined in URL [jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-server-4.9.2.0.jar!/META-INF/cloudstack/system/spring-server-system-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cloud.server.LockMasterListener]: Constructor threw exception; nested exception is com.cloud.utils.exception.CloudRuntimeException: Unable to initialize a connection to the database for locking purposes

數據庫連接異常。如何正確設置數據庫?我只是按照該指南進行操作,但不知道其他任何事情。

嘗試安裝 4.8 版本:

http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/4.8/qig.html

先安裝數據庫:

# yum -y install mysql-server
# service mysqld start
# chkconfig mysqld on

然後安裝 Cloudstack:

# yum -y install cloudstack-management
# cloudstack-setup-databases cloud:password@localhost --deploy-as=root
# cloudstack-setup-management

在此之後,您應該在 xxxx:8080/client 上獲得管理 ui,其中 xxxx 是伺服器的 ip。

引用自:https://serverfault.com/questions/844874