在已经搭建的Hadoop Ha集群上搭建hive
主要记录了配置文件信息
hive版本 3.1.2
mysql版本 5.7.36
2. mysql安装- 安装
sudo apt install mysql-server
- 使用debian-sys-maint账号登录
mysql -udebian-sys-maint -p # 密码在etc/mysql/debian.cnf
- 修改root密码
use mysql;
update user set authentication_string=PASSWORD('123456') where user='root' and host= 'localhost';
# 这一步很重要
update user set plugin="mysql_native_password";
flush privileges;
- 重启
sudo service mysql restart3. hive安装
- 环境变量
export HIVE_HOME=/usr/local/hive export PATH=$PATH:$HIVE_HOME/bin
- 配置hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory # Hadoop目录 HADOOP_HOME=/usr/local/hadoop # Hive Configuration Directory can be controlled by: # Hive 配置文件路径 export HIVE_CONF_DIR=/usr/local/hive/conf
- 配置hive-site.xml
javax.jdo.option.ConnectionURL jdbc:mysql://ip:3306/hive?createDatabaseIfNotExist=true&useSSL=false JDBC connect string for a JDBC metastore javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver Driver class name for a JDBC metastore javax.jdo.option.ConnectionUserName root username to use against metastore database javax.jdo.option.ConnectionPassword 123456 password to use against metastore database hive.metastore.warehouse.dir /hive location of default database for the warehouse hive.server2.thrift.bind.host ip hive.server2.thrift.port 10000
- 配置log4j.properties
property.hive.log.dir = /usr/local/hive/log
- hadoop core-site.xml增加配置
hadoop.proxyuser.root.hosts * hadoop.proxyuser.root.groups * hadoop.proxyuser.用户名.hosts * hadoop.proxyuser.用户名.groups *
- 启动
#beeline启动 beeline !connect jdbc:hive2://ip:10000



