[root@hadoop102 software]# ls -l
-rw-r--r--. 1 root root 92834839 2月 18 14:16 apache-hive-1.2.1-bin.tar.gz
[root@hadoop102 software]# tar -zxvf apache-hive-1.2.1-bin.tar.gz -C /opt/module/
[root@hadoop102 module]# mv apache-hive-1.2.1-bin/ hive
[root@hadoop102 conf]# pwd
/opt/module/hive/conf
[root@hadoop102 conf]# ls -l
总用量 188
-rw-rw-r--. 1 root root 1139 4月 30 2015 beeline-log4j.properties.template
-rw-rw-r--. 1 root root 168431 6月 19 2015 hive-default.xml.template
-rw-rw-r--. 1 root root 2378 4月 30 2015 hive-env.sh.template
-rw-rw-r--. 1 root root 2662 4月 30 2015 hive-exec-log4j.properties.template
-rw-rw-r--. 1 root root 3050 4月 30 2015 hive-log4j.properties.template
-rw-rw-r--. 1 root root 1593 4月 30 2015 ivysettings.xml
[root@hadoop102 conf]# cp hive-env.sh.template hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/opt/ha/hadoop-2.7.2
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/opt/module/hive/conf
[root@hadoop102 ~]# /opt/module/hive/bin/hive
[root@hadoop102 mysql-connector-java-5.1.27]# cp mysql-connector-java-5.1.27-bin.jar /opt/module/hive/lib/
[root@hadoop102 conf]# pwd
/opt/module/hive/conf
[root@hadoop102 conf]# touch hive-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://hadoop103:3306/metastore?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>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
<property>
<name>hive.cli.print.header</name>
<value>true</value>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
</property>
</configuration>
[root@hadoop102 ~]# /opt/module/hive/bin/hive
[root@hadoop102 ~]# cd /opt/module/hive/conf/
[root@hadoop102 conf]# cp hive-log4j.properties.template hive-log4j.properties
[root@hadoop102 conf]# vim hive-log4j.properties
hive.log.dir=/opt/module/hive/logs
因篇幅问题不能全部显示,请点此查看更多更全内容