This article installs Hive2.1.1 in remote mode to place hive metadata in the MySQL database.
1 Installing the MySQL database
sudo apt-get install mysql-server
1
1
Restarting the MySQL service makes the configuration file effective
sudo service mysql restart
1
1
Create a hive dedicated account
CREATE USER ' hive ' @ '% ' identified by ' 123456 ';
1
1
Grant all permissions to the hive account
Grant all privileges on * * to ' hive ' @ '% ' identified by ' 123456 ' with GRANT option;
1
1
Refresh the System permissions table for the configuration to take effect
Flush privileges;
1
1
2 Unpacking and Installing hive
Cd/usr/local
sudo tar-xvzf apache-hive-2.1.1-bin.tar.gz
sudo mv apache-hive-2.1.1-bin/hive-2.1.1
1
2
3
1)
2
3
Configuring System Environment Variables
sudo gedit. BASHRC
export hive_home=/usr/local/hive-2.1.1
exportpath= $HIVE _home/bin: $HIVE _home/lib: $PATH
1
2
3
1
2
3
Make environment variable configuration effective
source. BASHRC
1
1
3 Configuring Hive
3.1 Modify conf/hive-env.sh File
cd/usr/local/hive-2.1.1/conf/
sudo cp hive-env.sh.template hive-env.sh
sudo chown hadoop:hadoop hive-env.sh
sudo vi hive-env.sh
hadoop_home=/usr/local/hadoop-2.7.3
export hive_conf_dir=/usr/local/hive-2.1.1/conf
export HIVE_AUX_JARS _path=/usr/local/hive-2.1.1/lib
1
2
3
4
5
6
7
1
2
3
4
5
6
7
3.2 Modify Log Properties file configuration Log Store directory
Modify Hive-log4j2.properties
sudo cp hive-log4j2.properties.template hive-log4j2.properties
sudo chown hadoop:hadoop hive-log4j2.properties
sudo vi hive-log4j2.properties
property.hive.log.dir =/usr/local/hive-2.1.1/logs
1
2
3
4
1
2)
3
4
Modify Llap-cli-log4j2.properties
Property.hive.log.dir =/usr/local/hive-2.1.1/logs
property.hive.log.file = llap-cli.log
1
2
1
2
3.3 Modify the Hive-site.xml configuration file, mainly modify the following configuration items
<property>
<name>hive.exec.local.scratchdir</name>