hive依賴hadoophtml
須要的軟件包:hive-0.13.1-cdh5.3.6.tar.gz 、hadoop-2.5.0-cdh5.3.6.tar.gzjava
一、hadoop的安裝步驟請訪問:mysql
http://www.cnblogs.com/xningge/articles/8433297.htmlsql
二、將hive軟件包上傳到Linux系統指定的目錄:/opt/softwares/cdhoop
三、解壓hive-0.13.1-cdh5.3.6.tar.gz到指定的目錄:/opt/modules/cdh/spa
tar -zxvf hive-0.13.1-cdh5.3.6.tar.gz -C /opt/modules/cdh/xml
四、重命名hive-env.sh (去掉.template)htm
HADOOP_HOME=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6
export HIVE_CONF_DIR=/opt/modules/cdh/hive-0.13.1-cdh5.3.6/confblog
五、重命名hive-site.xml (去掉.template,修改成site)hadoop
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://hadoop01.xningge.com:3306/cdhmetastore?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>xningge</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>???</value>
</property>
**注意:模板文件有一個bug,在hive-site.xml的2781行少了一個<property>開始標記
六、重命名hive-log4j.properties (去掉.template)
$ mkdir logs
** 修改hive-log4j.properties
hive.log.dir=/opt/modules/cdh/hive-0.13.1-cdh5.3.6/logs
七、拷貝jdbc driver
** 將驅動文件複製到lib/
$ cp /opt/software/mysql-connector-java-5.1.27-bin.jar lib/
八、切換到CDH Hadoop目錄,創建目錄,並修改權限
** /user/hive/warehouse爲Hive存放數據的目錄
$ bin/hdfs dfs -mkdir -p /user/hive/warehouse
$ bin/hdfs dfs -chmod g+w /user/hive/warehouse
$ bin/hdfs dfs -chmod g+w /tmp
九、啓動客戶端使用Hive
eg:把profile裏HIVE_HOME註解掉(若是有配置這個全局變量的話,則註釋)
$ bin/hive
hive> show databases;