Skip to content

Instantly share code, notes, and snippets.

@TomHortons
Created June 25, 2015 05:53
Show Gist options
  • Save TomHortons/00e1ded29b26979e366c to your computer and use it in GitHub Desktop.
Save TomHortons/00e1ded29b26979e366c to your computer and use it in GitHub Desktop.
$ brew update
$ brew install hadoop
$ cd /usr/local/Cellar/hadoop/2.7.0//libexec/etc/hadoop/
$hdfs namenode -format
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh localhost
$ exit
$ hstart
$ hstop
$ 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
export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true -Djava.security.krb5.realm= -Djava.security.krb5.kdc="
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
$ cp mapred-site.xml.template mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9010</value>
</property>
</configuration>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
alias hstart="/usr/local/Cellar/hadoop/2.7.0/sbin/start-dfs.sh;/usr/local/Cellar/hadoop/2.7.0/sbin/start-yarn.sh" alias hstop="/usr/local/Cellar/hadoop/2.7.0/sbin/stop-yarn.sh;/usr/local/Cellar/hadoop/2.7.0/sbin/stop-dfs.sh"
$ source ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment