虚拟机下安装hive

发布于:2021-12-08 21:17:22

1.前置安装hadoop 以及 zookeeper(这里安装了hadoop2.6.0及zookeeper3.4.6)
2.安装mysql数据库
3.需要压缩包hive-1.1.0-cdh5.14.2.tar.gz以及mysql-connector-java-5.1.32


拷贝mysql驱动到hive/lib下


cp mysql-connector-java-5.1.32 /opt/software/hadoop/hive110/lib

解压缩,重命名,授权


tar -zxvf hive-1.1.0-cdh5.14.2.tar.gz -C /opt/software/hadoop/
mv hive-1.1.0-cdh5.14.2.tar hive110
chown -R root:root hive110/

设置配置文件
/opt/software/hadoop/hive110/conf下 vi hive-site.xml(没有,需要自己新建)






hive.metastore.warehouse.dir
/opt/software/hadoop/hive110/warehouse


javax.jdo.option.ConnectionURL
jdbc:mysql://192.168.181.128:3306/hive110?createDatabaseIfNotExist=true


javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver


javax.jdo.option.ConnectionUserName
root


javax.jdo.option.ConnectionPassword
root


hive.metastore.schema.verification
false



hive.server2.authentication
NONE


hive.server2.thrift.client.user
root


hive.server2.thrift.client.password
root




配置环境变量:vi etc/profile


#HIVE
export HIVE_HOME=/opt/soft/hive110
export PATH=$HIVE_HOME/bin:$PATH


激活source /etc/profile


按顺序启动服务(hadoop?>zookeeper?>hive):
start-all.sh
zkServer.sh start
nohup hive --service metastore>/dev/null 2>&1 &
nohup hive --service hiveserver2>/dev/null 2>&1 &

[root@single bin]# ./beeline -u jdbc:hive2://single:10000
报错:Error: Failed to open new session: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.hadoop.security.AccessControlException: Permission denied: user=anonymous, access=EXECUTE, inode="/tmp":root:supergroup:drwxrwx?


修改文件夹权限:
hdfs dfs -chmod -R 777 /tmp


再用beeline登录就成功了:

相关推荐

最新更新

猜你喜欢