Accessing HBase running in VM with a client on host system - hadoop

I try to write some data to hbase with a client program
HBase # Hadoop runs in a preconfigured VM from Cloudera # ubuntu.
The Client runs on the system hosting the VM and running the client directly in the VM works.
So now I want to use the client outside the vm to access the servers on the vm
I'm using NAT.
To be able to access the servers like HBase Master, HUE..running on the vm I configured port forwarding in virtual box:
Thus I can reach the overview sites of the HBase Master, HUE..
To run the client against the servers on the vm I created
hbase-site.xml with content:
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>9997</value>
</property>
<property>
<name>hbase.master</name>
<value>localhost:9999</value>
</property>
</configuration>
So I expected that forwarding works:
The error messages in the log when running the client looks like:
11/09/07 17:48:00 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
11/09/07 17:48:00 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
11/09/07 17:48:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
11/09/07 17:48:01 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
11/09/07 17:48:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.SocketException: Address family not supported by protocol family: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:500)
at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1050)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1077)
11/09/07 17:48:03 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
11/09/07 17:48:04 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
11/09/07 17:48:04 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
11/09/07 17:48:04 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.SocketException: Address family not supported by protocol family: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:500)
at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1050)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1077)
11/09/07 17:48:05 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
A correct connection log (when running the client directly on the vm) looks like:
11/09/07 09:05:29 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
11/09/07 09:05:29 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181
11/09/07 09:05:29 INFO zookeeper.ClientCnxn: Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
11/09/07 09:05:29 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x132449d36df0006, negotiated timeout = 40000
So I only see now in the log line before the first problem that connection url isn't correct as the port is correctly forwarded but the IP is still localhost and not 10.0.2.15 as configured in the port forwarding settings:
Opening socket connection to server localhost/127.0.0.1:2181
Only hint I found is disabling IPV6 -> is disabled in host(win7) and vm(Ubuntu)
and checking the port -> they are correctly forwarded
Has anyone an idea?

Just to give an added value to users reading this, here is the solution:
Could not resolve the DNS name of cloudera-vm
To fix that I simply added to C:\Windows\System32\drivers\etc\hosts :
192.168.56.101 cloudera-vm
So whenever cloudera-vm is used it is resolved to the apropriate IP.
The VM is now running at Host-Only-Network Mode, and is assigned to 192.168.56.101 now.
So no port forwarding is necessary.
Just for comparison:
hbase-site.xml
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>cloudera-vm</value>
</property>
</configuration>
persistence.xml
<persistence
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="hbase-addressbook"
transaction-type="RESOURCE_LOCAL">
<properties>
<property name="datanucleus.ConnectionURL" value="hbase:cloudera-vm" />
<property name="datanucleus.ConnectionUserName" value="" />
<property name="datanucleus.ConnectionPassword" value="" />
<property name="datanucleus.autoCreateSchema" value="true" />
<property name="datanucleus.validateTables" value="false" />
<property name="datanucleus.Optimistic" value="false" />
<property name="datanucleus.validateConstraints" value="false" />
</properties>
</persistence-unit>
</persistence>
After that I got another error (connection refused although all connection strings were correct) thus I researched for days for the cause.
The solution was to disable IPV6 of Ubuntu running on the VM by appending the following to the file: /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
After reboot everything connects and works correctly :)

I think you can set the configuration clearly in the code ,like this
HbaseConfiguration conf = HbaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", "ubuntu1,ubuntu2");
...
maybe help you ..

have you tried a simple:
<property name="connectionURL" value="hbase:master.standalone.hostname:60000"/>

Related

Information Issues while connecting Hbase remotely

