2013年12月24日 星期二

[研究] Apache Hive 0.11 (bin) + Hadoop 1.2.1 (bin) 安裝 (CentOS 6.5 x64)

[研究] Apache Hive 0.11 (bin) + Hadoop 1.2.1 (bin) 安裝 (CentOS 6.5 x86_64)

2013-12-24

安裝環境:CentOS 6.5   64 bits

官方網站
http://hive.apache.org/

下載
http://archive.apache.org/dist/hive/stable/hive-0.11.0-bin.tar.gz
http://archive.apache.org/dist/hive/stable/hive-0.11.0.tar.gz

安裝參考
https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallationandConfiguration

基本需求
Java 1.6
Hadoop 0.20.x.

安裝

# 安裝 Hive
cd /usr/local
wget http://archive.apache.org/dist/hive/stable/hive-0.11.0-bin.tar.gz
tar xzvf hive-0.11.0-bin.tar.gz
export HIVE_HOME=/usr/local/hive-0.11.0-bin
export PATH=$HIVE_HOME/bin:$PATH

# 安裝 JAVA
[root@localhost local]# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm"  -O  jdk-7u45-linux-x64.rpm

[root@localhost local]# rpm -ivh jdk-7u45-linux-x64.rpm
[root@localhost local]# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_45/bin/java 100

[root@localhost local]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/java/jre1.7.0_45/bin/java

Enter to keep the current selection[+], or type selection number: 3

[root@localhost local]# export JAVA_HOME=/usr/java/jdk1.7.0_45

[root@localhost local]# java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
[root@localhost local]#

# 安裝 Hadoop 1.2.1 Binary
wget http://archive.apache.org/dist/hadoop/core/hadoop-1.2.1/hadoop-1.2.1-bin.tar.gz
tar zxvf hadoop-1.2.1-bin.tar.gz
export HADOOP_HOME=/usr/local/hadoop-1.2.1
export PATH=$HADOOP_HOME/bin:$PATH

# 測試 Hive (按下 Ctrl-C 可中斷)
[root@localhost local]# $HIVE_HOME/bin/hive

Logging initialized using configuration in jar:file:/usr/local/hive-0.11.0-bin/lib/hive-common-0.11.0.jar!/hive-log4j.properties
Hive history file=/tmp/root/hive_job_log_root_3248@localhost.localdomain_201312242013_79368995.txt
hive> [root@localhost local]#
[root@localhost local]#

******************************************************************************

PS : 如果安裝 Hadoop 0.20.0 Binary

wget http://archive.apache.org/dist/hadoop/core/hadoop-0.20.0/hadoop-0.20.0.tar.gz
tar zxvf hadoop-0.20.0.tar.gz
export HADOOP_HOME=/usr/local/hadoop-0.20.0
export PATH=$HADOOP_HOME/bin:$PATH

[root@localhost local]# $HIVE_HOME/bin/hive
Hive requires Hadoop 0.20.x (x >= 1).
'hadoop version' returned:
Hadoop 0.20.0 Subversion https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20 -r 763504 Compiled by ndaley on Thu Apr 9 05:18:40 UTC 2009
[root@localhost local]#

******************************************************************************

PS : 如果安裝 Hadoop 0.20.205.0 Binary

wget http://archive.apache.org/dist/hadoop/core/hadoop-0.20.205.0/hadoop-0.20.205.0-bin.tar.gz
tar zxvf hadoop-0.20.205.0-bin.tar.gz
export HADOOP_HOME=/usr/local/hadoop-0.20.205.0
export PATH=$HADOOP_HOME/bin:$PATH

[root@localhost local]# $HIVE_HOME/bin/hive

Logging initialized using configuration in jar:file:/usr/local/hive-0.11.0-bin/lib/hive-common-0.11.0.jar!/hive-log4j.properties
Hive history file=/tmp/root/hive_job_log_root_3499@localhost.localdomain_201312242034_1428011279.txt
Exception in thread "main" java.lang.NoSuchFieldError: ALLOW_UNQUOTED_CONTROL_CHARS
        at org.apache.hadoop.hive.ql.udf.generic.GenericUDTFJSONTuple.<clinit>(GenericUDTFJSONTuple.java:59)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:113)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerGenericUDTF(FunctionRegistry.java:526)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerGenericUDTF(FunctionRegistry.java:520)
        at org.apache.hadoop.hive.ql.exec.FunctionRegistry.<clinit>(FunctionRegistry.java:423)
        at org.apache.hadoop.hive.cli.CliDriver.getCommandCompletor(CliDriver.java:530)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:722)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
[root@localhost local]#

******************************************************************************
PS : 如果安裝 Hadoop 2.2.0 x64 Binary

hadoop-2.2.0-x86-x86_64.tar.gz 的來源請參考

[研究] Hadoop 2.2.0 編譯 (CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/11/hadoop-220-centos-64-x64.html

tar zxvf hadoop-2.2.0-x86-x86_64.tar.gz
export HADOOP_HOME=/usr/local/hadoop-2.2.0
export PATH=$HADOOP_HOME/bin:$PATH

[root@localhost local]# $HIVE_HOME/bin/hive
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
13/12/24 20:37:41 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
13/12/24 20:37:42 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@24928347:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval;  Ignoring.
13/12/24 20:37:42 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@24928347:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts;  Ignoring.

Logging initialized using configuration in jar:file:/usr/local/hive-0.11.0-bin/lib/hive-common-0.11.0.jar!/hive-log4j.properties
Hive history file=/tmp/root/hive_job_log_root_3608@localhost.localdomain_201312242037_705072764.txt
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hive-0.11.0-bin/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive> [root@localhost local]#

(完)


相關

[研究] Hadoop 2.2.0 編譯 (CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/11/hadoop-220-centos-64-x64.html

[研究] Hadoop 2.2.0 Single Cluster 安裝 (二)(CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/11/hadoop-220-single-cluster-centos-64-x64_7.html

[研究] Hadoop 2.2.0 Single Cluster 安裝 (一)(CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/11/hadoop-220-single-cluster-centos-64-x64.html

[研究] Hadoop 1.2.1 (rpm)安裝 (CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/10/hadoop-121-rpm-centos-64-x64.html

[研究] Hadoop 1.2.1 (bin)安裝 (CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/07/hadoop-112-centos-64-x64.html

[研究] Hadoop 1.2.1 安裝 (CentOS 6.4 x64)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=80035

[研究] 雲端軟體 Hadoop 1.0.0 安裝 (CentOS 6.2 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=21166

[研究] 雲端軟體 Hadoop 0.20.2 安裝 (CentOS 5.5 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=18513

[研究] 雲端軟體 Hadoop 0.20.2 安裝 (CentOS 5.4 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=17974


沒有留言:

張貼留言