hive安裝常見錯誤


 hive編譯出錯

mvn clean package -DskipTests -Phadoop-2 -Pdist

失敗日志1

Failed to execute goal on project hive-service: Could not resolve dependencies for project org.apache.hive:hive-service:jar:1.1.0-cdh5.7.0: Failed to collect dependencies at org.apache.directory.server:apacheds-server-integ:jar:1.5.6 -> org.apache.directory.client.ldap:ldap-client-api:jar:0.1-SNAPSHOT: Failed to read artifact descriptor for org.apache.directory.client.ldap:ldap-client-api:jar:0.1-SNAPSHOT: Could not transfer artifact org.apache.directory.client.ldap:ldap-client-api:pom:0.1-SNAPSHOT from/to apache.snapshots (http://repository.apache.org/snapshots): Connect to repository.apache.org:80 [repository.apache.org/207.244.88.140] failed: Connection refused (Connection refused) -> [Help 1]

失敗日志2

[ERROR] Failed to execute goal on project hive-service:
Could not resolve dependencies for project org.apache.hive:hive-service:jar:1.1.0-cdh5.7.0:
Failed to collect dependencies at org.apache.directory.server:apacheds-server-integ:jar:1.5.6 -> org.apache.directory.client.ldap:ldap-client-api:jar:0.1-SNAPSHOT:
Failed to read artifact descriptor for org.apache.directory.client.ldap:ldap-client-api:jar:0.1-SNAPSHOT:
Could not transfer artifact org.apache.directory.client.ldap:ldap-client-api:pom:0.1-SNAPSHOT from/to apache.snapshots (http://repository.apache.org/snapshots):
Network is unreachable (connect failed) -> [Help 1]

 

暫未解決。。。

有可能時網絡的原因。


 

安裝后啟動不起來

日志:

Caused by: java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://hadoop000:3306/metastore?createDatabaseIfNotExist=true, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
java.sql.SQLException: Access denied for user 'root'@'hadoop000' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)

網上查看后,總結了解決方法

1.查看hive-site.xml是否配置正確,mysql的賬號密碼不能寫錯。

2.hive沒有初始化,進行初始化

schematool -dbType mysql -initSchema

3.hive版本過高。

4.HIVE_HOME/lib 下的derby-10.11.1.1.jar問題,,把derby-10.11.1.1.jar 換成derby-10.10.2.0.jar問題成功解決

綜上,我的問題是hive-site.xml配置文件中mysql的密碼寫錯了。

配置hive前必不可少的一項,給mysql賦予權限

mysql -uroot -p

>grant all privileges on *.* to root@"%" identified by "123456" with grant option; >grant all privileges on *.* to root@"hadoop000" identified by "123456" with grant option; >grant all privileges on *.* to root@"localhost" identified by "123456" with grant option;
>quit;

解釋:

grant 權限1,權限2,…權限n on 數據庫名稱.表名稱 to 用戶名@用戶地址 identified by ‘連接口令’;)

* mysql數據庫默認只允許root用戶通過localhost/127.0.0.1來登錄使用

* 上面帶有grant的那條語句中:

all:表示所有權限;

*.*:表示數據庫.數據表;

root:表示授權給哪個用戶,用戶名可以任意指定,如果沒有會自動創建;

'hadoop000' :授權給哪台主機

'123456':授權給用戶來登錄的密碼

如果不確定有沒有成功,可以查看 mysql.user

mysql >select host,user,password from mysql.user;

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM