赞
踩
期待您的关注
HIVE安装详细教程
目录
Hadoop集群 MySQL
- mysql -u root -p123456
-
- quit
-
- start-all.sh
-
- tar -zxvf apache-hive-3.1.2-bin.tar.gz
-
- mv apache-hive-3.1.2-bin hive-3.1.2
- vim /etc/profile
-
-
-
- export HIVE_HOME=/usr/local/soft/hive-3.1.2
- export PATH=$PATH:$HIVE_HOME/bin
-
-
-
- source /etc/profile
- cd /usr/local/soft/hive-3.1.2/conf
-
- mv hive-env.sh.template hive-env.sh
-
- vim hive-env.sh
-
- 添加
-
- HADOOP_HOME=/usr/local/soft/hadoop-2.7.6
- export HIVE_CONF_DIR=/usr/local/soft/hive-3.1.2/conf
-
-
- cd /usr/local/soft/hive-3.1.2
-
- mkdir log
-
-
- cd conf/
-
- mv hive-log4j2.properties.template hive-log4j2.properties
-
-
- vim hive-log4j2.properties
-
-
- 修改
-
- property.hive.log.dir = /usr/local/soft/hive-3.1.2/log
cp hive-default.xml.template hive-default.xml
/usr/local/soft/hive-3.1.2/lib
- vim /etc/my.cnf
-
- 添加
-
- [client]
-
- default-character-set = utf8mb4
-
- [mysqld]
-
- character-set-server = utf8mb4
-
- collation-server = utf8mb4_general_ci
-
- 重启MySQL
-
- systemctl restart mysqld
- schematool -dbType mysql -initSchema
-
- 进入HIVE
-
- hive
修改Hadoop的core-site.xml文件
stop-all.sh
- cd /usr/local/soft/hadoop-2.7.6/etc/hadoop
-
- vim core-site.xml
-
-
- 添加
-
- <property>
- <name>hadoop.proxyuser.root.hosts</name>
- <value>*</value>
- </property>
-
- <property>
- <name>hadoop.proxyuser.root.groups</name>
- <value>*</value>
- </property>
start-all.sh
- 启动hiveserver2
- hive --service hiveserver2
-
- 查看进程
- netstat -nplt | grep 10000
-
- HIVE连接JDBC
- beeline -u jdbc:hive2://master:10000 -n root
修改mysql元数据库hive 让其hive支持utf-8编码以支持中文
登录mysql: mysql -u root -p123456 切换到hive数据库: use hive; 1).修改字段注释字符集 alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8; 2).修改表注释字符集 alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8; 3).修改分区表参数,以支持分区键能够用中文表示 alter table PARTITION_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8; alter table PARTITION_KEYS modify column PKEY_COMMENT varchar(4000) character set utf8; 4).修改索引注解(可选) alter table INDEX_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8; 5).修改库注释字符集 alter table DBS modify column 'DESC' varchar(4000) character set utf8;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。