Info

OS X (Lion) に Hadoop 0.21.0 インストールメモ

$ cd dl

$ wget http://ftp.jaist.ac.jp/pub/apache//hadoop/core/hadoop-0.21.0/hadoop-0.21.0.tar.gz

$ tar zxvf hadoop-0.21.0.tar.gz 

$ sudo mv hadoop-0.21.0 /usr/local/

hadoopユーザ作成

$ sudo dscl . -create /Groups/_hadoop PrimaryGroupID 1000
$ sudo dscl . -append /Groups/_hadoop RecordName hadoop

$ sudo dscl . -create /Users/_hadoop UniqueID 1000
$ sudo dscl . -create /Users/_hadoop RealName "Hadoop Admin"
$ sudo dscl . -create /Users/_hadoop PrimaryGroupID 1000
$ sudo dscl . -create /Users/_hadoop NFSHomeDirectory /var/lib/hadoop
$ sudo dscl . -create /Users/_hadoop Password "*"
$ sudo dscl . -append /Users/_hadoop RecordName hadoop

ssh設定

$ sudo su - hadoop
$ ssh-keygen
$ cd .ssh
$ cat id_rsa.pub >> authorized_keys

Hadoop設定

$ sudo vi conf/hadoop-env.sh 
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

confファイル設定 /user/local/hadoop/conf/

core-site.xml 
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
    <name>hadoop.tmp.dir</name>
    <value>/var/lib/hadoop</value>
  </property>

  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
  </property>

</configuration>

hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>

</configuration>

mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
    <name>mapred.job.tracker</name>
    <value>localhost:9001</value>
  </property>

</configuration>

logsディレクトリ作成

$ sudo mkdir /usr/local/hadoop/logs
$ sudo chown hadoop:hadoop /usr/local/hadoop/logs

NameNodeのフォーマット

$ sudo su - hadoop
$ /usr/local/hadoop/bin/hadoop namenode -format

起動

$ sudo su - hadoop
$ /usr/local/hadoop/bin/start-all.sh

ssh拒否エラーが出た時は、コントロールパネルからリモートログインを許可

http://localhost:50070
アクセスしてみる。

Comments

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS