Hadoop 2.2.0 環境 HIVE 0.11安裝
阿新 • • 發佈:2018-12-09
準備工作:
1、Hadoop 2.2.0環境執行正常;
2、下載HIVE0.11版本。
操作步驟:
1、解壓HIVE 0.11的檔案
tar zxvf hive-0.11.0-bin.tar.gz -C /opt
2、修改.bash_profile檔案,新增:
HIVE_HOME=/opt/hive-0.11.0-bin;
export HIVE_HOME;
export PATH=$HIVE_HOME/bin:$PATH
3、在$HIVE_HOME/conf目錄下,執行如下命令生成hive的配置
cp hive-default.xml.template hive-site.xml
cp hive-env.sh.template hive-env.sh
cp hive-exec-log4j.properties.template hive-exec-log4j.properties
cp hive-log4j.properties.template hive-log4j.properties
4、建立HIVE使用的hdfs目錄:
hdfs dfs -mkdir -p /user/hive/warehouse
hdfs dfs -mkdir /tmp
hdfs dfs -chmod g+w /tmp
hdfs dfs -chmod g+w /usr/hive/warehouse
5、Linux shell下直接使用hive命令,在hive下建立一個表格
hive> show databases; OK default Time taken: 15.214 seconds, Fetched: 1 row(s) hive> show tables; OK Time taken: 1.621 seconds hive> create create create_union( hive> create ta table tables tablesample tan( hive> create table zq_blog(id IN INPATH INPUTFORMAT INSERT INT INTO hive> create table zq_blog(id INT, siteurl STRING); OK Time taken: 1.269 seconds hive> SHOW TABLE TABLE TABLES TABLESAMPLE hive> SHOW TABLEs; OK zq_blog Time taken: 0.102 seconds, Fetched: 1 row(s) hive> quit