Centos6.5 installation and deployment Hive

Premise: a virtual machine can access, hadoop cluster and build a successful start.

Note: the path of each line of code is executed.

First, install MySQL
1, line installation MySQL yum install mysql-server
Centos6.5 installation and deployment Hive
installation is complete
Centos6.5 installation and deployment Hive
2, start the MySQL service mysqld Start Service
Centos6.5 installation and deployment Hive
3, set the MySQL root user password
(1), there is no default password, so press Enter to go directly to MySQL.
Centos6.5 installation and deployment Hive
(2), enter the command to set the root password password for root @ localhost the SET = password ( 'root');
MySQL:
User: root
Password: root
(3), Exit (exit;) re-login (mysql -u root -p)
Centos6.5 installation and deployment Hive
4. create a hive account.
(1) Create the User hive account the Create 'hive' IDENTIFIED by 'hive';
Centos6.5 installation and deployment Hive
(2), the MySQL account all rights authorized hive All ON Grant . To 'hive' @ 'yb'identified by' hive ';
Centos6.5 installation and deployment Hive
(3) the above command to take effect flush privileges;
then use the MySQL database to hive account login -h Yb -u hive -p MySQL
Centos6.5 installation and deployment Hive
(4), to create a hive database create database hive;
Centos6.5 installation and deployment Hive
Second, the installation hive
1, upload extract the hive
Centos6.5 installation and deployment Hive
Note: Make sure the red box permissions for the hadoop! If root, the root user may enter a command to modify hadoop: chown -R hadoop: hadoop apache- hive-1.0.0-bin.tar.gz, then re-enter the user decompress hadoop
2, the apache-hive-1.0. 0-bin weight hive mv apache-hive-1.0.0- bin named hive

3、修改hive配置文件
由于hive-site.xml文件不存在,首先需要使用命令复制一份:cp hive-default.xml.template hive-site.xml
Centos6.5 installation and deployment Hive
(1),修改配置文件hive-site.xml
配置驱动连接名为com.mysql.jdbc.Driver
Centos6.5 installation and deployment Hive
注意:需要找到文件中的对应内容
修改MySQL的URL
Centos6.5 installation and deployment Hive
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.1.68:3306/hive</value>
</property>
修改数据库的用户名和密码
Centos6.5 installation and deployment Hive
Centos6.5 installation and deployment Hive
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
4、配置hive坏境变量 vi /etc/profile
Centos6.5 installation and deployment Hive
注意:切换到root用户下
使配置生效 source /etc/profile
5、下载mysql-connector-java-5.1.38.jar,并上传到hive的lib目录下
Centos6.5 installation and deployment Hive
创建hive相关目录
Centos6.5 installation and deployment Hive
6、修改hive-site.xml相关文件
Centos6.5 installation and deployment Hive
Centos6.5 installation and deployment Hive
Centos6.5 installation and deployment Hive
<property>
<name>hive.querylog.location</name>
<value>/home/hadoop/app/hive/iotmp</value>
<description>Location of Hive run time structured log file</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/home/hadoop/app/hive/iotmp</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/home/hadoop/app/hive/iotmp</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
7, script execution hive
Note: Before performing start hadoop cluster
Centos6.5 installation and deployment Hive
8, check whether the hive
Centos6.5 installation and deployment Hive
so far hive installation is complete! ! !

Guess you like

Origin blog.51cto.com/14572091/2443612