标签:配置 serve class java mirrors nbsp mkdir img 2.x
注意:如下命令如果权限不够,请在命令前面加sudo;以下配置所有的cqb-Lenovo-B40请换成自己的主机名或localhost!!!
Ctrl+Alt+T
wget http://mirrors.hust.edu.cn/apache/hive/hive-2.3.0/apache-hive-2.3.0-bin.tar.gz
mkdir -p /data/service/
tar -zxvf apache-hive-2.3.0-bin.tar.gz -C /data/service/
cd /data/service/
mv apache-hive-2.3.0-bin/ hive
cd /data/service/hive/conf/
cp hive-default.xml.template hive.site.xml
sudo gedit /data/service/hive/conf/hive-site.xml
配置:
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
以下配置mysql配置二选一:
查看mysql版本:mysql -u root -p登录进去mysql即可看到版本号。如下图:Server version: 5.7.19 MySQL Community Server(GPL)
mysql5.5版本:
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
mysql5.7版本:
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<name>hive.metastore.schema.verification</name>
<value>false</value>
下面几个配置没有的复制到倒数第二行如下图:
<property>
<name>datanucleus.schema.autoCreateSchema</name>
<value>true</value>
</property>
<property>
<name>datanucleus.schema.autoCreateTables</name>
<value>true</value>
</property>
<property>
<name>datanucleus.schema.autoCreateColumns</name>
<value>true</value>
</property>
将里面所有的${system:java.io.tmpdir}替换成/tmp
将里面所有的${system:user.name}替换成root
hive.site.xml文件配置完毕。
进入lib目录:
cd /data/service/hive/lib/
查看jdbc架包是否存在:
ls -l mysql-connector-java-X.X.XX.tar.gz
如果没有,请到官网下载mysql的jdbc包:
sudo wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.44.tar.gz
等待下载完成,解压jdbc包:
sudo tar zxvf mysql-connector-java-5.1.44.tar.gz
因为解压到的是一个目录,我们只需要里面的mysql-connector-java-5.1.44-bin.jar就行:
进到已经解压的目录里面去:
cd mysql-connector-java-5.1.44/
剪切mysql-connector-java-5.1.44-bin.jar到 cd /data/service/hive/lib/目录下
sudo mv mysql-connector-java-5.1.44-bin.jar /data/service/hive/lib/
sudo vim /etc/profile.d/hive-en.sh
source /etc/profile.d/hive-en.sh
echo $HIVE-HOME
Ubuntu16.04 install apache-hive-2.X.X-bin.tar.gz
标签:配置 serve class java mirrors nbsp mkdir img 2.x
原文地址:http://www.cnblogs.com/HHgy/p/7655178.html