Ambari 2.7.3.0-139:SQLException:SQL 状态:08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

Posted

技术标签:

【中文标题】Ambari 2.7.3.0-139:SQLException:SQL 状态:08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:通信链路故障【英文标题】:Ambari 2.7.3.0-139: SQLException: SQL state: 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 【发布时间】:2019-07-31 16:04:51 【问题描述】:

我收到以下错误情况: 2019-07-31 15:40:46,158 - 堆栈功能版本信息:Cluster Stack=3.1,Command Stack=None,Command Version=None -> 3.1

使用openjdk版本“1.8.0_212”,Hortonworks 3.1

我已经检查了 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 和 https://community.hortonworks.com/content/supportkb/196253/commysqljdbcexceptionsjdbc4communicationsexception.html 中的所有解决方案方面。他们都对我的问题没有帮助。

Command aborted. Reason: 'Server considered task failed and automatically aborted it'
2019-07-31 17:00:22,742 - Stack Feature Version Info: Cluster    Stack=3.1, Command Stack=None, Command Version=None -> 3.1
2019-07-31 17:00:22,746 - Using hadoop conf dir: /usr/hdp/3.1.0.0-78/hadoop/conf

2019-07-31 17:00:23,140 - Setting up Ranger KMS DB and DB User
2019-07-31 17:00:23,141 - Execute['ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q'] 'logoutput': True, 'environment': 'RANGER_KMS_HOME': u'/usr/hdp/current/ranger-kms', 'JAVA_HOME': u'/usr/lib/jvm/java-8-openjdk-amd64/', 'tries': 5, 'user': 'kms', 'try_sleep': 10
2019-07-31 17:00:23,173  [I] Running DBA setup script. QuiteMode:True
2019-07-31 17:00:23,173  [I] Using Java:/usr/lib/jvm/java-8-openjdk-amd64/bin/java
2019-07-31 17:00:23,173  [I] DB FLAVOR:MYSQL
2019-07-31 17:00:23,173  [I] DB Host:<FQDN_of_servername>
2019-07-31 17:00:23,173  [I] ---------- Verifing DB root password ---------- 
2019-07-31 17:00:23,174  [I] DBA root user password validated
2019-07-31 17:00:23,174  [I] ---------- Verifing Ranger KMS db user password ---------- 
2019-07-31 17:00:23,174  [I] KMS user password validated
2019-07-31 17:00:23,174  [I] ---------- Creating Ranger KMS db user ---------- 
2019-07-31 17:00:23,174  [JISQL] /usr/lib/jvm/java-8-openjdk-amd64/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://<FQDN_of_servername>/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
SQLException : SQL state: 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2019-07-31 17:00:23,402  [E] Can't establish db connection.. Exiting..
2019-07-31 17:00:23,407 - Retrying after 10 seconds. Reason: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2019-07-31 17:00:23,173  [I] Running DBA setup script. QuiteMode:True
2019-07-31 17:00:23,173  [I] Using Java:/usr/lib/jvm/java-8-openjdk-amd64/bin/java
2019-07-31 17:00:23,173  [I] DB FLAVOR:MYSQL
2019-07-31 17:00:23,173  [I] DB Host:<FQDN_of_servername>
2019-07-31 17:00:23,173  [I] ---------- Verifing DB root password ---------- 
2019-07-31 17:00:23,174  [I] DBA root user password validated
2019-07-31 17:00:23,174  [I] ---------- Verifing Ranger KMS db user password ---------- 
2019-07-31 17:00:23,174  [I] KMS user password validated
2019-07-31 17:00:23,174  [I] ---------- Creating Ranger KMS db user ---------- 
2019-07-31 17:00:23,174  [JISQL] /usr/lib/jvm/java-8-openjdk-amd64/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://<FQDN_of_servername>/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
SQLException : SQL state: 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2019-07-31 17:00:23,402  [E] Can't establish db connection.. Exiting..

后来在安巴里:

Error: 500 status code received on DELETE method for API: /api/v1/clusters/myclustername
Error message: org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Could not delete cluster, clusterName=myclustername

【问题讨论】:

【参考方案1】:

你能检查 MySQL 日志并在 Ambari 中发生错误时发布时间戳的 MySQL 日志吗?

【讨论】:

MySQL 日志中没有相关条目。之前,它有一个“通信链接故障”。

以上是关于Ambari 2.7.3.0-139:SQLException:SQL 状态:08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException的主要内容,如果未能解决你的问题,请参考以下文章

ambari 搭建hadoop大数据平台系列4-配置ambari-server

原创大数据基础之Ambari通过Ambari部署Airflow

自定义 Ambari 服务的 Ambari 用户和组管理

原创大数据基础之Ambari通过Ambari部署ElasticSearch

Ambari 与 Nifi 有啥区别……这些风筝、香蕉在 Ambari 或 Nifi 中是如何使用的?

ambari忘记密码