前言:
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供永川網(wǎng)站建設(shè)、永川做網(wǎng)站、永川網(wǎng)站設(shè)計(jì)、永川網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、永川企業(yè)網(wǎng)站模板建站服務(wù),十年永川做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
# 下載地址http://archive.cloudera.com/cdh6/cdh/5/ 選擇hive-1.1.0-cdh6.7.0.tar.gz包,也可用我們上篇文章編譯來(lái)的包
[hadoop@hadoop000 ~]$ ll
total 32
drwxrwxr-x 4 hadoop hadoop 4096 Jun 1 21:27 app --軟件安裝路徑
drwx------ 3 hadoop hadoop 4096 Jun 1 21:46 data
drwxrwxr-x 2 hadoop hadoop 4096 May 31 19:41 lib
drwxrwxr-x 2 hadoop hadoop 4096 May 31 19:41 maven_repo
drwxrwxr-x 2 hadoop hadoop 4096 Jun 1 21:46 pids
drwxrwxr-x 2 hadoop hadoop 4096 May 31 19:42 shell
drwxrwxr-x 2 hadoop hadoop 4096 May 31 19:48 software --安裝包路徑
drwxrwxr-x 3 hadoop hadoop 4096 May 31 20:59 source --源碼包路徑
[hadoop@hadoop000 ~]$ cd software/
[hadoop@hadoop000 software]$ pwd
/home/hadoop/software
[hadoop@hadoop000 software]$ wget http://archive.cloudera.com/cdh6/cdh/5/hive-1.1.0-cdh6.7.0.tar.gz
[hadoop@hadoop000 software]$ tar -xzvf hive-1.1.0-cdh6.7.0.tar.gz -C /home/hadoop/app/
[hadoop@oradb3 ~]$ vi .bash_profile
# 添加下面內(nèi)容:
export HIVE_HOME=/home/hadoop/app/hive-1.1.0-cdh6.7.0
export PATH=$HIVE_HOME/bin:$PATH
[hadoop@oradb3 ~]$ source .bash_profile
# 或添加到全局環(huán)境變量/etc/profile也可以
[hadoop@hadoop000 conf]$ pwd
/home/hadoop/app/hive-1.1.0-cdh6.7.0/conf
[hadoop@hadoop000 conf]$ cp hive-env.sh.template hive-env.sh
[hadoop@hadoop000 conf]$ vi hive-env.sh
# 更改HADOOP_HOME
HADOOP_HOME=/home/hadoop/app/hadoop-2.6.0-cdh6.7.0
[hadoop@hadoop000 conf]$ vi 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://localhost:3306/ruozedata_basic03?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>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
</configuration>
# 需要自行下載 下載地址https://dev.mysql.com/downloads/connector/j/
[hadoop@oradb3 lib]$ pwd
/home/hadoop/app/hive-1.1.0-cdh6.7.0/lib
[hadoop@oradb3 lib]$ ll mysql-connector-java-5.1.13-bin.jar
-rw-r--r-- 1 hadoop hadoop 767492 Jun 1 22:01 mysql-connector-java-5.1.13-bin.jar
[hadoop@oradb3 ~]$ hive
which: no hbase in (/home/hadoop/app/hive-1.1.0-cdh6.7.0/bin:/home/hadoop/app/hadoop-2.6.0-cdh6.7.0/bin:/usr/java/jdk1.7/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin)
Logging initialized using configuration in jar:file:/home/hadoop/app/hive-1.1.0-cdh6.7.0/lib/hive-common-1.1.0-cdh6.7.0.jar!/hive-log4j.properties
hive> create database ruoze;
OK
Time taken: 1.35 seconds
hive> use ruoze;
OK
Time taken: 0.05 seconds
hive> create table test (id int);
OK
Time taken: 0.65 seconds
hive> show tables;
OK
test
Time taken: 0.239 seconds, Fetched: 1 row(s)
# 詳細(xì)操作可參考:https://blog.csdn.net/scgaliguodong123_/article/details/46868525
分享題目:Hive環(huán)境搭建及簡(jiǎn)單使用
分享網(wǎng)址:http://www.rwnh.cn/article30/ippsso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、Google、App開(kāi)發(fā)、全網(wǎng)營(yíng)銷推廣、網(wǎng)站維護(hù)、網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)