image.png
上圖報錯可以看出hive無法訪問到元數(shù)據(jù)惦费。
解決方案
眾所周知趟脂,hive的元數(shù)據(jù)存儲在Mysql當(dāng)中泰讽,連接Mysql我們可以啟動Hive metastore服務(wù)來幫助客戶端訪問元數(shù)據(jù)。
使用如下命令啟動Hive metastore服務(wù)
[root@RuHuTian bin] hive --service metastore & 2>&1 >/dev/null
Hive metastored 作用
客戶端連接metastore服務(wù)昔期,metastore再去連接MySQL數(shù)據(jù)庫來存取元數(shù)據(jù)已卸。有了metastore服務(wù),就可以有多個客戶端同時連接硼一,而且這些客戶端不需要知道MySQL數(shù)據(jù)庫的用戶名和密碼累澡,只需要連接metastore 服務(wù)即可。