hive安装
mysql
apache-hive-2.1.1-bin.tar.gz
mysql-connector-java-5.1.40.zip
Hadoop-master1 |
192.168.2.100 |
Mysql/hive |
|
|
|
在安装之初,root用户没有密码。为了安全起见,需要设置root密码。
mysqladmin –u root password 1234
create user “hive”@”localhost” identifiedby “1234”;
grant all on *.* to “hive”@”localhost” ;
create database hivemeta;
hdfs dfs –mkdir /tmp
hdfs dfs –mkdir /user
hdfs dfs –mkdir /user/hive
hdfs dfs –mkdir /user/hive/warehouse
hdfs dfs –chmod g+w /tmp
hdfs dfs –chmod g+w /user/hive/warehouse
mkdir ~/hive
将apache-hive-2.1.1-bin.tar.gz上传并解压
将mysql-connector-java-5.1.40.zip上传并解压
cd ~/hive/apache-hive-2.1.1-bin/conf
cp hive-env.sh.template hive-env.sh
cp hive-default.xml.template hive-site.xml
cp hive-log4j2.properties.templatehive-log4j2.properties
cp hive-exec-log4j2.properties.templatehive-exec-log4j2.properties
替换hive-site.xml文件中的 ${system:java.io.tmpdir} 和 ${system:user.name}
注意一项:在集群中的位置这个是在hdfs中设置的看3
将mysql-connector-java-5.1.39.jar 拷贝到~/hive/apache-hive-2.1.1-bin/lib
schematool –dbType mysql –initSchema
hive
在使用过程中遇到问题时需要修改配置文件,在附加中一一说明
安装Hive 过程中要注意
1,MySQL 是否正常运行
2. 创建好mysql 用户并分配好相应的访问权限以及数据库端口号等
3. mysql-connector-Java-5.1.26-bin.jar 是否放到hive/lib 目录下建议修改权限为777 (chmod 777 mysql-connector-java-5.1.26-bin.jar)
4. 修改conf/hive-site.xml 中的 “hive.metastore.schema.verification” 值为 false 即可解决 “Caused by:MetaException(message:Version information not found in metastore. )”
5. 调试 模式命令 hive -hiveconf hive.root.logger=DEBUG,console
Enforce metastore schema version consistency.
True: Verify that version information stored in metastore matches withone from Hive jars. Also disableautomatic schema migration attempt. Users are required to manully migrateschema after Hive upgrade which ensures proper metastore schema migration.(Default)
False: Warn if the version information stored in metastore doesn't matchwith one from in Hive jars.