一、什么是hive元數(shù)據(jù)? hive元數(shù)據(jù)就是hive的一些基本的元素,主要包括hive表的基本屬性,如下 (1)hive表的數(shù)據(jù)庫名、表名、字段名稱與類型、分區(qū)字段與類型 (2)表的分區(qū),分區(qū)的屬性location等 (3)serdeproperties, tblproperties等等 可以通過 desc
一、什么是hive元數(shù)據(jù)? hive元數(shù)據(jù)就是hive的一些基本的元素,主要包括hive表的基本屬性,如下 (1)hive表的數(shù)據(jù)庫名、表名、字段名稱與類型、分區(qū)字段與類型 (2)表的分區(qū),分區(qū)的屬性location等 (3)serdeproperties, tblproperties等等 可以通過 desc formatted tablename 查看表有哪些屬性 二、hive默認(rèn)元數(shù)據(jù)庫Derby(嵌入模式) hive-default.xml通過如下配置設(shè)置javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=metastore_db;create=true JDBC connect string for a JDBC metastore javax.jdo.option.ConnectionDriverName org.apache.derby.jdbc.EmbeddedDriver Driver class name for a JDBC metastore
hive.metastore.local true javax.jdo.option.ConnectionURL jdbc:mysql://localhost/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hive 第二種情況,hive-site.xml配置 javax.jdo.option.ConnectionPassword password javax.jdo.option.ConnectionURL jdbc:mysql://192.168.0.1:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hive javax.jdo.option.ConnectionPassword password hive.metastore.local false 第三種情況,hive-site.xml配置 1、 服務(wù)端配置 hive.metastore.uris thrift://192.168.0.101:9083 javax.jdo.option.ConnectionURL jdbc:mysql://192.168.1.214:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hive 2、客戶端配置 javax.jdo.option.ConnectionPassword password hive.metastore.local false 在使用hive開始前,如果mysql是部署在遠(yuǎn)端且 hive.metastore.local=false 則需要啟動(dòng)hive的metadata服務(wù) $ hive --service metastore 客戶端使用hive命令即可 root@local:~$ hive hive> show tables; OK Time taken: 0.7 seconds hive> hive.metastore.uris thrift://192.168.0.101:9083
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com