标签:jar EDA driver ica note conf mod vax source
Hadoop版本:2.7.2
MySQL版本:5.7.3
下载安装包:
apache-hive-2.1.0-bin.tar.gz
解压重命名:
tar zxvf apache-hive-2.1.0-bin.tar.gz
mv apache-hive-2.1.0-bin hive
注意:
hive最好和hadoop在同一个用户下安装.
export HIVE_HOME=/home/wangkai/hive
export PATH=$HIVE_HOME/bin:$HIVE_HOME/conf:$PATH
执行source ~/.bashrc
cp hive-default.xml.template hive-site.xml
修改内容如下:
<property>
<name>system:java.io.tmpdir</name>
<value>/home/wangkai/hive/iotmp</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.163.101:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>${system:java.io.tmpdir}/${user.name}</value>
</property>
注:system:java.io.tmpdir对应的目录需要手工创建
mkdir -p /home/wangkai/hive/iotmp
chmod 777 /home/wangkai/hive/iotmp
cp hive-env.sh.template hive-env.sh
内容修改如下:
export HADOOP_HOME=/home/wangkai/hadoop
export HIVE_CONF_DIR=/home/wangkai/hive/conf
export HIVE_AUX_JARS_PATH=/home/wangkai/hive/lib
hadoop fs -mkdir -p /user/hive/warehouse
hadoop fs -mkdir -p /tmp/hive/
hadoop fs -chmod 777 /user/hive/warehouse
hadoop fs -chmod 777 /tmp/hive
grant all privileges on *.* to ‘root‘@‘centos7-1‘ identified by ‘root‘;
flush privileges;
将mysql-connector-java-5.1.30.jar拷贝至hive/lib中.
schematool -initSchema -dbType mysql
执行hive
#查看所有数据库
show databases;
#查看default下的表
show tables;
#退出客户端
exit;
标签:jar EDA driver ica note conf mod vax source
原文地址:https://www.cnblogs.com/guan-li/p/9916937.html