2019-01-20
閱讀量:
1921
hive --service metastore 干啥的?
hive --service metastore 命令是干啥的?
答:理解這個命令之前需要知道hive元數(shù)據(jù)庫的配置方式。hive metastore有兩類配置方法:本地模式與遠程模式。
本地模式:可以使用自帶derby,也可以使用MySQL等關(guān)系型數(shù)據(jù)庫。他們都與hive部署在同一個節(jié)點上
使用derby與MySQL作為元數(shù)據(jù)庫的區(qū)別是: derby在同一個目錄下同時只能有一個hive客戶端能使用數(shù)據(jù)庫,否則會提示如下錯誤,只適合簡單的測試。
hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to start database 'metastore_db', see the next exception for details.
NestedThrowables:
java.sql.SQLException: Failed to start database 'metastore_db', see the next exception for details.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
為了支持多用戶多會話,則需要一個獨立的元數(shù)據(jù)庫,我們使用 MySQL 作為元數(shù)據(jù)庫可以達到這個效果
遠程模式:元數(shù)據(jù)庫還可以遠程部署,遠程存儲比較符合生產(chǎn)環(huán)境需求。這種存儲方式需要在遠端服務(wù)器運行一個MySQL服務(wù)器,并且需要在Hive服務(wù)器啟動meta服務(wù)。
如何啟動Hive服務(wù)器啟動meta服務(wù)的方式就是
hive --service metastore






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論