hadoop hive install (5)

reference : http://dblab.xmu.edu.cn/blog/install-hive/

     http://dblab.xmu.edu.cn/blog/hive-in-practice/

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local$ sudo tar -zvxf /home/hadoop/apache-hive-1.2.1-bin.tar.gz -C /usr/local/

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local$ sudo mv apache-hive-1.2.1-bin hive
hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local$ sudo chown -R hadoop:hadoop hive
hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local$ vim ~/.bashrc

# add for hive
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin

export HADOOP_HOME=/usr/local/hadoop

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local$ source  ~/.bashrc 

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hive/conf$ cp hive-default.xml.template hive-default.xml
hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hive/conf$ touch hive-site.xml
hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hive/conf$ vim hive-site.xml

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hive$ cat conf/hive-site.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</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.ConnectionUserName</name>
<value>hive</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
<description>password to use against metastore database</description>
</property>
</configuration>

->start  hdfs

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hadoop$ ./sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-namenode-iZuf68496ttdogcxs22w6sZ.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-hadoop-datanode-iZuf68496ttdogcxs22w6sZ.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-hadoop-secondarynamenode-iZuf68496ttdogcxs22w6sZ.out
starting yarn daemons
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-hadoop-resourcemanager-iZuf68496ttdogcxs22w6sZ.out
localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-hadoop-nodemanager-iZuf68496ttdogcxs22w6sZ.out
hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hadoop$ jps
5410 Jps
5223 NodeManager
4793 DataNode
4649 NameNode
4973 SecondaryNameNode
5118 ResourceManager

->start hive shell

hadoop@iZuf68496ttdogcxs22w6sZ:/usr/local/hive$ hive

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-1.2.1.jar!/hive-log4j.properties
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Jan 28 17:21:11 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
hive> create database if not exists hive;
OK
Time taken: 0.966 seconds

原文地址:https://www.cnblogs.com/lianghong881018/p/10331084.html