Archive

Posts Tagged ‘hbase’

Configuring HBase as standalone (using local file system)

October 27th, 2008 Arun Manivannan No comments

For use of HDFS and Hadoop, please see my other post.

Setting up HBase as standalone is comparatively simpler.  The only trouble you would face is the Version Mismatching exception between the server and client in which case you would have ideally used a different jar on classpath for the client program and a different version of the HBase server would be running on.

There is only one thing that you need to do to configure HBase as standalone.

a)  Let JAVA_HOME variable in your hbase-env.sh (bin directory) point to the right path.

You can then play with the hbase shell utility

(from the bin folder) > hbase shell

Type in “help” to get a list of options available.

You can also use the example program available in http://hadoop.apache.org/hbase/docs/r0.18.0/api/index.html to use Java API to talk with HBase.

For use of the example program, you will be need to create a table on HBase. Use hbase shell to execute the following DDL statement.

create ‘myTable’,’myColumnFamily’

Categories: hbase, standalone, tutorial Tags: ,

HBase Tutorial

October 26th, 2008 Arun Manivannan No comments

These are some excellent links to learn Hbase (or to say, unlearn RDBMS way of thinking)
http://jimbojw.com/wiki/index.php?title=Understanding_Hbase_and_BigTable
http://jimbojw.com/wiki/index.php?title=Understanding_HBase_column-family_performance_options

I use Ubuntu (saves me a lot of trouble setting up the ssh and stuff). For ubuntu users, here is your link
http://www.michael-noll.com/wiki/Running_Hadoop_On_Ubuntu_Linux_(Multi-Node_Cluster)

Categories: hadoop, hbase, tutorial Tags: ,

Hadoop and HBase – setting up as pseudo-distributed

October 26th, 2008 Arun Manivannan No comments

For the past many months i have been out of blogging due to personal reasons. By the Grace of God, things have just turned perfectly good for me.  So, i am back to experimenting with some really cool stuff.

These instructions are an excerpt from

http://www.michael-noll.com/wiki/Running_Hadoop_On_Ubuntu_Linux_(Multi-Node_Cluster)

and Hadoop, HBase API documentation.

1) Download Hadoop (hadoop-0.18.1)
2) Download HBase (hbase-0.18.0)
3) I just setup the environment as Pseudo-Distributed.

a) Open up the hadoop-env.sh file in the conf directory of hadoop. Change the JAVA_HOME directory to point to your own machine setup. Mine looks like this :

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07

b) Open up the hbase-env.sh file in the conf directory of hbase and set JAVA_HOME.

c) Edit hbase-site.xml and make your configuration tag look like this :

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost/hbase</value>
</property>
</configuration>

d) Make hadoop-site.xml to look like the following :

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost/</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

e) Issue the following command inside the bin directory of your hadoop
./start-all.sh

eg : arun@arun-laptop:~/softy/hadoop-0.18.1/bin$ ./start-all.sh

f) Issue the following command to start HBase

eg : arun@arun-laptop:~/softy/hbase-0.18.0/bin$ ./start-hbase.sh

You can play with the shell if you wanted to.

arun@arun-laptop:~/softy/hbase-0.18.0/bin$ ./hbase shell

There is an example on http://hadoop.apache.org/hbase/docs/r0.18.0/api/index.html which

i used to test my setup. The example would need us to create a table ‘myTable’ with a column family ‘myColumnFamily’

Execute the following command on the shell

create ‘myTable’,'myColumnFamily’

Here is what i got as output on execution of the example program :

Found row: myRow with value: timestamp=1225023942810, value=columnQualifier1 value!

Let me know if I could help you with any of the setup problems. I didnt copy the hadoop-site.xml to hbase conf. Later i learnt that it is useful only on “truly” distributed environment.

The above setup instructions were just derived from
a) http://hadoop.apache.org/core/docs/r0.18.1/api/index.html
and
b) http://hadoop.apache.org/hbase/docs/r0.18.0/api/index.html

Food for the bots : Here is the list of exceptions i got during the process of setting this up :

INFO  20:39:19 [org.apache.hadoop.hbase.client.HConnectionManager$TableServers (202):getMaster]:

Attempt 0 of 10 failed with <java.io.IOException: Call failed on local exception>.

Retrying after sleep of 5000

Exception in thread “main” org.apache.hadoop.hbase.MasterNotRunningException: localhost:60000

The above log just means that the hbase and hadoop are not started at all. Check the log for exceptions.

Remember, Hadoop must be started first followed by HBase.