2016-05-13 37 views
0

我試圖從CLI進入蜂巢外殼,但它的失敗: - 我嚴格遵循此鏈接安裝: - http://www.tutorialspoint.com/hive/hive_installation.htm無法通過拋出下面的錯誤進入蜂巢殼牌

Exception in thread "main" java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:derby://localhost:1527/metastore_db;create=true , username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------ java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/metastore_db;create=true

java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:derby://localhost:1527/metastore_db;create=true , username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------ java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/metastore_db;create=trueCaused by: java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:derby://localhost:1527/metastore_db;create=true , username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app).

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-2.0.0.jar!/hive-log4j2.properties Exception in thread "main" java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

+0

不知道這是否是同樣的問題,但檢查這個環節。我最近在ubuntu上安裝了配置單元,並面臨以下問題。 http://stackoverflow.com/questions/35655306/hive-installation-issues-hive-metastore-database-is-not-initialized – AMITAVA

+0

配置完'.bashrc'之後,你重新啓動了'terminal'嗎?如果是,那麼請共享'echo $ CLASSPATH'和'ls -l $ DERBY_HOME/lib/derbytools.jar'命令的輸出。 – Mahendra

+0

是的,我重新啓動.bashrc。 echo $ CLASSPATH的輸出是:/ home/ajith/hadoop/lib /*:.:/ usr/local/hive/lib /*:.:/ usr/local/derby/lib/derby.jar:/ usr/local/derby/lib/derbytools.jar和ls -l $ DERBY_HOME/lib/derbytools.jar ---> -rwxrwxrwx 1 root root 229665 2015年9月20日/usr/local/derby/lib/derbytools.jar –

回答

0

你的鏈接指的是安裝配置單元看起來很舊(對於apache-hive- 0.14.0,這需要單獨的德比數據庫)。

取而代之,您可以嘗試安裝apache-hive- 1.2.1,它們具有內置derby數據庫,您不必顯式安裝和配置數據庫。

您可以嘗試在這個博客install-hive-121-on-ubuntu-1404

+0

取代德比我用MYSQL和問題解決了謝謝 –

0

您有從蜂房服務器之前啓動Derby數據庫中提到的步驟。

1527端口是德比港。 雖然啓動配置單元服務器,最初它訪問德比端口。

,所以還是德比\ bin並鍵入「startNetworkServer」

給上面的命令1527端口後會聽, 然後啓動蜂巢metastore和hiveserver2。

現在,hive服務器可以正常工作。

當然這更有助於您

0
Place sql driver in $HOME/lib folder 


change hive-site.xml properties 


<property> 
<name>javax.jdo.option.ConnectionDriverName</name> 
<value>com.mysql.jdbc.Driver</value> 
<description>Driver class name for a JDBC metastore</description> 
</property> 



<property> 
    <name>javax.jdo.option.ConnectionURL</name> 
    <value>jdbc:mysql://localhost:3306/hive_metastore_db?createDatabaseIfNotExist=true</value> 
    </property> 



<property> 
    <name>datanucleus.autoCreateSchema</name> 
    <value>true</value> 
</property> 

<property> 
    <name>datanucleus.fixedDatastore</name> 
    <value>true</value> 
</property> 

<property> 
<name>datanucleus.autoCreateTables</name> 
<value>True</value> 
</property> 

<property> 
    <name>javax.jdo.option.ConnectionPassword</name> 
    <value>root</value> 
    <description>password to use against metastore database</description> 
    </property> 


<property> 
    <name>javax.jdo.option.ConnectionUserName</name> 
    <value>root</value> 
    <description>Username to use against metastore database</description> 
    </property>