3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Hadoop(2.7.0) + Tez(0.5.3) + Hive(0.14.0) 擬似分散モードで動かす

Posted at

マニュアルを読み進めながらで動かすことができる。
ただ、躓いた箇所がいくつかあったため記載。

環境

  • OS : OS X Yosemite 10.10.2

前提

  • Javaがインストールされていること。

今回はJava8(update 40)を使用。

$ java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Hadoop 2.7.0

  • インストール先 : /usr/local/

  • 環境変数

.bashrc
# hadoop
export HADOOP_HOME=/usr/local/hadoop-2.7.0
export HADOOP_PATH=$HADOOP_HOME/bin
export PATH="$PATH:$HADOOP_PATH"
  • ページに載っているもの以外の例を試す
$ bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0.jar pi 10 100

こちらの方がmap数や精度を変更できるので分かりやすい。(input, outputの準備も必要ないし)

  • sbin/start-all.shは非推奨
$ sbin/start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh

警告文通り、代わりに start-dfs.sh, start-yarn.sh の2つを起動させるようにする。

Tez

  • インストール先 : /usr/local

  • pom.xmlを編集したあとにmvn clean packageを打つ

    • hadoopのバージョンを確認 -> 2.7.0へ
pom.xml
  <properties>
    <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
    <clover.license>${user.home}/clover.license</clover.license>
    <hadoop.version>2.7.0</hadoop.version>
    <jetty.version>7.6.10.v20130312</jetty.version>
  • デフォルトのtez-site.xmlが無いのでfindで探して最初に出てきたものをコピーして使用。
$ find . -name tez-site.xml
./tez-api/src/test/resources/tez-site.xml
./tez-api/target/test-classes/tez-site.xml
./tez-runtime-library/src/test/resources/tez-site.xml
./tez-runtime-library/target/test-classes/tez-site.xml
  • 環境変数
.bashrc
# tez
export TEZ_CONF_DIR=/usr/local/tez-0.5.3/conf
export TEZ_JARS=/usr/local/tez-0.5.3/jars
export HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${TEZ_CONF_DIR}:${TEZ_JARS}/*:${TEZ_JARS}/lib/*

conf, jarsは事前にmkdirで作成。

それぞれの中身。

$ ls conf/
tez-site.xml
$ ls jars/
lib                                      tez-mbeans-resource-calculator-0.5.3.jar
tez-api-0.5.3.jar                        tez-runtime-internals-0.5.3.jar
tez-common-0.5.3.jar                     tez-runtime-library-0.5.3.jar
tez-dag-0.5.3.jar                        tez-tests-0.5.3.jar
tez-examples-0.5.3.jar                   tez-yarn-timeline-history-0.5.3.jar
tez-mapreduce-0.5.3.jar

confの中身はtez-site.xml(前述のとおりコピーしてきたもの)。

jarsの中身はマニュアル内のコマンドtar -xvzf tez-dist/target/tez-x.y.z-minimal.tar.gz -C $TEZ_JARSの際に格納される。

  • MapReduceかTezで動いているかの確認

ここで見れる。http://localhost:8088/cluster

編集箇所。「yarn」「yarn-tez」で切り替えられる。

/usr/local/hadoop-2.7.0/etc/hadoop/mapred-site.xml
<property>
  <name>mapreduce.framework.name</name>
  <value>yarn-tez</value>
</property>

Hive

  • インストール先 : /usr/local

  • 環境変数

.bashrc
# hive
export HIVE_HOME=/usr/local/hive-0.14.0
export PATH="$PATH:${HIVE_HOME}/bin"

hiveは特に設定することなく、パスを通すだけで動いた。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?