You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@whirr.apache.org by Karel Vervaeke <ka...@outerthought.org> on 2011/08/09 09:15:51 UTC

Running hbase shell

My test cluster has only one zookeeper instance. When running 'hbase
shell' on one of the instances (i.e. not via the proxy),
I get this error:
ERROR: org.apache.hadoop.hbase.ZooKeeperConnectionException: An error
is preventing HBase from connecting to ZooKeeper

I think this could be fixed in the configure_zookeeper script (as well
as the cdh variant):
https://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh?view=markup

Line 64-79 takes care of adding the servers to /etc/zookeeper/zoo.cfg.
However if there is only one zookeeper instance, nothing gets added.

In other words, the "if [[ $# -gt 1 ]]" should be removed. Does that seem right?
(I can do the whole Jira/Test/Patch thing, but wanted to be sure it's a bug)

-- 
Karel Vervaeke
http://outerthought.org/
Open Source Content Applications
Makers of Kauri, Daisy CMS and Lily

Re: Running hbase shell

Posted by Andrei Savu <sa...@gmail.com>.
> Tested using the included hbase-ec2-cdh recipe:

I've tested using the same configuration file and it looks like a
permissions / environment setup issue to me because HBase shell works
as root as expected.

> The zookeeper.cfg ends with:
> ---
> clientPort=2181
> server.0=localhost:2888:3888
> ---

This is indeed a configuration problem but as you've seen it only
generates a warning. We should track this down and fix it.

> When you it on your local machine (run hbase-proxy.sh, export
> HBASE_CONF_DIR=~/.whirr/hbase-cdh) you get another result:
>
> status
>
> ERROR: org.apache.hadoop.hbase.MasterNotRunningException: null
>
> (I don't know if it makes a difference, but I locally have cdh3u1
> packages, while the cloud instances have cdh3)

I guess it makes (not sure) because it seems like the cluster is
actually running as expected.

Cheers,

Andrei

Re: Running hbase shell

Posted by Karel Vervaeke <ka...@outerthought.org>.
I found what the problem is/was.
Tested using the included hbase-ec2-cdh recipe:

The result is the same with the hbase user (sudo su - hbase) or without it.
The difference lies in on which server you are.

On the server running hbase-regionserver, the zoo.cfg file looks like this:
I'm running the command as user 'hbase' (sudo su - hbase).

status
11/08/10 15:13:14 FATAL zookeeper.ZKConfig: The server in zoo.cfg
cannot be set to localhost in a fully-distributed setup because it
won't be reachable. See "Getting Started" for more information.
1 servers, 0 dead, 2.0000 average load

The zookeeper.cfg ends with:
---
clientPort=2181
server.0=localhost:2888:3888
---

On the server running zookeeper+hbase-master, you get this:

status
11/08/10 15:15:04 ERROR zookeeper.ZKConfig: no valid quorum servers
found in zoo.cfg

ERROR: org.apache.hadoop.hbase.ZooKeeperConnectionException: An error
is preventing HBase from connecting to ZooKeeper

The zoo.cfg file ends like this:
---
clientPort=2181
# The servers in the ensemble
---

When you it on your local machine (run hbase-proxy.sh, export
HBASE_CONF_DIR=~/.whirr/hbase-cdh) you get another result:

status

ERROR: org.apache.hadoop.hbase.MasterNotRunningException: null

(I don't know if it makes a difference, but I locally have cdh3u1
packages, while the cloud instances have cdh3)

Regards,
Karel

On Tue, Aug 9, 2011 at 7:15 PM, Andrei Savu <sa...@gmail.com> wrote:
> On Tue, Aug 9, 2011 at 12:15 AM, Karel Vervaeke <ka...@outerthought.org> wrote:
>> Line 64-79 takes care of adding the servers to /etc/zookeeper/zoo.cfg.
>> However if there is only one zookeeper instance, nothing gets added.
>
> That it's not a bug. If you are running a single ZooKeeper instance
> you shouldn't add a list of servers to the config file.
>
> BTW all the HBase integration tests use a single ZooKeeper instance.
>
> I guess you are seeing a different issue. What user are you using when
> starting the hbase shell? Maybe it's unable to read the configuration
> files.
>



-- 
Karel Vervaeke
http://outerthought.org/
Open Source Content Applications
Makers of Kauri, Daisy CMS and Lily

Re: Running hbase shell

Posted by Andrei Savu <sa...@gmail.com>.
On Tue, Aug 9, 2011 at 12:15 AM, Karel Vervaeke <ka...@outerthought.org> wrote:
> Line 64-79 takes care of adding the servers to /etc/zookeeper/zoo.cfg.
> However if there is only one zookeeper instance, nothing gets added.

That it's not a bug. If you are running a single ZooKeeper instance
you shouldn't add a list of servers to the config file.

BTW all the HBase integration tests use a single ZooKeeper instance.

I guess you are seeing a different issue. What user are you using when
starting the hbase shell? Maybe it's unable to read the configuration
files.