This is the output file of running the java program remotely.
> Opening socket connection to server, Will not attempt to authenticate using SASL error, I'm facing this error, when i'm connecting remotely only.
15/10/01 17:00:21 INFO zookeeper.ClientCnxn: Opening socket connection to server quickstart.cloudera/192.168.0.106:2181. Will not attempt to authenticate using SASL (unknown error)
15/10/01 17:00:21 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /192.168.0.105:63654, server: quickstart.cloudera/192.168.0.106:2181
15/10/01 17:00:21 INFO zookeeper.ClientCnxn: Session establishment complete on server quickstart.cloudera/192.168.0.106:2181, sessionid = 0x150220e67060034, negotiated timeout = 60000
15/10/01 17:00:21 WARN util.DynamicClassLoader: Failed to identify the fs of dir hdfs://quickstart.cloudera:8020/hbase/lib, ignored
java.io.IOException: No FileSystem for scheme: hdfs
This is the output file of running the java program locally.
15/10/01 13:22:36 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
15/10/01 13:22:36 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
15/10/01 13:22:36 INFO zookeeper.ClientCnxn: Socket connection established to quickstart.cloudera/127.0.0.1:2181, initiating session
15/10/01 13:22:36 INFO zookeeper.ClientCnxn: Session establishment complete on server quickstart.cloudera/127.0.0.1:2181, sessionid = 0x150220e67060028, negotiated timeout = 60000
15/10/01 13:22:36 WARN util.DynamicClassLoader: Failed to identify the fs of dir hdfs://quickstart.cloudera:8020/hbase/lib, ignored
java.io.IOException: No FileSystem for scheme: hdfs
My questions are:
Am I not able to create a new table in hbase remotely?
Is there any issue from output file related to my question?
Yes, you are able to create new tables and perform any other operation with
HBase remotely.
Looks like your error means that you don't add Hadoop or HBase libraries
properly to your project. As a result your program couldn't find classes of HDFS file system.
Do you add jars to your project directly or use Maven/Gradle? What dependencies your project have in addition to HBase?

Run Hbase example in eclipse on ubuntu

I'm newbie in Hbase and Hadoop.
I'm setup Hadoop (1.2.1) and hbase (0.94.27) in pseudo mode in Ubuntu.
I'm also use habse shell to create or insert data to hbase table successfully.
But when I try to write a simple program to insert data to table by using Java API in Eclipse
public class HbaseTest {
public static void main(String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
HBaseAdmin admin = new HBaseAdmin(conf);
try {
HTable table = new HTable(conf, "test-table");
Put put = new Put(Bytes.toBytes("test-key"));
put.add(Bytes.toBytes("cf"), Bytes.toBytes("q"), Bytes.toBytes("value"));
table.put(put);
} finally {
admin.close();
}
}
}
, I got this error following:
15/05/30 01:24:20 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection0x0
15/05/30 01:24:20 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/05/30 01:24:20 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
15/05/30 01:24:21 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
15/05/30 01:24:21 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
15/05/30 01:24:22 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/05/30 01:24:22 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
I tried to search similar error but not yet find solution so far.
Do anybody have experience with this problem? Please help me.
In addition, my hbase-site.xml like this
> <configuration> <property>
> <name>hbase.rootdir</name>
> <value>hdfs://localhost:54310/hbase</value>
> </property>
> <property>
> <name>hbase.zookeeper.property.dataDir</name>
> <value>/home/hduser/zookeeper</value>
> <description>Property from ZooKeeper's config zoo.cfg.
> The directory where the snapshot is stored.
> </description>
> </property> </configuration>
my /etc/hosts like this
> 127.0.0.1 localhost
> 127.0.0.1 testuser-VirtualBox
Thanks
Please look here for more references of your error in case you missed it. Happy coding :)

Zookeeper connecting to localhost

