參考文檔:http://www.mashibing.com/hive.html
設置環境變量,解壓安裝包
#tar xzvf apache-hive-2.1.1-bin.tar.gz
#mv apache-hive-2.1.1-bin /usr/local/hive
[root@master hive]# tail /etc/profile
fi
fi
done
unset i
unset -f pathmunge
export HADOOP_HOME=/usr/local/hadoop
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:/usr/local/hadoop/bin/:/usr/local/hadoop/sbin/:$HIVE_HOME/bin
編輯配置文件
# cp hive-default.xml.template hive-site.xml
# mkdir /usr/local/hive/tmp
修改hive.metastore.schema.verification,設定為false
使用vi打開文件hive-site.xml,執行
:%s/${system:java.io.tmpdir}/\/usr\/local\/hive\/tmp 會替換四處
:%s/${system:user.name}/root/ 會替換三處
初始化元數據
#schematool -initSchema -dbType derby
注意:此命令會在當前目錄下生成metastore_db目錄 ,每次啟動hive時,都會在當前目錄下尋找 metastore_db目錄。所以之后盡量在當前目錄下啟動hive
啟動Hive
#hive