2015-06-29 104 views
-1

我在Windows上設置了apache cloudstack。我成功完成了mvn cleanmvn install,但當我在cygwin中輸入$ mvn -P developer -pl developer -Ddeploydb命令時出現錯誤。數據庫丟失和通信鏈路故障

當我點擊輸入顯示下面的錯誤。

$ mvn -P developer -pl developer -Ddeploydb 

[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Apache CloudStack Developer Mode 4.6.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.11:check (cloudstack-checkstyle) @ cloud-de 
veloper --- 
[INFO] Starting audit... 
Audit done. 

[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default) 
@ cloud-developer --- 
[WARNING] Ignoring missing properties file: C:\cs\developer\..\utils\conf\db.pro 
perties.override 
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.3:process (default) @ cloud-developer 
--- 
[INFO] 
[INFO] --- maven-antrun-plugin:1.8:run (default) @ cloud-developer --- 
[INFO] Executing tasks 

main: 
[INFO] Executed tasks 
[INFO] 
[INFO] >>> exec-maven-plugin:1.2.1:java (create-schema) > validate @ cloud-devel 
oper >>> 
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.11:check (cloudstack-checkstyle) @ cloud-de 
veloper --- 
[INFO] Starting audit... 
Audit done. 

[INFO] 
[INFO] <<< exec-maven-plugin:1.2.1:java (create-schema) < validate @ cloud-devel 
oper <<< 
[INFO] 
[INFO] --- exec-maven-plugin:1.2.1:java (create-schema) @ cloud-developer --- 
log4j:WARN No appenders could be found for logger (org.springframework.core.env. 
StandardEnvironment). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in 
fo. 
========> WARNING: Provided file does not exist: C:\cs\developer/../utils/conf/d 
b.properties.override 
========> WARNING: Provided file does not exist: C:\cs\developer/developer-prefi 
ll.sql.override 
========> Initializing database=cloud with host=localhost port=3306 username=clo 
ud password=cloud 
============> Running query: drop database if exists `cloud` 
SQL exception in trying initDB: com.mysql.jdbc.exceptions.jdbc4.CommunicationsEx 
ception: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driv 
er has not received any packets from the server. 

任何人都請給我這個問題的解決方案。
謝謝。

+2

可能是因爲在網站上發佈數據庫的用戶名/密碼和端口不是一個好主意。 – Alp

回答

1
SQL exception in trying initDB: com.mysql.jdbc.exceptions.jdbc4.CommunicationsEx 
ception: Communications link failure 

這意味着DB isn't reachable at all。這可能的以下原因的一種或多種:在JDBC URL

  • IP地址或主機名是錯誤的。
  • 本地DNS服務器無法識別JDBC URL中的主機名。
  • JDBC URL中缺少端口號或錯誤 。
  • 數據庫服務器已關閉或數據庫服務器不接受TCP/IP 連接或數據庫服務器已用盡連接。
  • 某物阻塞連接,例如防火牆或代理。

爲了解決這些,你可以遵循:

  • 驗證,並與ping測試數據庫服務器,如果DB不那麼開始啓動DB。
  • 刷新DNS或改爲使用JDBC URL中的IP地址。
  • 驗證mysqld是否在沒有--skip-networking option的情況下啓動。
  • 禁用防火牆和/或配置防火牆/代理以允許/轉發端口。
+0

你好Arpit,我是新的雲端。那麼你能告訴我如何用ping來驗證數據庫服務器。 –

+0

使用'telnet',它也會檢查端口:'telnet db.ip portn'例如'telnet 10.90.23.10 1433' – Arpit

+0

Hello Arpit,如何檢查DataBase IP和端口號。 –

相關問題