- 下载hive上传hive并解压到想要安装的目录下修改配置文件
cp hive-log4j2.properties.template hive-log4j2.properties
修改日志文件目录为 /usr/local/software/hive-3.1.2/logs/
复制 hive-env.sh.template 为hive-env.sh 并修改
复制 hive-default.xml.template 为hive-site.xml 并在尾部添加
javax.jdo.option.ConnectionURL jdbc:mysql://hadoop2:3306/hive?useSSL=false&serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF8&autoReconnect=true&failOverReadonly=false javax.jdo.option.ConnectionDriverName com.mysql.cj.jdbc.Driver javax.jdo.option.ConnectionUserName root javax.jdo.option.ConnectionPassword 123456 hive.metastore.warehouse.dir /user/hive/warehouse hive.exec.scratchdir /user/hive/scratchdir hive.cli.print.header true hive.cli.print.current.db true
创建数据库Hive
mysql -uroot -p
create databases hive;
进入hive下的bin目录执行命令初始化元数据到mysql中
schematool -dbType mysql -initSchema
没有报错就可,报错的话检查hive-site.xml文件
配置环境变量
启动hive,输入hive 回车
hive
hive安装完成



