brew install hadoop
- etc/hadoop/mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
- etc/hadoop/core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
- etc/hadoop/hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
$ hdfs namenode -format # format file system
$ start-dfs.sh
$ start-yarn.sh
$ hdfs dfs -mkdir input
$ hdfs dfs -rm -r input
$ # transfer files to input for testing
$ hdfs dfs -put /usr/local/Cellar/hadoop/2.7.2/libexec/etc/hadoop/ input
$ hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount input output