The first step: online installation package mysql-related
yum install mysql mysql-server mysql- devel
Step Two: Start mysql service of
/etc/init.d/mysqld Start
chkconfig mysqld ON
The third step: enter the mysql client end and then authorize
use mysql;
configuring remote connections
Grant All privileges ON . to 'root' @ '%' IDENTIFIED by '123456' with the Option Grant;
- refresh
flush privileges;
The fourth step set the root password mysql link
Update User SET password = password ( '123456') WHERE User = 'root';
- refresh
flush privileges;
Step Five modify hive-env.sh
add our hadoop environment variables:
cd /export/servers/hive-1.1.0-cdh5.14.0/conf
cp Hive-env.sh.template hive-env.sh
vim hive- env.sh
<1 (Modify the third line) = HADOOP_HOME is / Export / Servers / Hadoop-2.6.0-cdh5.14.0
Hive CAN BE Controlled by the Configuration Directory:
<2 (modified penultimate line) export HIVE_CONF_DIR = / export / servers / hive-1.1.0-cdh5.14.0 / conf
Step Six modify hive-site.xml
command:
cd /export/servers/hive-1.1.0-cdh5.14.0/conf
vim hive-site.xml
need to add configurations:
<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>123456</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>node03</value>
</property>
** seventh step of uploading mysql lib ** driver package to the mysql lib lib driver package uploaded to the directory cd /export/servers/hive-1.1.0-cdh5.14.0/lib the hive mysql-connector-java- 5.1.38.jar upload to this directory
The eighth step for sending to the other node a good profile
scp -r local path node name: correspondent node path
Step ninth configuration environment variable
command:
CD /etc/profile.d
CP hadoop.sh hive.sh
VI hive.sh
arranged
Export HIVE_HOME = / Export / Servers / Hive-1.1.0-cdh5.14.0
Export the PATH =
HIVE_HOME/bin
- Refresh
source / etc / profile
- copy to other nodes
scp -r local path node name: correspondent node path
- Refresh
source / etc / profile
tenth step run hive achieve different nodes share
cd /export/servers/hive-1.1.0-cdh5.14.0
bin/hive
See all database
hive (default)> show databases;
Creating a database
hive (default)> create database myhive ;
- the same as other nodes to perform, to see if the database reaches sharing. You can see myhive way to prove hiveyum source configured successfully