日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Hive安裝與配置——深入淺出學Hive

系統 2815 0
Hadoop 環境介紹
?Hadoop安裝路徑
?/home/test/Desktop/hadoop-1.0.0/
?Hadoop 元數據存放目錄
?/home/test/data/core/namenode
?Hadoop 數據存放路徑
?/home/test/data/core/datanode
Hive 環境規劃
?Hive安裝路徑
?/home/test/Desktop/
?Hive數據存放路徑
?hdfs
?/user/hive/warehouse
?Hive元數據
?第三方數據庫
?derby mysql
軟件準備
?OS
?ubuntu
?JDK
?java 1.6.0_27
?Hadoop
?hadoop-1.0.0.tar
?Hive
?hive-0.8.1.tar
第二部分:Hive項目介紹
項目結構
Hive安裝與配置——深入淺出學Hive
Hive 配置文件介紹
?hive-site.xml hive的配置文件
?hive-env.sh hive的運行環境文件
?hive-default.xml.template 默認模板
?hive-env.sh.template hive-env.sh默認配置
?hive-exec-log4j.properties.template exec默認配置
?hive-log4j.properties.template log默認配置
hive -site.xml
< property>
<name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?createData baseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<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.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>test</value>
<description>password to use against metastore database</description>
</property>
hive -env.sh
?配置Hive的配置文件路徑
?export HIVE_CONF_DIR= your path
?配置Hadoop的安裝路徑
?HADOOP_HOME=your hadoop home
第三部分:使用Derby數據庫的安裝方式
什么是 Derby 安裝方式
?Apache Derby是一個完全用java編寫的數據庫,所以可以跨平臺,但需要在JVM中運行
?Derby是一個Open source的產品,基于Apache License 2.0分發
?即將元數據存儲在Derby數據庫中,也是Hive默認的安裝方式
安裝 Hive
?解壓Hive
?tarzxvf hive-0.8.1.tar /home/test/Desktop
?建立軟連接
?ln –s hive-0.8.1 hive
?添加環境變量
?export HIVE_HOME=/home/test/Desktop/hive
?export PATH=….HIVE_HOME/bin:$PATH:.
配置 Hive
?進入hive/conf目錄
?依據hive-env.sh.template,創建hive-env.sh文件
?cp hive-env.sh.template hive-env.sh
?修改hive-env.sh
?指定hive配置文件的路徑
?export HIVE_CONF_DIR=/home/test/Desktop/hive/conf
?指定Hadoop路徑
?HADOOP_HOME=/home/test/Desktop/hadoop
hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>APP</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>mine</value>
<description>password to use against metastore database</description>
</property>
啟動 Hive
?命令行鍵入
?Hive
?顯示
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/test/Desktop/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/test/hive_job_log_test_201208260529_167273830.txt
hive>
測試語句
?建立測試表test
?create table test (key string);
?show tables;
第四部分:使用MySQL數據庫的安裝方式
安裝 MySQL
?Ubuntu 采用apt-get安裝
?sudo apt-get install mysql-server
?建立數據庫hive
?createdatabasehive
?創建hive用戶,并授權
?grantallonhive.*tohive@'%'identifiedby'hive';
?flushprivileges;
安裝 Hive
?解壓Hive
?tarzxvf hive-0.8.1.tar /home/test/Desktop
?建立軟連接
?ln –s hive-0.8.1 hive
?添加環境變量
?export HIVE_HOME=/home/test/Desktop/hive
?export PATH=….HIVE_HOME/bin:$PATH:.
修改 hive-site.xml
<property>
<name> javax.jdo.option.ConnectionURL </name>
<value> jdbc:mysql://localhost:3306/hive </value>
</property>
<property>
<name> javax.jdo.option.ConnectionDriverName </name>
<value> com.mysql.jdbc.Driver </value>
</property>
<property>
<name> javax.jdo.option.ConnectionPassword </name>
<value> hive </value>
</property>
<property>
<name> hive.hwi.listen.port </name>
<value> 9999 </value>
<description> ThisistheporttheHiveWebInterfacewilllistenon </description>
</property>
<property>
<name> datanucleus.autoCreateSchema </name>
<value> false </value>
</property>
<property>
<name> datanucleus.fixedDatastore </name>
<value> true </value>
</property>
<property>
<name> hive.metastore.local </name>
<value> true </value>
<description> controlswhethertoconnecttoremovemetastoreserveroropenanewmetastoreserverinHiveClientJVM </description>
</property>
啟動 Hive
?命令行鍵入
?Hive
?顯示
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/test/Desktop/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/test/hive_job_log_test_201208260529_167273830.txt
hive>
測試語句
?建立測試表test
?create table test (key string);
?show tables;

Hive安裝與配置——深入淺出學Hive


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 金寨县| 星子县| 望都县| 福贡县| 泗洪县| 洞口县| 郓城县| 安宁市| 云南省| 临海市| 孙吴县| 姚安县| 郓城县| 香格里拉县| 南川市| 和顺县| 措美县| 宣化县| 南京市| 高要市| 健康| 讷河市| 江门市| 姚安县| 玛曲县| 曲沃县| 图们市| 叙永县| 鄢陵县| 曲麻莱县| 昭苏县| 遂平县| 南汇区| 迁西县| 库车县| 龙山县| 平定县| 改则县| 库伦旗| 普兰县| 宁蒗|