- cdh-hadoop
- cdh-mr1
brew tap hammer/cdhI think you'll also need Command Line Tools for Xcode.
(Don't worry about the error linking cdh-mr1)
brew install cdh-hadoop
brew install cdh-mr1The cdh-hadoop formula uses inreplace to make the following changes, so you don't need to do them manually. These changes suppress some annoying warning messages and configure your cluster to run in pseudo-distributed mode.
etc/hadoop/hadoop-env.sh: Appendjava.security.krb5.realmandjava.security.krb5.kdctoHADOOP_OPTSetc/hadoop/core-site.xml: Sethadoop.tmp.dirandfs.default.nameetc/hadoop/hdfs-site.xml: Setdfs.replicationetc/hadoop/log4j.properties: Setlog4j.logger.org.apache.hadoop.util.NativeCodeLoaderlog level to "ERROR"
The cdh-mr1 formula uses inreplace to make the following changes, so you don't need to do them manually. These changes suppress some annoying warning messages and configure your cluster to run in pseudo-distributed mode.
etc/hadoop/hadoop-env.sh: Appendjava.security.krb5.realmandjava.security.krb5.kdctoHADOOP_OPTSetc/hadoop/core-site.xml: Sethadoop.tmp.dirandfs.default.nameetc/hadoop/mapred-site.xml: Setmapred.job.trackeretc/hadoop/log4j.properties: Setlog4j.logger.org.apache.hadoop.util.NativeCodeLoaderlog level to "ERROR"
systemsetup -f -setremotelogin on
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
for host_id in localhost 0.0.0.0; do
ssh-keyscan $host_id >> ~/.ssh/known_hosts
done`brew --cellar`/cdh-hadoop/4.2.1/bin/hdfs namenode -format
`brew --cellar`/cdh-hadoop/4.2.1/libexec/sbin/start-dfs.sh
jpsexport HADOOP_MAPRED_HOME=`brew --cellar`/cdh-mr1/4.2.1/libexec
`brew --cellar`/cdh-mr1/4.2.1/bin/start-mapred.sh
jps
`brew --cellar`/cdh-hadoop/4.2.1/bin/hadoop fs -mkdir input
`brew --cellar`/cdh-hadoop/4.2.1/bin/hadoop fs -put `brew --cellar`/cdh-mr1/4.2.1/libexec/conf/*.xml input
`brew --cellar`/cdh-mr1/4.2.1/bin/hadoop jar `brew --cellar`/cdh-mr1/4.2.1/libexec/hadoop-examples-2.0.0-mr1-cdh4.2.1.jar grep input output 'dfs[a-z.]+'
`brew --cellar`/cdh-hadoop/4.2.1/bin/hadoop fs -cat output/part-00000 | head
When you're done:
`brew --cellar`/cdh-mr1/4.2.1/bin/stop-mapred.sh
`brew --cellar`/cdh-hadoop/4.2.1/libexec/sbin/stop-dfs.sh
rm -rf ~/hadoop-store
unset HADOOP_HOME