While running Pig Script which is inserting data into HBase i got following error.
2013-10-25 14:57:03,147 [main-SendThread(localhost:2181)] INFO
org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2013-10-25 14:57:03,147 [main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to localhost/127.0.0.1:2181, initiating session
2013-10-25 14:57:03,169 [main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x41ead7bb150092, negotiated timeout = 180000
Also when i see slave logs it says that unable to establish connection to master, But master says that connection is established successfully. Below are the logs of both:
Master Log :
zookeeper.ZooKeeper: Initiating client connection, connectString=slave:2181,hadoop-master:2181,ubuntu:2181 sessionTimeout=180000 watcher=hconnection
13/10/24 19:51:56 INFO zookeeper.ClientCnxn: Opening socket connection to server slave:2181. Will not attempt to authenticate using SASL (unknown error)
13/10/24 19:51:56 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 104744#hadoop-master
13/10/24 19:51:56 INFO zookeeper.ClientCnxn: Socket connection established to slave:2181, initiating session
13/10/24 19:51:56 INFO zookeeper.ClientCnxn: Session establishment complete on server slave:2181, sessionid = 0x141ead77c250002, negotiated timeout = 180000
Slave Log
2013-10-24 19:51:32,174 INFO org.apache.zookeeper.server.quorum.FastLeaderElection: New election. My id = 1, proposed zxid=0x80000002a
2013-10-24 19:51:32,180 WARN org.apache.zookeeper.server.quorum.QuorumCnxManager: Cannot open channel to 0 at election address hadoop-master:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
Below are my configurations:
hbase-env.sh
export HBASE_MANAGES_ZK=true
hbase-site.xml
<configuration>
<property>
<name>hbase.master</name>
<value>hadoop-master:60000</value>
<description>
The host and port that the HBase master runs at.
A value of 'local' runs the master and a regionserver in a single process.
</description>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop-master:54310/hbase</value>
<description>
The directory shared by RegionServers.
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>
The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed Zookeeper
true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
</description>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>
Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>hadoop-master,slave,ubuntu</value>
<description>
Comma separated list of servers in the ZooKeeper Quorum.
For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
By default this is set to localhost for local and pseudo-distributed modes
of operation. For a fully-distributed setup, this should be set to a full
list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
this is the list of servers which we will start/stop ZooKeeper on.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
<description>
Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
</configuration>
By entering command jps i get following output:
At Master:
104744 HMaster
91841 JobTracker
80184 TaskTracker
91475 DataNode
91222 NameNode
105062 HRegionServer
91747 SecondaryNameNode
104666 HQuorumPeer
At Slave:
11533 HQuorumPeer
2444 SecondaryNameNode
5970 TaskTracker
11756 HRegionServer
This is probably an issue with your HBase config not being on the classpath when running the Pig script. One thing you can try is to set the zookeeper connection settings in the Pig script to see if it connects to the correct instance. If it does, you can add the HBase config to the classpath before launching your script.

I am getting some issues while trying to install Hbase in a 5 node hadoop cluster,

I am getting some issues while trying to install Hbase in a 5 node hadoop cluster, the Hmaster and Hregionservers are not running and only Hquorumpeer deamon is running on all the 5 nodes. I am using the hadoop-0.20.2 and hbase-0.90.4 and hadoop is working fine.This is my hbase-site.xml :-
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2222</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>hbase.hregion.max.filesize</name>
<value>1048576</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>192.168.1.25,192.168.1.26,192.168.1.27,192.168.1.28,192.168.1.29</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/data/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.initLimit</name>
<value>100</value>
</property>
<property>
<name>hbase.zookeeper.property.syncLimit</name>
<value>100</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>1200000</value>
</property>
</configuration>
this is my /etc/hosts file :-
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.23 adm001
192.168.1.25 master.poc.net master hbase-master
192.168.1.28 dn2.poc.net dn2
192.168.1.27 dn1.poc.net dn1
192.168.1.26 dn3.poc.net dn3
192.168.1.29 dn4.poc.net dn4
I am getting the following error while running Hbase in my master logs
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:06,877 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn3.poc.net/192.168.1.26:2222
2012-07-17 12:41:06,878 WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:07,499 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn2.poc.net/192.168.1.28:2222
2012-07-17 12:41:07,500 WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:08,549 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn1.poc.net/192.168.1.27:2222
2012-07-17 12:41:08,550 INFO org.apache.zookeeper.ClientCnxn: Socket connection established to dn1.poc.net/192.168.1.27:2222, initiating session
2012-07-17 12:41:08,554 INFO org.apache.zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2012-07-17 12:41:08,654 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn4.poc.net/192.168.1.29:2222
2012-07-17 12:41:08,755 INFO org.apache.zookeeper.ZooKeeper: Session: 0x0 closed
2012-07-17 12:41:08,756 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1064)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:142)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:102)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1078)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:809)
at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:837)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.createAndFailSilent(ZKUtil.java:903)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:133)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:222)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1059)
I have copied the hadoop-core.jar and other neccesary jar files from hadoop lib folder.
open the port 2222 by executing the following command
iptables -A INPUT -p tcp --dport 2222 -j ACCEPT
This should solve your problem

