hive安装文档,
hive安装文档
1. 上传、解压、重命名
1.1. 上传
在随便一台有hadoop环境的机器上上传安装文件
su - hadoop
rz –y
1.2. 解压
解压缩:hive-0.9.0-bin.tar.gz
tar -zxvf hive-0.9.0-bin.tar.gz
1.3. 重命名
mv hive-0.9.0-bin hive
2. 修改环境变量
su – root
vi /etc/profile
添加内容:
|
export HIVE_HOME=/home/hadoop/hive export PATH=$PATH::$HIVE_HOME/bin
|
source /etc/profile
su - hadoop
3. 修改hive配置文件
cd hive/conf
cp hive-default.xml.templatehive-default.xml
cp hive-default.xml hive-site.xml
cp hive-env.sh.template hive-env.sh
vi hive-env.sh
添加内容:
|
export HADOOP_HOME=/home/hadoop/hadoop |
4. 验证安装
4.1. 通过命令行
hive
>show databases;
4.2. 运行web接口
hive --service hwi
http://master:9999/hwi
4.3. 启动hive的jdbc服务端thrift服务接口
引入包:1、hive包;2、mysql包;3、hadoop包。
hive --service hiveserver 50000
5. 异常解析
hive异常 show tables 无法使用 : Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
异常:
hive> show tables;
FAILED: Error in metadata:java.lang.RuntimeException: Unable to instantiaterg.apache.hadoop.hive.metastore.HiveMetaStoreClient
FAILED: Execution Error, return code 1from org.apache.hadoop.hive.ql.exec.DDLTask
原因:在其他shell 开了hive没有关闭
使用 ps -ef | grep hive
kill -9
杀死进程