CDH5之Unexpected error.Unable to verify database connection
在部署好CDH5(HDFS+MapReduce+Zookeeper)後,某一天想要透過web介面來新增Hive或者Oozie服務。
新增Hive元件服務:
1.報錯:Unexpected error.Unable to verify database connection
2.解決辦法(曲線救國的辦法):
a.先選hive的服務節點,從namenode節點改為cm節點,這樣就會在cm節點上建立角色
b.等部署完畢
c.進hive tab頁,遷移角色或者刪除角色,重新新增
新增Oozie元件服務:
1.又報錯:Unexpected error.Unable to verify database connection
2.解決辦法(根源方法)
[root@hadoopdn-04 ~]# tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
2016-02-09 13:20:44,062 INFO 67058165@scm-web-132:com.cloudera.server.cmf.cluster.RulesCluster: Done with service and role creation
2016-02-09 13:21:25,474 INFO 1079246313@scm-web-136:com.cloudera.cmf.service.ServiceHandlerRegistry: Executing host command OozieTestDatabaseConnection BasicCmdArgs{args=[hadoopnn-01, mysql, hadoopdn-04, oozie, oozie, oozie_password]}. Host: DbHost{id=1, hostId=4f4999cd-42fd-4f9f-949e-c9581ed98d7f, hostName=hadoopnn-01}
2016-02-09 13:21:25,667 WARN 264839353@agentServer-98:com.cloudera.server.cmf.AgentProtocolImpl: Received Process Heartbeat for unknown (or duplicate) process. Ignoring. This is expected to happen once after old process eviction or process deletion (as happens in restarts).id=775 name=null host=4f4999cd-42fd-4f9f-949e-c9581ed98d7f/hadoopnn-01
2016-02-09 13:21:27,380 INFO CommandPusher:com.cloudera.cmf.service.AbstractOneOffHostCommand: Unsuccessful 'OozieTestDatabaseConnection'
2016-02-09 13:21:27,381 INFO CommandPusher:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: Command exited with code: 1
2016-02-09 13:21:27,381 INFO CommandPusher:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: + local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA7_HOME_CANDIDATES[@]} ${JAVA8_HOME_CANDIDATES[@]} ${JAVA6_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA7_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${OPENJAVA6_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.7.0_40 /usr/java/jdk1.7.0_67-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.7.0_67-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.7.0_67-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ source_parcel_environment
+ '[' '!' -z '' ']'
+ JAVA=/usr/java/jdk1.7.0_67-cloudera/bin/java
+ [[ -z /usr/share/cmf ]]
+ MGMT_CLASSPATH='/usr/share/cmf/lib/*'
+ JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar
+ MGMT_CLASSPATH='/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*'
++ pwd
+ MGMT_CLASSPATH='/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*'
+ MGMT_JAVA_OPTS='-Djava.net.preferIPv4Stack=true '
+ exec /usr/java/jdk1.7.0_67-cloudera/bin/java -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/urandom -cp '/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*' com.cloudera.enterprise.dbutil.DbCommandExecutor db.properties
Error: Could not find or load main class com.cloudera.enterprise.dbutil.DbCommandExecutor
###################################################################################################################################
當前情況:在hadoopnn-01(namenode)部署Oozie服務,而資料庫在hadoopdn-04(cm)上(使用mysql資料庫).
分析以下這句報錯及圖01(報錯資訊太過模糊,無法準確定位錯誤,所以還是要善於使用 tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log):
+ exec /usr/java/jdk1.7.0_67-cloudera/bin/java -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/urandom -cp '/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*' com.cloudera.enterprise.dbutil.DbCommandExecutor db.properties
經過分析驗證:
1. /usr/share/java/mysql-connector-java.jar 路徑存在(網上好多報該錯誤時,給的是這個mysql-connector-java.jar沒有在相應路徑配置,純屬瞎扯淡。假如沒有這個jar,報錯就不是這個錯誤了,會非常明顯的)
2. /usr/share/cmf/lib/* ,該路徑不存在,因為這個 cmf/lib/* 是部署在cm機器上的,只要對應的從cm機器scp到hadoopnn-01機器的相同路徑即可
然後,在去驗證與mysql是否連線上,如圖02(Successful)。
備註: 之前我單獨新增hive服務時,也是這個錯誤,只不過當時採取了一種曲線救國的方式。
新增Hive元件服務:
1.報錯:Unexpected error.Unable to verify database connection
2.解決辦法(曲線救國的辦法):
a.先選hive的服務節點,從namenode節點改為cm節點,這樣就會在cm節點上建立角色
b.等部署完畢
c.進hive tab頁,遷移角色或者刪除角色,重新新增
新增Oozie元件服務:
1.又報錯:Unexpected error.Unable to verify database connection
2.解決辦法(根源方法)
[root@hadoopdn-04 ~]# tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
2016-02-09 13:20:44,062 INFO 67058165@scm-web-132:com.cloudera.server.cmf.cluster.RulesCluster: Done with service and role creation
2016-02-09 13:21:25,474 INFO 1079246313@scm-web-136:com.cloudera.cmf.service.ServiceHandlerRegistry: Executing host command OozieTestDatabaseConnection BasicCmdArgs{args=[hadoopnn-01, mysql, hadoopdn-04, oozie, oozie, oozie_password]}. Host: DbHost{id=1, hostId=4f4999cd-42fd-4f9f-949e-c9581ed98d7f, hostName=hadoopnn-01}
2016-02-09 13:21:25,667 WARN 264839353@agentServer-98:com.cloudera.server.cmf.AgentProtocolImpl: Received Process Heartbeat for unknown (or duplicate) process. Ignoring. This is expected to happen once after old process eviction or process deletion (as happens in restarts).id=775 name=null host=4f4999cd-42fd-4f9f-949e-c9581ed98d7f/hadoopnn-01
2016-02-09 13:21:27,380 INFO CommandPusher:com.cloudera.cmf.service.AbstractOneOffHostCommand: Unsuccessful 'OozieTestDatabaseConnection'
2016-02-09 13:21:27,381 INFO CommandPusher:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: Command exited with code: 1
2016-02-09 13:21:27,381 INFO CommandPusher:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: + local MISCJAVA_HOME_CANDIDATES
+ case ${BIGTOP_JAVA_MAJOR} in
+ JAVA_HOME_CANDIDATES=(${JAVA7_HOME_CANDIDATES[@]} ${JAVA8_HOME_CANDIDATES[@]} ${JAVA6_HOME_CANDIDATES[@]} ${MISCJAVA_HOME_CANDIDATES[@]} ${OPENJAVA7_HOME_CANDIDATES[@]} ${OPENJAVA8_HOME_CANDIDATES[@]} ${OPENJAVA6_HOME_CANDIDATES[@]})
+ '[' -z '' ']'
+ for candidate_regex in '${JAVA_HOME_CANDIDATES[@]}'
++ ls -rvd /usr/java/jdk1.7.0_40 /usr/java/jdk1.7.0_67-cloudera
+ for candidate in '`ls -rvd ${candidate_regex}* 2>/dev/null`'
+ '[' -e /usr/java/jdk1.7.0_67-cloudera/bin/java ']'
+ export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ break 2
+ verify_java_home
+ '[' -z /usr/java/jdk1.7.0_67-cloudera ']'
+ echo JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
+ source_parcel_environment
+ '[' '!' -z '' ']'
+ JAVA=/usr/java/jdk1.7.0_67-cloudera/bin/java
+ [[ -z /usr/share/cmf ]]
+ MGMT_CLASSPATH='/usr/share/cmf/lib/*'
+ JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar
+ MGMT_CLASSPATH='/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*'
++ pwd
+ MGMT_CLASSPATH='/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*'
+ MGMT_JAVA_OPTS='-Djava.net.preferIPv4Stack=true '
+ exec /usr/java/jdk1.7.0_67-cloudera/bin/java -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/urandom -cp '/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*' com.cloudera.enterprise.dbutil.DbCommandExecutor db.properties
Error: Could not find or load main class com.cloudera.enterprise.dbutil.DbCommandExecutor
###################################################################################################################################
當前情況:在hadoopnn-01(namenode)部署Oozie服務,而資料庫在hadoopdn-04(cm)上(使用mysql資料庫).
分析以下這句報錯及圖01(報錯資訊太過模糊,無法準確定位錯誤,所以還是要善於使用 tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log):
+ exec /usr/java/jdk1.7.0_67-cloudera/bin/java -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/urandom -cp '/var/run/cloudera-scm-agent/process/795-OOZIE.OOZIE_SERVER-test-db-connection:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-jdbc.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/lib/*' com.cloudera.enterprise.dbutil.DbCommandExecutor db.properties
經過分析驗證:
1. /usr/share/java/mysql-connector-java.jar 路徑存在(網上好多報該錯誤時,給的是這個mysql-connector-java.jar沒有在相應路徑配置,純屬瞎扯淡。假如沒有這個jar,報錯就不是這個錯誤了,會非常明顯的)
2. /usr/share/cmf/lib/* ,該路徑不存在,因為這個 cmf/lib/* 是部署在cm機器上的,只要對應的從cm機器scp到hadoopnn-01機器的相同路徑即可
點選(此處)摺疊或開啟
-
[root@hadoopnn-01 ~]# cd /usr/share/
-
[root@hadoopnn-01 share]# mkdir -p cmf/lib
- [root@hadoopdn-04 ~]# scp /usr/share/cmf/lib/* root@hadoopnn-01:/usr/share/cmf/lib
備註: 之前我單獨新增hive服務時,也是這個錯誤,只不過當時採取了一種曲線救國的方式。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-1987886/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL1116N A connection to or activation of database "TESTDB" cannot be madeSQLDatabase
- Bug 12725963 - New database connection fails with ORA-12541 after vip failoverDatabaseAI
- Error establishing a database connection 的解決方法(發現黑客入侵)ErrorDatabase黑客
- Tomcat DBCP(Database Connection Pool) 資料庫連線池入門介紹TomcatDatabase資料庫
- ORA-02062: distributed recovery 引起的 ORA-02019: connection description for remote database not foundREMDatabase
- RuneScape - To verify your level of combatBAT
- nacos Connection refused (Connection refused)
- 人大金倉資料庫kingbase備份時老是提示sys_dump: error: connection to database or services資料庫ErrorDatabase
- error unexpected trailing commaErrorAI
- SyntaxError: Unexpected keyword 'const'?Error
- Database Connection Pool 資料庫連線池-01-概覽及簡單手寫實現Database資料庫
- [20180619]bbed verify問題.txt
- Connection
- jq jsonp跨域報錯之“Unexpected token :”的解決方案JSON跨域
- Uncaught SyntaxError: Unexpected token <反思Error
- PHP composer 報錯 certificate verify failedPHPAI
- java.net.ConnectException: Connection refused (Connection refused)JavaException
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- 如何處理WordPress網站提示“建立資料庫連線時出錯”或“Error establishing a database connection”錯誤網站資料庫ErrorDatabase
- Solaris syntax error: unexpected end of fileError
- unexpected reloc type問題分析
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error:Can't connect to SOCKS proxy:Connection refused (Connection refused)Error
- nmcli connection reload
- 完美解決 Uncaught SyntaxError: Unexpected token ‘<‘Error
- .Net 8.0 下的新RPC,IceRPC之如何建立連線connectionRPC
- Database TimeoutDatabase
- database no shardingDatabase
- Database OverallDatabase
- CDH5大資料實驗平臺搭建筆記H5大資料筆記
- Abp框架之執行Update-Database 命令系列錯誤框架Database
- yarn socket connection timeoutYarn
- 關於Residual Connection
- 684-Redundant Connection
- No suitable application records were found. Verify your bundle ideUIAPPIDE
- 路由 [verification.verify] 未定義的解決方法!路由
- jquery Ajax 請求錯誤 Unexpected tokenjQuery