Building Bigtop on Ubuntu
Skip to end of metadata
Go to start of metadata

Outdated and deprecated. For new improved build procedure refer to How to build Bigtop

Prerequisite

This assumes you have a fresh Ubuntu system.

Install dependent softwares

1. Add new packages

Open a terminal window and set the view size to be 132x43 (if too small, the devscripts software installation will get stuck, see this link for details).

sudo apt-get update

sudo apt-get install -y cmake git-core git-svn subversion checkinstall build-essential dh-make debhelper ant ant-optional autoconf automake liblzo2-dev libzip-dev sharutils libfuse-dev reprepro libtool libssl-dev asciidoc xmlto ssh curl

sudo apt-get install -y devscripts

sudo apt-get build-dep pkg-config

Over 1 GB of download, plus installation. So it will take considerable time depending on your network bandwidth.

2. Install Sun JDK 6 or OpenJDK 7

For Sun JDK 6:

{warning:title=Warning}
The following URL to JDK 1.6 is no longer valid. Search for JDK 6 on oracle site for the latest, and you may need to manually download and install.{warning}
mkdir -p ~/Downloads
cd ~/Downloads
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.bin
chmod a+x jdk-6u31-linux-x64.bin
./jdk-6u31-linux-x64.bin # will prompt to confirm the license agreement
sudo mv jdk1.6.0_31 /usr/lib/jvm
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_31/bin/java" 2
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 2
sudo update-alternatives --config java # will prompt, and choose the highest possible number

For OpenJDK 7:

Warning

Icon

OpenJDK 6 fails to build Hadoop because of issue MAPREDUCE-4115 Need to use OpenJDK 7

sudo apt-get install openjdk-7-jdk
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7-openjdk-amd64/bin/java" 2
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7-openjdk-amd64/bin/javac" 2
sudo update-alternatives --config java # will prompt, and choose the highest possible number
cd /usr/lib/jvm
sudo rm default-java
sudo ln -s java-7-openjdk-amd64 default-java

3. Install Maven 3

cd ~/Downloads
wget http://apache.petsads.us/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
tar -xzvf apache-maven-3.0.5-bin.tar.gz

sudo mkdir /usr/local/maven-3
sudo mv apache-maven-3.0.5 /usr/local/maven-3/

4. Install Apache Forrest

cd ~/Downloads
wget http://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz
cd $HOME
tar -xzvf /home/ubuntu/Downloads/apache-forrest-0.8.tar.gz
# modify certain lines in the forrest-validate xml, otherwise build fails. either sed or nano are fine.
sed -i 's/property name="forrest.validate.sitemap" value="${forrest.validate}"/property name="forrest.validate.sitemap" value="false"/g' apache-forrest-0.8/main/targets/validate.xml
sed -i 's/property name="forrest.validate.stylesheets" value="${forrest.validate}"/property name="forrest.validate.stylesheets" value="false"/g' apache-forrest-0.8/main/targets/validate.xml
sed -i 's/property name="forrest.validate.stylesheets.failonerror" value="${forrest.validate.failonerror}"/property name="forrest.validate.stylesheets.failonerror" value="false"/g' apache-forrest-0.8/main/targets/validate.xml
sed -i 's/property name="forrest.validate.skins.stylesheets" value="${forrest.validate.skins}"/property name="forrest.validate.skins.stylesheets" value="false"/g' apache-forrest-0.8/main/targets/validate.xml

5. Install protobuf 2.4.0a or higher see http://svn.apache.org/repos/asf/hadoop/common/branches/MR-279/mapreduce/yarn/README

sudo apt-get install libprotobuf-java

Setup environment variables

Create /etc/profile.d/bigtop.sh to include the following:

export JAVA_HOME="/usr/lib/jvm/default-java"
export JAVA5_HOME="/usr/lib/jvm/default-java"
export JVM_ARGS="-Xmx1024m -XX:MaxPermSize=512m"
export MAVEN_HOME="/usr/local/maven-3/apache-maven-3.0.5"
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$MAVEN_HOME/bin"

Add to FORREST_HOME to ~/.bashrc:

export FORREST_HOME="$HOME/apache-forrest-0.8"

Update the line below to ~/.mavenrc to increase the PermGen allocation as the default 64MB is not enough for building bigtop components.

export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"

Update environment by logout and log back in.

Prepare for SSH

Create a ssh key using

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

Test using:

ps -ef | grep sshd # verify sshd is running
ssh localhost # accept the certification when prompted

Make sure the root has a password using:

sudo passwd root

Retrieve bigtop source, and build

Change directory to where you want to locate your bigtop source code tree. Retrieve the code for the first time:

git clone git://git.apache.org/bigtop.git # put files under bigtop directory
cd bigtop
git checkout HEAD
# you can also use a different branch, e.g. git checkout branch-0.6

If you have previously done the above steps, and just want to update to the latest code you can do:

cd bigtop
git pull

Build the source with:

./check-env.sh # make sure all the required environment variables are set
make realclean
make bigtop-utils-deb # build this project first
make hadoop-deb # to build just for hadoop first
make deb # build all the rest

Read more about details of make targets available in bigtop.mk file ( You can see this from tar.gz file of Bigtop project)

You can use "screen" program to enable parallel build once you are confident of your setup.

Install and test bigtop

With the previous steps, we are have the .deb files ready for testing. Before we install the debs using dpkg command, it is better to disable the auto-start of the service before we can do configuration. This can be achieved by:

cat > /usr/sbin/policy-rc.d << EOF
#!/bin/sh
exit 101
EOF

sudo mv policy-rc.d /usr/sbin/
sudo chmod +x /usr/sbin/policy-rc.d

Install the deb files built using:

cd ~/bigtop/output/bigtop-utils
sudo dpkg --install *.deb
cd ~/bigtop/output
sudo dpkg --install **/**.deb

To help Hadoop/Hbase to discover the Java installation, one can set the JAVA_HOME variable or keep your
java in a known list of directory (such as on Mac /Library/Java/Home or Linux /usr/lib/jvm/default-java) and let Hadoop/Hbase detect the location.

Warning

Icon

But it seems Hadoop still requires JAVA_HOME be set without ability to detect, and Hbase java checking misses several common java directory including /usr/lib/jvm/default-java.

sudo vi /etc/hadoop/conf/hadoop-env.sh

Replace the commented line setting JAVA_HOME with

export JAVA_HOME="/usr/lib/jvm/default-java"

Warning

Icon

For hbase, although the JAVA_HOME is set like above, it is not taking effect. Need more investigation.

Don't forget to remove the /usr/sbin/policy-rc.d file to restore the system default deb install behavior:

sudo rm /usr/sbin/policy-rc.d

Sanity Testing

One time setup

Format a new distributed-filesystem. The user MUST be hdfs.

sudo -u hdfs hadoop namenode -format

Starting and Stoping Services

Use

sudo /etc/init.d/hadoop-<xxx> start

Other actions supported are stop and restart.
/usr/lib/hadoop/bin/st

Unknown macro: {art,op}

-all.sh scripts are not supported and will be removed soon.

Minimal Testing using PI

cd /usr/lib/hadoop
bin/hadoop jar hadoop-examples.jar pi 10 10000
Labels