11
10

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.

MacOSX 10.9 にHadoop2.2の開発環境(疑似分散モード)構築

Last updated at Posted at 2014-02-21

前提条件

  • JDK1.7系インストール済

下準備

$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ vim ~/.ssh/config
+ Host localhost
+  HostName 127.0.0.1
+  Port 22
+  IdentityFile ~/.ssh/localhost_rsa
  • Macのシステム設定->共有からリモート共有を有効化

インストール

$ brew install hadoop
$ cd /usr/local/opt/hadoop/libexec/etc/

設定

core-site.xml
<configuration>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>${任意のディレクトリ}</value>
        <description>A base for other temporary directories.</description>
    </property>
    <property>
        <name>fs.default.name</name>
        <value>hdfs://localhost:9000</value>
    </property>
</configuration>

${任意のディレクトリ}は相対パスで書くと「/usr/local/Cellar/hadoop/2.2.0/libexec」から始まる

hadoop-env.sh
export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"

※1系だと上記オプション追加で「Unable to load realm info from SCDynamicStore」のエラーが回避出来ていたが、2系では回避できませんでした・・・。要オプション精査

hdfs-site.xml
<configuration>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>

  <property>
    <name>dfs.namenode.name.dir</name>
    <value>${hadoop.tmp.dir}/dfs/name</value>
  </property>

  <property>
    <name>dfs.datanode.data.dir</name>
    <value>${hadoop.tmp.dir}/dfs/data</value>
  </property>
</configuration>
yarn-site.xml
<configuration>

<!-- Site specific YARN configuration properties -->
  <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
    <description>shuffle service that needs to be set for Map Reduce to run </description>
  </property>
</configuration>

起動

$ hdfs namenode -format
$ start-all.sh 

動作確認

$ hadoop fs -mkdir /test
$ hadoop dfs -ls /
$ hadoop fs -rmdir /test
$ hadoop dfs -ls /
$ hadoop jar /usr/local/opt/hadoop/libexec/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar pi 5 10

参考

1系からの変更
jobtracker&tasktracker=>yarnへ移行
※ドキュメントがあまり整備されてない・・orz

11
10
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
11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?