I am trying to connect to HBase standalone single cluster installed on my Ubuntu machine from Java Program.
I followed the steps given in this blog.
https://autofei.wordpress.com/2012/04/02/java-example-code-using-hbase-data-model-operations/
I am able to connect to HBase in EMR cluster when I run this code on AWS EC2 but not able to do it on my local. My hadoop is running and I am able to open hbase shell and scan 'storetable' is showing me some rows without any exception. It seems that the program is going in an infinite loop at line -
table = new HTable(HBaseConfig, "storetable");
because the message "HBase table created..." is never printed. There is no exception caught by the catch block.
Please help me out.
I appreciate your help.
Code:
public void connectHBase()
{
System.out.println("Trying to establish HBase connection...");
HBaseConfig = HBaseConfiguration.create();
HBaseConfig.set("hbase.zookeeper.quorum", "localhost");
HBaseConfig.set("hbase.zookeeper.property.clientPort", "2181");
System.out.println("HBase Connection succeded...");
try
{
System.out.println("Creating HBase table...");
table = new HTable(HBaseConfig, "storetable");
System.out.println("HBase table created...");
}
catch(Exception e)
{
System.out.println("Some exception occured...");
e.printStackTrace();
}
}
Console Output:
Trying to establish HBase connection...
HBase Connection succeded...
Creating HBase table...
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:host.name=localhost
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_76
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-7-oracle/jre
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/home/sankalp/workspace/AWSHadoopProject/bin:/home/sankalp/aws-java-sdk/1.9.27/lib/aws-java-sdk-1.9.27.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/javax-mail-1.4.6/javax.mail-api-1.4.6.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/joda-time-2.2/joda-time-2.2.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/jackson-annotations-2.3.0/jackson-annotations-2.3.0.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/freemarker-2.3.18/freemarker-2.3.18.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/httpcomponents-client-4.3/httpcore-4.3.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/httpcomponents-client-4.3/httpclient-4.3.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/jackson-core-2.3.2/jackson-core-2.3.2.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/commons-logging-1.1.3/commons-logging-1.1.3.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/spring-3.0/spring-context-3.0.7.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/spring-3.0/spring-beans-3.0.7.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/spring-3.0/spring-core-3.0.7.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/jackson-databind-2.3.2/jackson-databind-2.3.2.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/aspectj-1.6/aspectjweaver.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/aspectj-1.6/aspectjrt.jar:/home/sankalp/aws-java-sdk/1.9.27/third-party/commons-codec-1.6/commons-codec-1.6.jar:/home/sankalp/workspace/AWSHadoopProject/undertow-examples-1.2.0.Beta9.jar:/home/sankalp/workspace/AWSHadoopProject/commons-configuration-1.8.jar:/home/sankalp/workspace/AWSHadoopProject/commons-lang-2.6.jar:/home/sankalp/workspace/AWSHadoopProject/commons-logging-1.1.1.jar:/home/sankalp/workspace/AWSHadoopProject/hadoop-core-1.0.0.jar:/home/sankalp/workspace/AWSHadoopProject/hbase-0.92.1.jar:/home/sankalp/workspace/AWSHadoopProject/log4j-1.2.16.jar:/home/sankalp/workspace/AWSHadoopProject/slf4j-api-1.5.8.jar:/home/sankalp/workspace/AWSHadoopProject/slf4j-log4j12-1.5.8.jar:/home/sankalp/workspace/AWSHadoopProject/zookeeper-3.4.3.jar:/home/sankalp/workspace/AWSHadoopProject/json-simple-1.1.1.jar
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:os.version=3.16.0-33-generic
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:user.name=sankalp
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/sankalp
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/sankalp/workspace/AWSHadoopProject
15/03/29 16:53:37 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
15/03/29 16:53:37 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
15/03/29 16:53:37 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/03/29 16:53:37 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 9146#skynet
15/03/29 16:53:37 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
15/03/29 16:53:37 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14c6746b9f4000d, negotiated timeout = 40000
check your jar versions, use the same version of jars as in HBase you are trying to connect, also check your hosts file for loopback address.
I have faced this issue where create table was not working from java. In my case i haven't included hbasee-site into my class path.
You can refere below link.
Not able to create hbase using java
Related
I followed this tutorial and I get stuck when I tried to inject urls to nutch from hadoop. I configured nutch files like this tutorial by copying hadoop conf files to nutch conf directory. When I tried to run ant runtime with configured files according to the first tutorial, it did not work.
ubuntu#ip-172-31-35-238:~/apache-nutch-2.2.1/runtime/deploy$ bin/nutch inject urls
Warning: $HADOOP_HOME is deprecated.
15/07/27 12:01:07 INFO crawl.InjectorJob: InjectorJob: starting at 2015-07-27 12:01:07
15/07/27 12:01:07 INFO crawl.InjectorJob: InjectorJob: Injecting urlDir: urls
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.2-1031432, built on 11/05/2010 05:32 GMT
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:host.name=master
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_45
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-6-oracle/jre
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/home/ubuntu/hadoop-1.2.1/libexec/../conf:/usr/lib/jvm/java-6-oracle/lib/tools.jar:/home/ubuntu/hadoop-1.2.1/libexec/..:/home/ubuntu/hadoop-1.2.1/libexec/../hadoop-core-1.2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/asm-3.2.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/aspectjrt-1.6.11.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/aspectjtools-1.6.11.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-beanutils-1.7.0.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-beanutils-core-1.8.0.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-cli-1.2.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-codec-1.4.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-collections-3.2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-configuration-1.6.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-daemon-1.0.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-digester-1.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-el-1.0.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-httpclient-3.0.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-io-2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-lang-2.4.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-logging-1.1.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-logging-api-1.0.4.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-math-2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/commons-net-3.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/core-3.1.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/hadoop-capacity-scheduler-1.2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/hadoop-fairscheduler-1.2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/hadoop-thriftfs-1.2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/hsqldb-1.8.0.10.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jackson-core-asl-1.8.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jackson-mapper-asl-1.8.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jasper-compiler-5.5.12.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jasper-runtime-5.5.12.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jdeb-0.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jersey-core-1.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jersey-json-1.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jersey-server-1.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jets3t-0.6.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jetty-6.1.26.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jetty-util-6.1.26.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jsch-0.1.42.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/junit-4.5.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/kfs-0.2.2.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/log4j-1.2.15.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/mockito-all-1.8.5.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/oro-2.0.8.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/servlet-api-2.5-20081211.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/slf4j-api-1.4.3.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/slf4j-log4j12-1.4.3.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/xmlenc-0.52.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-2.1.jar:/home/ubuntu/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-api-2.1.jar
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/home/ubuntu/hadoop-1.2.1/libexec/../lib/native/Linux-amd64-64
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:os.version=3.2.0-75-virtual
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:user.name=ubuntu
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/ubuntu
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/ubuntu/apache-nutch-2.2.1/runtime/deploy
15/07/27 12:01:10 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
15/07/27 12:01:10 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
15/07/27 12:01:10 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
15/07/27 12:01:10 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14ecf53dd5f0007, negotiated timeout = 180000
Can somebody help me?
for connect to hbase i write this code:
Class.forName("com.salesforce.phoenix.jdbc.PhoenixDriver");
conn = DriverManager.getConnection("jdbc:phoenix:localhost:2181");
but after running give me this errors:
13/08/22 09:14:14 INFO zookeeper.ZooKeeper:
Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:host.name=ubuntu
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_25
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:
java.vendor=Oracle Corporation
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:
java.home=/usr/local/jdk1.7.0_25/jre
13/08/22 09:14:14 INFO zookeeper.ZooKeeper:
Client environment:java.class.path=/home/ubuntu/Phonix/phoenix-2.0.0-client.jar:
/home/ubuntu/Downloads/hbql-0.90.0.1/hbql-0.90.0.1-src.jar:/home/ubuntu/Downloads/
hbql-0.90.0.1/hbql-0.90.0.1.jar:/home/ubuntu/Downloads/protobuf-java-2.4.1.jar:
/home/ubuntu/NetBeansProjects/hbase-phoenix/build/classes
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:java.library.path=
/usr/local/jdk1.7.0_25/jre/lib/amd64:/usr/local/jdk1.7.0_25/jre/lib/i386:
/usr/java/packages/lib/i386:/lib:/usr/lib
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:os.version=
3.2.0-23-generic-pae
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:user.name=ubuntu
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/ubuntu
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Client environment:user.dir=
/home/ubuntu/NetBeansProjects/hbase-phoenix
13/08/22 09:14:14 INFO zookeeper.ZooKeeper: Initiating client connection,
connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/08/22 09:14:14 INFO zookeeper.RecoverableZooKeeper:
The identifier of this process is 4944#ubuntu
13/08/22 09:14:14 INFO zookeeper.ClientCnxn: Opening socket connection to server
localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
13/08/22 09:14:14 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:708)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport
(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
13/08/22 09:14:15 WARN zookeeper.RecoverableZooKeeper:
Possibly transient
ZooKeeper exception:org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode =
ConnectionLoss for /hbase/hbaseid
13/08/22 09:14:15 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
I cannot understand what is the problem.
I install hbase 0.94.10 and zookeeper 3.4.5 individually and i am not sure configuration is true.can you guide and help me how configure them correctly
did you ensured to copy the phoenix server jar (its called only phoenix-.jar, I think it should be phoenix-2.0.0.jar in your case) to all of your region servers?
Also ensure that the location of the phoenix jar is appended to the HBase classpath. You need to put the following maybe in the hbase-env.sh of all your region servers:
HBASE_CLASSPATH=$HBASE_CLASSPATH:/path/to/phoenix-2.0.0.jar
Afterwards you need to restart the cluster. Then phoenix will work.
You can also read this installation guide of their github project page.
UPDATE:
I just saw that they updated their documentation. Thw last version of the documentation was more straigh-forward, but I think you will manage...
Adding answer for anyone still looking:
Your jdbc connection string must look like:
jdbc:phoenix:zookeeper_quorum:2181:/hbase_znode
OR;
jdbc:phoenix:zookeeper_quorum:/hbase_znode
(By default zookeeper listens at port 2181.)
zookeeper_quorum - Can be comma-separated server-names(must be fully qualified DNS names)
hbase_znode - hbase or hbase-unsecured
e.g.
jdbc:phoenix:server1.abc.com,server2.abc.com:2181:/hbase
I have installed CygWin in my windows 7 and also installed hbase inside CygWin following instructions from official site. I am working with a project from which i need to connect to hbase database using it's thrift API. The project is python project and i have used happybase python module. The steps are first i need to run the hbase server and thrift api from CygWin shell. Then i connect to hbase using thrift api using happybase library. It was working fine but from yesterday the server is just running fine but when i try to run the thrift then the thrift is failed to run with the following message:
13/06/22 12:40:35 INFO util.VersionInfo: HBase 0.94.7
13/06/22 12:40:35 INFO util.VersionInfo: Subversion https://svn.apache.org/repos
/asf/hbase/tags/0.94.7RC1 -r 1471806
13/06/22 12:40:35 INFO util.VersionInfo: Compiled by lhofhans on Wed Apr 24 18:4
8:26 PDT 2013
13/06/22 12:40:35 INFO thrift.ThriftServerRunner: Using default thrift server ty
pe
13/06/22 12:40:35 INFO thrift.ThriftServerRunner: Using thrift server type threa
dpool
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version
=3.4.5-1392090, built on 09/30/2012 17:52 GMT
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:host.name=Sohel-P
C
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.
0
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracl
e Corporation
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.home=C:\Prog
ram Files\Java\jre7
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.class.path=C
:\cygwin\root\usr\local\hbase-0.94.7\conf;C:\Program Files\Java\jre7\lib\tools.j
ar;C:\cygwin\root\usr\local\hbase-0.94.7\;C:\cygwin\root\usr\local\hbase-0.94.7\
hbase-0.94.7.jar;C:\cygwin\root\usr\local\hbase-0.94.7\hbase-0.94.7-tests.jar;C:
\cygwin\root\usr\local\hbase-0.94.7\lib\activation-1.1.jar;C:\cygwin\root\usr\lo
cal\hbase-0.94.7\lib\asm-3.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\avro-
1.5.3.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\avro-ipc-1.5.3.jar;C:\cygwin
\root\usr\local\hbase-0.94.7\lib\commons-beanutils-1.7.0.jar;C:\cygwin\root\usr\
local\hbase-0.94.7\lib\commons-beanutils-core-1.8.0.jar;C:\cygwin\root\usr\local
\hbase-0.94.7\lib\commons-cli-1.2.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\
commons-codec-1.4.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\commons-collecti
ons-3.2.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\commons-configuration-1.
6.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\commons-digester-1.8.jar;C:\cygw
in\root\usr\local\hbase-0.94.7\lib\commons-el-1.0.jar;C:\cygwin\root\usr\local\h
base-0.94.7\lib\commons-httpclient-3.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7
\lib\commons-io-2.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\commons-lang-2
.5.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\commons-logging-1.1.1.jar;C:\cy
gwin\root\usr\local\hbase-0.94.7\lib\commons-math-2.1.jar;C:\cygwin\root\usr\loc
al\hbase-0.94.7\lib\commons-net-1.4.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\
lib\core-3.1.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\guava-11.0.2.jar;C:
\cygwin\root\usr\local\hbase-0.94.7\lib\hadoop-core-1.0.4.jar;C:\cygwin\root\usr
\local\hbase-0.94.7\lib\high-scale-lib-1.1.1.jar;C:\cygwin\root\usr\local\hbase-
0.94.7\lib\httpclient-4.1.2.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\httpco
re-4.1.3.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jackson-core-asl-1.8.8.ja
r;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jackson-jaxrs-1.8.8.jar;C:\cygwin\ro
ot\usr\local\hbase-0.94.7\lib\jackson-mapper-asl-1.8.8.jar;C:\cygwin\root\usr\lo
cal\hbase-0.94.7\lib\jackson-xc-1.8.8.jar;C:\cygwin\root\usr\local\hbase-0.94.7\
lib\jamon-runtime-2.3.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jasper-com
piler-5.5.23.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jasper-runtime-5.5.23
.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jaxb-api-2.1.jar;C:\cygwin\root\u
sr\local\hbase-0.94.7\lib\jaxb-impl-2.2.3-1.jar;C:\cygwin\root\usr\local\hbase-0
.94.7\lib\jersey-core-1.8.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jersey-j
son-1.8.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jersey-server-1.8.jar;C:\c
ygwin\root\usr\local\hbase-0.94.7\lib\jettison-1.1.jar;C:\cygwin\root\usr\local\
hbase-0.94.7\lib\jetty-6.1.26.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jett
y-util-6.1.26.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jruby-complete-1.6.5
.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\jsp-2.1-6.1.14.jar;C:\cygwin\root
\usr\local\hbase-0.94.7\lib\jsp-api-2.1-6.1.14.jar;C:\cygwin\root\usr\local\hbas
e-0.94.7\lib\jsr305-1.3.9.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\junit-4.
10-HBASE-1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\libthrift-0.8.0.jar;C:\
cygwin\root\usr\local\hbase-0.94.7\lib\log4j-1.2.16.jar;C:\cygwin\root\usr\local
\hbase-0.94.7\lib\metrics-core-2.1.2.jar;C:\cygwin\root\usr\local\hbase-0.94.7\l
ib\netty-3.2.4.Final.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\protobuf-java
-2.4.0a.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\servlet-api-2.5-6.1.14.jar
;C:\cygwin\root\usr\local\hbase-0.94.7\lib\slf4j-api-1.4.3.jar;C:\cygwin\root\us
r\local\hbase-0.94.7\lib\slf4j-log4j12-1.4.3.jar;C:\cygwin\root\usr\local\hbase-
0.94.7\lib\snappy-java-1.0.3.2.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\sta
x-api-1.0.1.jar;C:\cygwin\root\usr\local\hbase-0.94.7\lib\velocity-1.7.jar;C:\cy
gwin\root\usr\local\hbase-0.94.7\lib\xmlenc-0.52.jar;C:\cygwin\root\usr\local\hb
ase-0.94.7\lib\zookeeper-3.4.5.jar;C:\cygwin\root\usr\local\hbase-0.94.1\lib:
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.library.path
=/usr/local/HBASE-~1.7/lib/native/Windows_7-x86-32
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=C:
\cygwin\root\tmp\
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA
>
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows 7
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:os.version=6.1
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:user.name=Sohel
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:user.home=C:\User
s\Sohel
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Client environment:user.dir=C:\cygwi
n\root\usr\local\hbase-0.94.7\bin
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:35 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:35 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:41:35 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:41:35 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240000, negot
iated timeout = 180000
13/06/22 12:41:35 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:35 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240000
13/06/22 12:41:35 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240000 closed
13/06/22 12:41:35 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:36 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:36 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:36 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:41:36 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:41:36 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240001, negot
iated timeout = 180000
13/06/22 12:41:36 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:36 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240001
13/06/22 12:41:36 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240001 closed
13/06/22 12:41:36 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:37 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:37 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:37 INFO zookeeper.ClientCnxn: Opening socket connection to server
127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown
error)
13/06/22 12:41:37 INFO zookeeper.ClientCnxn: Socket connection established to 12
7.0.0.1/127.0.0.1:2181, initiating session
13/06/22 12:41:37 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 127.0.0.1/127.0.0.1:2181, sessionid = 0x13f6a9c77240002, negotiated timeou
t = 180000
13/06/22 12:41:37 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:37 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240002
13/06/22 12:41:37 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240002 closed
13/06/22 12:41:37 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:39 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:39 INFO zookeeper.ClientCnxn: Opening socket connection to server
127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown
error)
13/06/22 12:41:39 INFO zookeeper.ClientCnxn: Socket connection established to 12
7.0.0.1/127.0.0.1:2181, initiating session
13/06/22 12:41:39 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:39 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 127.0.0.1/127.0.0.1:2181, sessionid = 0x13f6a9c77240003, negotiated timeou
t = 180000
13/06/22 12:41:39 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:39 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240003
13/06/22 12:41:39 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240003 closed
13/06/22 12:41:39 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:41 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:41 INFO zookeeper.ClientCnxn: Opening socket connection to server
127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown
error)
13/06/22 12:41:41 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:41 INFO zookeeper.ClientCnxn: Socket connection established to 12
7.0.0.1/127.0.0.1:2181, initiating session
13/06/22 12:41:42 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 127.0.0.1/127.0.0.1:2181, sessionid = 0x13f6a9c77240004, negotiated timeou
t = 180000
13/06/22 12:41:42 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:42 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240004
13/06/22 12:41:42 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240004 closed
13/06/22 12:41:42 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:46 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:46 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:46 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:41:46 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:41:46 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240005, negot
iated timeout = 180000
13/06/22 12:41:46 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:46 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240005
13/06/22 12:41:46 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240005 closed
13/06/22 12:41:46 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:50 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:50 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:50 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:41:50 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:41:50 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240006, negot
iated timeout = 180000
13/06/22 12:41:50 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:50 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240006
13/06/22 12:41:50 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240006 closed
13/06/22 12:41:50 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:58 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:41:58 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:41:58 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:41:58 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:41:58 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240007, negot
iated timeout = 180000
13/06/22 12:41:58 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:41:58 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240007
13/06/22 12:41:58 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:41:58 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240007 closed
13/06/22 12:42:14 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:42:14 INFO zookeeper.ClientCnxn: Opening socket connection to server
127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown
error)
13/06/22 12:42:14 INFO zookeeper.ClientCnxn: Socket connection established to 12
7.0.0.1/127.0.0.1:2181, initiating session
13/06/22 12:42:14 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:42:14 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 127.0.0.1/127.0.0.1:2181, sessionid = 0x13f6a9c77240008, negotiated timeou
t = 180000
13/06/22 12:42:14 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:42:14 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240008
13/06/22 12:42:14 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240008 closed
13/06/22 12:42:14 INFO zookeeper.ClientCnxn: EventThread shut down
13/06/22 12:42:46 INFO zookeeper.ZooKeeper: Initiating client connection, connec
tString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/06/22 12:42:47 INFO zookeeper.RecoverableZooKeeper: The identifier of this pr
ocess is 7944#Sohel-PC
13/06/22 12:42:47 INFO zookeeper.ClientCnxn: Opening socket connection to server
0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SA
SL (unknown error)
13/06/22 12:42:47 INFO zookeeper.ClientCnxn: Socket connection established to 0:
0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, initiating session
13/06/22 12:42:47 INFO zookeeper.ClientCnxn: Session establishment complete on s
erver 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181, sessionid = 0x13f6a9c77240009, negot
iated timeout = 180000
13/06/22 12:42:47 ERROR client.HConnectionManager$HConnectionImplementation: Che
ck the value configured in 'zookeeper.znode.parent'. There could be a mismatch w
ith the one configured in the master.
13/06/22 12:42:47 INFO client.HConnectionManager$HConnectionImplementation: Clos
ed zookeeper sessionid=0x13f6a9c77240009
13/06/22 12:42:47 INFO zookeeper.ZooKeeper: Session: 0x13f6a9c77240009 closed
13/06/22 12:42:47 INFO zookeeper.ClientCnxn: EventThread shut down
Exception in thread "main" org.apache.hadoop.hbase.MasterNotRunningException: Re
tried 10 times
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:138)
at org.apache.hadoop.hbase.thrift.ThriftServerRunner$HBaseHandler.<init>
(ThriftServerRunner.java:493)
at org.apache.hadoop.hbase.thrift.ThriftServerRunner.<init>(ThriftServer
Runner.java:228)
at org.apache.hadoop.hbase.thrift.ThriftServer.doMain(ThriftServer.java:
100)
at org.apache.hadoop.hbase.thrift.ThriftServer.main(ThriftServer.java:23
7)
Sohel#Sohel-PC /usr/local/hbase-0.94.7/bin
$
And the hbase-site.xml file is look like the following:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
<description>The directory shared by RegionServers.
</description>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>file:///C:/cygwin/tmp/hbase/data</value>
<description>The directory shared by region servers.
Should be fully-qualified to include the filesystem to use.
E.g: hdfs://NAMENODE_SERVER:PORT/HBASE_ROOTDIR
</description>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>C:/cygwin/tmp/hbase/tmp</value>
<description>Temporary directory on the local filesystem.</description>
</property>
</configuration>
Please help me with this issue guys.
Thanks,
Codengine.
Add this property in your hbase-site.xml and restart HBase :
<property>
<name>zookeeper.znode.parent</name>
<value>file:///C:/cygwin/tmp/hbase/data</value>
</property>
This is the root ZNode for HBase in ZooKeeper. All of HBase's ZooKeeper files will go under this node. It defaults to /hbase if not changed and you are using /hbase/data.
HTH
I'm trying to connect to HBase installed in the local system (using Hortonworks 1.1.1.16), by a small program in Java, which executes the next command:
HBaseAdmin.checkHBaseAvailable(conf);
It is worth saying that there is no problem at all when connecting to HBase from the command line using the hbase command.
The content of the host file is the next one (where example.com contains the actual host name):
127.0.0.1 localhost example.com
HBase is configured to work in standalone mode:
hbase.cluster.distributed=false
When executing the program, the next exception is thrown:
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:host.name=localhost
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_19
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.class.path=[...]
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-358.2.1.el6.x86_64
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:user.name=root
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root/git/project
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=example.com:2181 sessionTimeout=60000 watcher=hconnection-0x678e4593
13/05/13 15:18:29 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is hconnection-0x678e4593
13/05/13 15:18:29 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
13/05/13 15:18:29 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
13/05/13 15:18:29 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13e9d6851af0046, negotiated timeout = 40000
13/05/13 15:18:29 INFO client.HConnectionManager$HConnectionImplementation: ClusterId is cccadf06-f6bf-492e-8a39-e8beac521ce6
13/05/13 15:18:29 INFO client.HConnectionManager$HConnectionImplementation: getMaster attempt 1 of 1 failed; no more retrying.
com.google.protobuf.ServiceException: java.io.IOException: Broken pipe
at org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine$Invoker.invoke(ProtobufRpcClientEngine.java:149)
at com.sun.proxy.$Proxy5.isMasterRunning(Unknown Source)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.createMasterInterface(HConnectionManager.java:732)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.createMasterWithRetries(HConnectionManager.java:764)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterProtocol(HConnectionManager.java:1724)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterMonitor(HConnectionManager.java:1757)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.isMasterRunning(HConnectionManager.java:837)
at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2010)
at TestHBase.main(TestHBase.java:37)
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
at org.apache.hadoop.net.SocketOutputStream$Writer.performIO(SocketOutputStream.java:55)
at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:142)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:146)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:107)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.writeConnectionHeader(HBaseClient.java:896)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:847)
at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1414)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:1299)
at org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine$Invoker.invoke(ProtobufRpcClientEngine.java:131)
... 8 more
13/05/13 15:18:29 INFO client.HConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x13e9d6851af0046
13/05/13 15:18:29 INFO zookeeper.ZooKeeper: Session: 0x13e9d6851af0046 closed
13/05/13 15:18:29 INFO zookeeper.ClientCnxn: EventThread shut down
org.apache.hadoop.hbase.exceptions.MasterNotRunningException: com.google.protobuf.ServiceException: java.io.IOException: Broken pipe
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.createMasterWithRetries(HConnectionManager.java:793)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterProtocol(HConnectionManager.java:1724)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterMonitor(HConnectionManager.java:1757)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.isMasterRunning(HConnectionManager.java:837)
at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:2010)
at TestHBase.main(TestHBase.java:37)
Caused by: com.google.protobuf.ServiceException: java.io.IOException: Broken pipe
at org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine$Invoker.invoke(ProtobufRpcClientEngine.java:149)
at com.sun.proxy.$Proxy5.isMasterRunning(Unknown Source)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.createMasterInterface(HConnectionManager.java:732)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.createMasterWithRetries(HConnectionManager.java:764)
... 5 more
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
at org.apache.hadoop.net.SocketOutputStream$Writer.performIO(SocketOutputStream.java:55)
at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:142)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:146)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:107)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.writeConnectionHeader(HBaseClient.java:896)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:847)
at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1414)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:1299)
at org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine$Invoker.invoke(ProtobufRpcClientEngine.java:131)
... 8 more
This trace provides some evidence of what may be actually happening. It seems that the connection to ZooKeeper is established, but something fails when tries to access the master.
Though I've spent hours trying to find a solution in Google, I haven't seen such an exception. Particularly, this exception varies from two things from most found elsewhere:
Everybody seems to have the error getMaster attempt 0 of 1 failed rather than getMaster attempt 1 of 1 failed. I don't know whether this makes a point at all, but I find it somehow weird.
I can't find other people getting the Broken pipe error.
By the way, the master is actually running, as far as I can see in the Hortonworks Management Console.
When looking at the most recent logs, this is the output:
2013-05-13 15:30:07,192 WARN org.apache.hadoop.ipc.HBaseServer: Incorrect header or version mismatch from 127.0.0.1:40788 got version 0 expected version 3
As it is a warning rather than an error, I don't know whether it has something to do with the actual problem. The port varies in each execution.
Finally we found the problem and solved it. It turned out to be a dependencies problem. We were using hbase-0.95.0 and hbase-client-0.95.0. Using hbase-0.94.7 or hbase-0.94.9 seemed to work.
Yet, some problems occurred under certain circumstances even with that versions of the HBase library. Particularly, some problems arised when running it within an application server (JBoss AS7). In the end, all problems seems to be solved by removing the dependency hbase-client-0.95.0, and replacing it by haboop-core-1.1.2 as some classes not contained in the hbase libraries were required.
Regards.
I'd recommend first check your HBase Master / RegionServer ports are really bound with netstat -n -a. I had situation when HBase Master IPC was bound to only external IP (this was Cloudera CDH) and it was not reachable through 127.0.0.1. It looks like most probable case for you - hbase shell should still work in this case.
Another possible reason could be previous cluster crash with some HDFS data corrupted. In this case HBase does not actually start waiting for HDFS to exit safe mode. But this looks like not your case. If it is, you can manually force HDFS to exit safe mode from console and then do fsck for Hadoop and similar procedure for HBase.
I am doing a test project with Hadoop and HBase. Currently the cluster has 2 Ubuntu VMs hosted on a Windows machine.
I am able to perform PUT, QUERY and DELETE operation remotly (in my host machine) using following HBase Java API configuration
config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "192.168.56.90");
config.set("hbase.zookeeper.property.clientPort", "2222");
When I am trying to run a HBase MapReduce job on Windows with the same config as above, I am getting following error
13/03/24 06:11:03 ERROR security.UserGroupInformation: PriviledgedActionException as:Joel cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop-Joel\mapred\staging\Joel290889388\.staging to 0700
java.io.IOException: Failed to set permissions of path: \tmp\hadoop-Joel\mapred\staging\Joel290889388\.staging to 0700
From what I have read on the web, there seems to be a problem with running MapReduce jobs on Windows. So I tried running the MapReduce job on Linux by using "java - jar MR.jar".
On Linux, I can't connect to Zookeeper. For unknown reason, Zookeeper host and port are getting reseted on the client side
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Client environment:os.version=3.5.0-23-generic
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Client environment:user.name=hduser
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/hduser
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/hduser/testes
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.56.90:2222 sessionTimeout=180000 watcher=hconnection
13/03/24 05:59:33 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 11552#node01
13/03/24 05:59:33 INFO zookeeper.ClientCnxn: Opening socket connection to server node01/192.168.56.90:2222. Will not attempt to authenticate using SASL (unknown error)
13/03/24 05:59:33 INFO zookeeper.ClientCnxn: Socket connection established to node01/192.168.56.90:2222, initiating session
13/03/24 05:59:33 INFO zookeeper.ClientCnxn: Session establishment complete on server node01/192.168.56.90:2222, sessionid = 0x13d9afaa1a30006, negotiated timeout = 180000
13/03/24 05:59:33 INFO client.HConnectionManager$HConnectionImplementation: Closed zookeeper sessionid=0x13d9afaa1a30006
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Session: 0x13d9afaa1a30006 closed
13/03/24 05:59:33 INFO zookeeper.ClientCnxn: EventThread shut down
13/03/24 05:59:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
13/03/24 05:59:33 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
13/03/24 05:59:33 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/03/24 05:59:33 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 11552#node01
13/03/24 05:59:33 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
13/03/24 05:59:33 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:692)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
Judging from log above, it connects correctly to node01:2222 (node01 resolves to 192.168.56.90). But for some reason, it changes to localhost:2181 and it then gives a connection refused error.
How can I fix this issue to get a MR jobs running on Linux, on the same machine as Zookeeper is running?
Version: Hbase 0.94.5 / Hadoop 1.1.2
Thanks.
You may need to set the hbase.master also.
also check the /etc/hosts file and see if it is correct. Are you able to telnet to the zookeeper using that connection info?
config.set("hbase.zookeeper.quorum", "192.168.56.90");
config.set("hbase.zookeeper.property.clientPort", "2222");
config.set("hbase.master", "some.host.com:60000")