数据库丢弃和通信链路故障

时间:2015-06-29 20:15:06

标签: java database cygwin apache-cloudstack

我在Windows上设置了apache cloudstack。我成功mvn cleanmvn install但我在$ mvn -P developer -pl developer -Ddeploydb中输入cygwin命令时出错了。

当我按下输入显示以下错误时。

$ 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. 

请任何人给我解决这个问题。
 感谢。

1 个答案:

答案 0 :(得分: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验证和测试数据库服务器,如果未启动数据库,则启动数据库。
  • 刷新DNS或在JDBC URL中使用IP地址。
  • 验证mysqld是否在没有--skip-networking option的情况下启动。
  • 禁用防火墙和/或配置防火墙/代理以允许/转发端口。