Wednesday, October 17, 2012

Hadoop: $HADOOP_HOME is deprecated

If you get the following warning message when you start Hadoop

$HADOOP_HOME is deprecated

add the following line to the end of /conf/hadoop-env.sh

export HADOOP_HOME_WARN_SUPPRESS="TRUE"

Tuesday, October 16, 2012

Installing Cassandra on Ubuntu 12.04.1 Linux

1. Install the new updates using following commands:

sudo apt-get update
sudo apt-get upgrade

2. Open /etc/apt/sources.list using the following command:

sudo gedit /etc/apt/sources.list

3. Add the following lines to /etc/apt/sources.list file

deb http://www.apache.org/dist/cassandra/debian 11x main
deb-src http://www.apache.org/dist/cassandra/debian 11x main

4. Run the update again using following command:

sudo apt-get update

5. You will get an error similar to this. This means you need to add the PUBLIC_KEY:

W: GPG error: http://www.apache.org unstable Release: The following signatures couldn't be verified 
because the public key is not available: NO_PUBKEY 4BD736A82B5C1B00

6. Register and add a PUBLIC_KEY key and update again:

gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 4BD736A82B5C1B00
sudo apt-key add ~/.gnupg/pubring.gpg
sudo apt-get update

Note: Replace the key value ‘4BD736A82B5C1B00’ with the key value you received in your error message.

7. Install Cassandra using the following command:

sudo apt-get install cassandra

8. Start Cassandra using the following command:

sudo cassandra -f

Error: Received the following error instead and Cassandra didn't start successfully.

xss = -ea -javaagent:/usr/share/cassandra//lib/jamm-0.2.5.
jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 
-Xms498M -Xmx498M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k

Troubleshooting:

1. Check to see if you have the correct Java installed on your system using the following command:

java -version

java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

2. If you have the OpenJDK/JRE installed instead then completely remove it and install Oracle Java instead by following the instruction from the link below:

How to Install Oracle Java on Ubuntu Linux

9. Try to restart Cassandra again:

sudo cassandra -f

If Cassandra started successfully you should see the messages as below:

...
...
...
INFO 17:40:17,672 Listening for thrift clients...