Oozie時出現Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure?
不多說,直接上乾貨!
問題詳情
[[email protected] oozie-4.1.0-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
[[email protected] oozie-4.1.0-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m" Validate DB Connection Error: Could not connect to the database: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was0 milliseconds ago. The driver has not received any packets from the server. Stack trace for the error was (for debug purposes): -------------------------------------- java.lang.Exception: Could not connect to the database: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was0 milliseconds ago. The driver has not received any packets from the server. at org.apache.oozie.tools.OozieDBCLI.validateConnection(OozieDBCLI.java:905) at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:185) at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:129) at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:80) Caused by: 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. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at org.apache.oozie.tools.OozieDBCLI.createConnection(OozieDBCLI.java:895) at org.apache.oozie.tools.OozieDBCLI.validateConnection(OozieDBCLI.java:901) ... 3 more Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at java.net.Socket.<init>(Socket.java:425) at java.net.Socket.<init>(Socket.java:241) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) ... 19 more --------------------------------------
解決辦法
分析1: 是否你是mysql服務程序麼開啟。
比如我的mysql是在root使用者下安裝的,且安裝目錄是在/home/hadoop下。當然大家可以將mysql服務程序設定為開機啟動。
分析2:還有,是不是你的oozie使用者下的主機,沒有在資料庫列表裡。
<property> <name>oozie.db.schema.name</name> <value>oozie</value> <description> Oozie DataBase Name </description> </property> <property> <name>oozie.service.JPAService.create.db.schema</name> <value>false</value> <description> Creates Oozie DB. If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP. If set to false, it does not create the DB schema. If the DB schema does not exist it fails start up. </description> </property> <property> <name>oozie.service.JPAService.jdbc.driver</name> <value>com.mysql.jdbc.Driver</value> <description> JDBC driver class. </description> </property> <property> <name>oozie.service.JPAService.jdbc.url</name> <value>jdbc:mysql://bigdatamaster:3306/oozie?createDatabaseIfNotExist=true</value> <description> JDBC URL. </description> </property> <property> <name>oozie.service.JPAService.jdbc.username</name> <value>oozie</value> <description> DB user name. </description> </property> <property> <name>oozie.service.JPAService.jdbc.password</name> <value>oozie</value> <description> DB user password. IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value, if empty Configuration assumes it is NULL. </description> </property>
因為,也許你會像我這樣,之前在$OOZIE_HOME/conf/下的oozie-site.xml裡,已經配置好了。
但是呢,忘記設定了。
[[email protected] hadoop]# mysql -uroot -p Enter password: (預設回車) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select user,host,password from mysql.user; +------+---------------+-------------------------------------------+ | user | host | password | +------+---------------+-------------------------------------------+ | root | localhost | | | root | bigdatamaster | | | root | 127.0.0.1 | | | | localhost | | | | bigdatamaster | | | hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | | hive | bigdatamaster | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | | hive | localhost | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | +------+---------------+-------------------------------------------+ 8 rows in set (0.00 sec) mysql>
那麼,現在,我們開啟它。
mysql> create user 'oozie'@'%' identified by 'oozie'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* to 'oozie'@'%' IDENTIFIED BY 'oozie' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* to 'oozie'@'bigdatamaster' IDENTIFIED BY 'oozie' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* to 'oozie'@'localhost' IDENTIFIED BY 'oozie' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> select user,host,password from mysql.user; +-------+---------------+-------------------------------------------+ | user | host | password | +-------+---------------+-------------------------------------------+ | root | localhost | | | root | bigdatamaster | | | root | 127.0.0.1 | | | | localhost | | | | bigdatamaster | | | hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | | hive | bigdatamaster | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | | hive | localhost | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | | oozie | % | *2B03FE0359FAD3B80620490CE614F8622E0828CD | | oozie | bigdatamaster | *2B03FE0359FAD3B80620490CE614F8622E0828CD | | oozie | localhost | *2B03FE0359FAD3B80620490CE614F8622E0828CD | +-------+---------------+-------------------------------------------+ 11 rows in set (0.00 sec)
mysql> exit;
Bye
[[email protected] hadoop]#
[[email protected] oozie-4.1.0-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m" Validate DB Connection DONE Check DB schema does not exist DONE Check OOZIE_SYS table does not exist DONE Create SQL schema DONE Create OOZIE_SYS table DONE Oozie DB has been created for Oozie version '4.1.0-cdh5.5.4' The SQL commands have been written to: oozie.sql
[[email protected] oozie-4.1.0-cdh5.5.4]$ pwd /home/hadoop/app/oozie-4.1.0-cdh5.5.4 [[email protected] oozie-4.1.0-cdh5.5.4]$ ls bin docs libext LICENSE.txt NOTICE.txt oozie-core oozie-hadooplibs-4.1.0-cdh5.5.4.tar.gz oozie-sharelib-4.1.0-cdh5.5.4.tar.gz oozie.sql release-log.txt conf lib libtools logs oozie-4.1.0-cdh5.5.4 oozie-examples.tar.gz oozie-server oozie-sharelib-4.1.0-cdh5.5.4-yarn.tar.gz oozie.war src [[email protected] oozie-4.1.0-cdh5.5.4]$
成功!
然後呢,大家也許還會出現如下問題:
相關推薦
Oozie時出現Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure?
不多說,直接上乾貨! 問題詳情 [[email protected] oozie-4.1.0-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection [[email
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
啟動 exception fail 空格 jdbc bsp 回車 數據 實現 報錯:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 很尷尬的問題,翻譯一
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 解決辦法
09:00:30.307 [http-8080-6] ERROR org.hibernate.transaction.JDBCTransaction -JDBC begin failed com.mysql.jdbc.exceptions.jdbc4.Communicati
Error: Java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
tel -- 版本 erro cit nio bsp ip地址 cto 我在用sqoop把數據從mysql導入到hive的過程中遇到報錯Error: Java.lang.RuntimeException: java.lang.RuntimeException: com.my
資料庫連結斷開 Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
報錯資訊如下: Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExc
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 解決方案
當我將資料庫放到伺服器遠端訪問的時候出現了Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: SELECT command denied to user 'sq_shiyezhe'@'2
MySQL異常:Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
model out exec actions tracing ror pda tin dsta Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to ti
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from t
Caused by com mysql jdbc MysqlDataTruncation Data truncati
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!  
將windows上面的項目拷貝到Linux環境下報錯不能夠找到對應的表com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'puyang.ServiceType' doesn't exist
exce 服務 inux 區分 大小 blog alt logs 就會 將一模一樣的項目從win遷移到到linux上報錯: 一開始還是以為是linux不能識別hql語句,查找資料發現是因為Liunx服務器上mysql是區分大小寫的,而本地是不區分的如:代碼是這樣寫的@En
java.lang.Exception: 資源處理失敗,失敗原因:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '?????‰' in 'where clause'
exception 替換 div name jdbc unknown syn lan -s 1:Unknown column ‘?????‰‘ in ‘where clause‘,這個問題,百度一搜,挺多的,但是貌似好像沒有解決我的問題。貼一下我是如何拼接sq
Mysql連接問題:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
方式 mysq ber 安裝 解決方法 mysql cte 比較 安裝目錄 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establis
java項目連接jdbc報錯:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server
image mysq reat jar包 tor ima 新版 ransient java項目 java項目連接jdbc報錯:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Coul
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
例如 stmt string 數據庫操作 mys 異常 數據庫 exec execute com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column …… 出現這個異常的很大可能性是 數
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections
專案2分鐘更新一次井下人員狀況(查詢資料庫人員) 大概10分鐘以後就會出現異常! 之前因為這些內容是顯示在LED大屏上的,後來上去檢視大屏顯示異常,一位是區域網掉線的原因; 今天才發現是程式不夠完善 但是我明明關閉連線了啊,怎麼還是too many connections???
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
出現此種錯誤,我暫時遇到了兩次。 1 我的欄位的名稱和資料庫的關鍵字重合。 上圖中的desc是預設降序排列的意思。 2 第二次出現的異常是我在重構程式碼階段遇到的一個bug.不過我暫時不能理解,雖然解決了錯誤。 刪除操作的程式碼如下: public void delet
[jnhs]hibernate只能建立一張/表不建立表com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kaihu.t_client_info' doesn't exist和org.hibern
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kaihu.t_client_info' doesn't exist 有兩個model,使用第一個dao的時候可以自動建立表 但是使用第二個model的時候不能
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException最全解決
org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded;
這個錯誤是因為回滾的設定有問題,仔細檢查回滾這部分的程式碼,重新開啟伺服器測試就沒問題了。 com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try r
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException
原因: 資料庫表中有一些欄位不能為空,但在插入的過程中,有屬性值為空。 com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘from_name’ cannot be null