1.derby版hive
1. Extract Hive
2. directly into the bin directory to start
cd ../servers/
cd hive-1.1.0-cdh5.14.0/
bin/hive
hive> create database mytest;
2.Mysql version hive
1. Install mysql-related packages
yum -y install mysql mysql mysql-devel-Server
2. Start mysql service
service mysqld start
chkconfig mysqld on
3. To enter the mysql client end and then authorization
mysql -u用户名 -p密码
use mysql
Configuring remote connection
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
flush privileges;
5. Set the root password of user connections mysql
update user set password=password('密码') where user='root';
flush privileges;
6. decompression Hive
7. The entered directory conf
1. cp hive-env.sh.template hive-env.sh
2. vim hive-env.sh
3.vim hive-site.sh
添加如下代码:(节点自行更换成hive所在节点)
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://node01: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>hadoop</value>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
</property>
<property>
<name>hive.cli.print.header</name>
<value>true</value>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>node01</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://node01:9083</value>
</property>
</configuration>
8. The driver package mysql-connector-java-5.1.38.jar the lib directory
9. Configuration Environment Variables HIVE
vim /etc/profile.d/hive.sh
export HIVE_HOME=/export/servers/hive-1.1.0-cdh5.14.0
export PATH=$PATH:$HIVE_HOME/bin
source /etc/profile
10. Hive and Hive distribution environment variables
scp -r hive-1.1.0-cdh5.14.0 node02:`pwd`
scp -r hive-1.1.0-cdh5.14.0 node03:`pwd`
scp hive.sh node02:`pwd`
scp hive.sh node03:`pwd`
source /etc/profile
11. Start the cluster! ! !
start-all.sh
12. Start HIve! ! !
hive
View all databases
show databases;
Creating a database
create database myhive;
13.Hive successful installation! ! !