hive-0.13安裝

thamsyangsw發表於2014-07-17


hadoop2.4.1完全分散式安裝             hadoop2.4.1完全分散式安裝  :http://blog.itpub.net/26613085/viewspace-1219710/
[hadoop@master ~]$ id

uid=500(hadoop) gid=500(hadoop)
groups=500(hadoop)

[hadoop@master ~]$ pwd
/home/hadoop
[hadoop@master ~]$ ll
total 269008
-rwxrwxrwx 
1 hadoop hadoop  54246778 Jul 17 14:01
apache-hive-0.13.1-bin.tar.gz

drwxrwxr-x 4 hadoop hadoop      4096 Jul 15 22:42 dfs
drwxr-xr-x 10 hadoop hadoop      4096 Jul 15 23:30 hadoop-2.4.1
-rwxrwxrwx 1 root   root   138656756 Jul 15 17:12 hadoop-2.4.1.tar.gz
drwxrwxr-x 8 hadoop hadoop      4096 Jul 17 00:27 hbase-0.98.2-hadoop2
-rwxrwxrwx 1 hadoop hadoop  82246622 Jul 16 23:22 hbase-0.98.2-hadoop2-bin.tar.gz
drwxrwxr-x 3 hadoop hadoop      4096 Jul 15 23:30 tmp
drwxrwxr-x 3 hadoop hadoop      4096 Jul 17 00:27 zookeeper

[hadoop@master ~]$ tar
-zxvf apache-hive-0.13.1-bin.tar.gz

[hadoop@master ~]$ ll

total 269008
drwxrwxr-x  8 hadoop hadoop      4096 Jul 17 14:02 apache-hive-0.13.1-bin
-rwxrwxrwx 1 hadoop hadoop  54246778 Jul 17 14:01 apache-hive-0.13.1-bin.tar.gz
drwxrwxr-x 4 hadoop hadoop      4096 Jul 15 22:42 dfs
drwxr-xr-x 10 hadoop hadoop      4096 Jul 15 23:30 hadoop-2.4.1
-rwxrwxrwx 1 root   root   138656756 Jul 15 17:12 hadoop-2.4.1.tar.gz
drwxrwxr-x 8 hadoop hadoop      4096 Jul 17 00:27 hbase-0.98.2-hadoop2
-rwxrwxrwx 1 hadoop hadoop  82246622 Jul 16 23:22 hbase-0.98.2-hadoop2-bin.tar.gz
drwxrwxr-x 3 hadoop hadoop      4096 Jul 15 23:30 tmp
drwxrwxr-x 3 hadoop hadoop      4096 Jul 17 00:27 zookeeper
[hadoop@master ~]$ cd
apache-hive-0.13.1-bin/conf

[hadoop@master conf]$ vi hive-site.xml

 
    fs.default.name
    hdfs://master:8020
 
     
    mapred.job.tracker
    master:8032

   
   
javax.jdo.option.ConnectionURL
   
jdbc:mysql://slave-5:3306/hivedb
 
 
   
javax.jdo.option.ConnectionDriverName
   
com.mysql.jdbc.Driver

 
   
javax.jdo.option.ConnectionUserName
   
hive
 

   
javax.jdo.option.ConnectionPassword
   
mysql
 

[root@master hadoop]# vi
/etc/profile

export HIVE_HOME=/home/hadoop/apache-hive-0.13.1-bin
export PATH=$HIVE_HOME/bin:$PATH
[root@master hadoop]#source /etc/profile

注意:要將mysql驅動程式複製到/home/hadoop/apache-hive-0.13.1-bin/lib目錄下
[root@master hadoop]# su – hadoop

[hadoop@master ~]$ hive
Logging initialized using configuration in
jar:file:/home/hadoop/apache-hive-0.13.1-bin/lib/hive-common-0.13.1.jar!/hive-log4j.properties

hive> create table
tt(id int,name string);
hive>
select * from tt;

OK Time taken: 1.054 seconds
OK Time taken: 0.693 seconds
hive> select * from tt;
OKTime taken:
1.054 seconds

檢視下hadoop的檔案結構,可以發現有了一些變化
[hadoop@master conf]$ 
hadoop fs -ls /user/hive/warehouse

14/07/17 16:46:05 WARN
util.NativeCodeLoader: Unable to load native-hadoop library for your
platform... using builtin-java classes where applicable

Found 1 items
drwxr-xr-x   - hadoop supergroup          0 2014-07-17 16:44 /user/hive/warehouse/tt



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26613085/viewspace-1221351/,如需轉載,請註明出處,否則將追究法律責任。

相關文章