赞
踩
https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-2.3.7/
sudo tar -xvf apache-hive-2.3.7-bin.tar.gz -C /usr/local
cd /usr/local
sudo mv apache-hive-2.3.7-bin hive
sudo chown -R hadoop hive
cd /usr/local/hive/conf/
vim hive-site.xml
配置内容如下:
<configuration> <property> <name>system:java.io.tmpdir</name> <value>/usr/local/hive/tmp</value> </property> <property> <name>system:user.name</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> </property> <!--jdbc:mysql://localhost:3306/hive 这里的hive数据库不能在mysql中存在--> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.1.101:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> </configuration>
cd /usr/local/hive/lib
mysql-connector-java-5.1.47.jar
cd /usr/local/hadoop/etc/hadoop/
vim core-site.xml
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
cd ~
vim .bashrc
export HIVE_HOME=/usr/local/hive
export PATH=${HIVE_HOME}/bin:$PATH
source .bashrc
hadoop的地址
cd /usr/local/hadoop/share/hadoop/common/lib/
hive 的地址
cd /usr/local/hive/lib/
拷贝命令
cp /usr/local/hive/lib/guava-14.0.1.jar /usr/local/hadoop/share/hadoop/common/lib/
rm -rf /usr/local/hadoop/share/hadoop/common/lib/guava-11.0.2.jar
在执行初始化的时候,启动mysql和hadoop
schematool -dbType mysql -initSchema
hive -e 'show databases'
在安装hive的节点上启动hive
bin/hive --service metastore
启动数据库命令
bin/hive
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。