Hadoop installation Deployment 3------Install Hive

Source: Internet
Author: User

Install MySQL

MySQL is installed on the master node

1) Uninstall the MySQL-related installation package from the system and uninstall only the MySQL-beginning package

Rpm-qa|grep-i MySQL

-I action is case insensitive

You can see that there are two installation packages

mysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpm

mysql-client-5.6.19-1.linux_glibc2.5.x86_64.rpm

Remove the two services (remove the suffix)

Rpm-e mysql-client-5.6.19-1.linux_glibc2.5.x86_64

Rpm-e mysql-server-5.6.19-1.linux_glibc2.5.x86_64

To view the remaining directories:

Whereis MySQL

Then delete the MySQL directory:

Rm–rf/usr/lib64/mysql

Delete related files:

Rm–rf/usr/my.cnf

Rm-rf/root/.mysql_sercret

The most critical:

Rm-rf/var/lib/mysql

2) Install MySQL dependency

Yum Install vim Libaio net-tools

3) Install the mysql5.5.39 RPM package

rpm-ivh/opt/mysql-server-5.5.39-2.el6.x86_64.rpm

rpm-ivh/opt/mysql-client-5.5.39-2.el6.x86_64.rpm

4) Copy the configuration file

Cp/usr/share/mysql/my-medium.cnf/etc/my.cnf

5) Start the MySQL service

Service MySQL Start

6) Set to boot from boot

Chkconfig MySQL on

7) Set the root user login password

/usr/bin/mysqladmin-u root password ' root '

8) Log in to MySQL as the root user

Mysql-uroot–proot

Installing Hive

Hive is installed on the master node.

1) Create hive users, databases, etc. in MySQL

Insert into Mysql.user (Host,user,password) VALUES ("localhost", "Hive", Password ("Hive"));

Create DATABASE hive;

Grant all on hive.* to [email protected] '% ' identified by ' hive ';

Grant all on hive.* to [email protected] ' localhost ' identified by ' hive ';

Flush privileges;

2) Quit MySQL

Exit

3) Add Environment variables

4) Modify Hive-site.xml

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://localhost:3306/hive</value>

<DESCRIPTION>JDBC connect string for a JDBC metastore</description>

</property>

<property>

<name>javax.jdo.option.ConnectionDriverName</name>

<value>com.mysql.jdbc.Driver</value>

<description>driver class name for a JDBC metastore</description>

</property>

<property>

<name>javax.jdo.option.ConnectionPassword</name>

<value>hive</value>

<description>password to use against Metastore database</description>

</property>

<property>

<name>hive.hwi.listen.port</name>

<value>9999</value>

<description>this is the port the Hive Web Interface would listen on</description>

</property>

<property>

<name>datanucleus.autoCreateSchema</name>

<value>true</value>

<description>creates necessary schema on a startup if one doesn ' t exist. Set this to false after creating it once</description>

</property>

<property>

<name>datanucleus.fixedDatastore</name>

<value>false</value>

<description/>

</property>

<property>

<name>javax.jdo.option.ConnectionUserName</name>

<value>hive</value>

<description>username to use against Metastore database</description>

</property>

<property>

<name>hive.exec.local.scratchdir</name>

<value>/opt/apache-hive-1.2.1-bin/iotmp</value>

<description>local scratch space for Hive jobs</description>

</property>

<property>

<name>hive.downloaded.resources.dir</name>

<value>/opt/apache-hive-1.2.1-bin/iotmp</value>

<description>temporary Local directory for added resources in the remote file system.</description>

</property>

<property>

<name>hive.querylog.location</name>

<value>/opt/apache-hive-1.2.1-bin/iotmp</value>

<description>location of Hive run time structured log file</description>

</property>

5) Copy the Mysql-connector-java-5.1.6-bin.jar to the lib below the hive

mv/home/hdpsrc/desktop/mysql-connector-java-5.1.6-bin.jar/home/hdpsrc/hive/lib/

6) Copy the Jline-2.12.jar to the corresponding directory in Hadoop, replace the Jline-0.9.94.jar, or the boot will error

cp/home/hdpsrc/hive/lib/jline-2.12.jar/home/hdpsrc/hadoop-2.6.3/share/hadoop/yarn/lib/

mv/home/hdpsrc/hadoop-2.6.3/share/hadoop/yarn/lib/jline-0.9.94.jar/home/hdpsrc/hadoop-2.6.3/share/hadoop/yarn/ Lib/jline-0.9.94.jar.bak

7) Create Hive Temp Folder

Mkdir/home/hdpsrc/hive/iotmp

8) Start Test hive

After you start Hadoop, execute the hive command

Hive

Test input Show database;

hive> show databases;

Ok

Default

Time taken:0.907 seconds, fetched:1 row (s)

Hadoop installation Deployment 3------Install Hive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.