hbase cannot connect to hadoop

I am running an hdfs instance in pseudo-distributed mode, and tried to make another hbase instance connected to it on the same server. Logs in hadoop are fine, but I constantly got the connection failure in hbase' log
==================================================================================
2012-05-01 10:49:07,212 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
2012-05-01 10:49:07,213 WARN org.apache.zookeeper.ClientCnxn: Session 0x13708dc552d0001 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-05-01 10:49:08,882 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
2012-05-01 10:49:08,882 WARN org.apache.zookeeper.ClientCnxn: Session 0x13708dc552d0001 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
==================================================================================
Configuration of core-site.xml#hadoop
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Configuration of hbase-site.xml#hbase
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
I also tried to replace localhost with the actual ip of the server, but got the same error.
First, you need to make sure your hbase master node is running, you can use jps to check.
If it is not running, you can run it by start-hbase.sh command or hbase master start.
And then check its status by other commands, like netstat -an | grep 9000
Second, if the previous method does not work, check your firewall configuration such as iptables and SELinux.
Use sudo iptables -L to check your iptables configuration. You can disable the iptables by sudo service iptables stop command under redhat based linux systems.
Use getenforce to check if SElinux is in enforcing mode.
Third, check the system configuration, for example, ssh etc.
You need to replace the core hadoop jar in the $HBASE_HOME/bin/lib/hadoop-{{version}}core.jar with the one in the $HADOOP_HOME/hadoop-{{version}}core.jar
I was running into the same problem when I tried to install hbase 0.92 from hbase 0.90-xxx which was working fine, i replaced the hbase-env.sh and hbase-site.xml from the old hbase to the new but forgot to copy the hadoop core jar.
I'm always suspicious when I see localhost in a config. Also when you use localhost, then it becomes very difficult (to impossible) to access any services from the psuedo distributed system from a host other than the one you are running on.
You did say you tried the IP address, but you might want to make sure its the IP address that the node really thinks its at.
Check the zookeeper logs from when it starts up and see what IP address it "thinks" its at. There should be a line like:
2012-01-31 09:32:46,083 - INFO [main:Environment#97] - Server environment:host.name=ip-10-8-127-58.ec2.internal
Then use the value of host.name as the value for all places in ALL Hadodop, HBase, Hive, Zookeeper, etc config files that need a hostname (assuming they are all on the same machine as you said you are in psuedo-distributed mode)
Also you did not show your hbase.zookeeper.quorum setting in hbase-site.xml. That is where hbase gets its knowledge of the zookeeper's address
<property>
<name>hbase.zookeeper.quorum</name>
<value>ip-10-8-127-58.ec2.internal</value>
</property>
I think Hbase cannot find the zookeeper quorum, you have to set the hbase.zookeeper.quorum property in hbase-site.xml. Also check if classpath is set properly or not, check this doc out http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/mapreduce/package-summary.html#classpath

Resources