Installing Hadoop on OS X

Fix the “Unable to load realm info from SCDynamicStore” error on OS Lion when using Hadoop.

Using Homebrew to install Hadoop on Lion OS X 10.7, I ran into a snag.

Attempting to do:
$ hadoop namenode -format

Resulted in this error: Unable to load realm info from SCDynamicStore

The solution was in Brandon Werner’s blog on How to Set up Haddop on OS X Lion.

As he puts it, to fix this issue, simply add the following single line to your hadoop-env.sh file:

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

Other Tips

  • The use of $HADOOP_HOME is now deprecated.
  • Homebrew uses /usr/local/bin with symbolic links to its /usr/local/Celler, so Hadoop just works from the command line. No need to add it to your path.
  • The Hadoop config files reside in /usr/local/Cellar/hadoop/*/libexec/conf