Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hbase remotely connecting to standalone instance #167

Closed
kirillsavine opened this issue Jun 6, 2017 · 3 comments
Closed

Hbase remotely connecting to standalone instance #167

kirillsavine opened this issue Jun 6, 2017 · 3 comments

Comments

@kirillsavine
Copy link

I have been trying to setup HBase for the first time. I am able to successfully run the native Hbase shell on the server. But I am not able to connect remotely via a client.

I start Hbase using the following command on host:
/home/kirill/hbase/hbase-1.2.5/bin/start-hbase.sh

To connect from a client, I run the following:

>>> import happybase
>>> co = happybase.Connection('192.168.0.18',2181)
>>> co.tables()

I get the following error after trying to list tables with co.tables():

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\soft\miniconda2\lib\site-packages\happybase\connection.py", line 242, in tables
    names = self.client.getTableNames()
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\thrift.py", line 198, in _req
    return self._recv(_api)
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\thrift.py", line 210, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\protocol\binary.py", line 372, in read_message_begin
    self.trans, strict=self.strict_read)
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\protocol\binary.py", line 164, in read_message_begin
    sz = unpack_i32(inbuf.read(4))
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\transport\__init__.py", line 32, in read
    return readall(self._read, sz)
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\transport\__init__.py", line 14, in readall
    chunk = read_fn(sz - have)
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\transport\buffered\__init__.py", line 39, in _read
    self._rbuf = BytesIO(self._trans.read(max(sz, self._buf_size)))
  File "C:\soft\miniconda2\lib\site-packages\thriftpy\transport\socket.py", line 125, in read
    message='TSocket read 0 bytes')
thriftpy.transport.TTransportException: TTransportException(message='TSocket read 0 bytes', type=4)

Here are last 3 lines from Hbase log:

It says that connection from 192.168.0.11 (client IP) is accepted, but immediately after that it throws an Exception causing close of session:

2017-06-06 10:48:10,634 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.NIOServerCnxnFactory: Accepted socket connection from /192.168.0.11:58052
2017-06-06 10:48:11,841 WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.NIOServerCnxn: Exception causing close of session 0x0 due to java.io.IOException: Len error -2147418111
2017-06-06 10:48:11,842 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.NIOServerCnxn: Closed socket connection for client /192.168.0.11:58052 (no session established for client)

I have see this issue: #6
And tried running Thrift with bin/hbase thrift start -threadpool as suggested by teepark, but the error I get is the same.

Any help would be greatly appreciated. Here is the host setup:

Hbase setup:

Host running Hbase: Ubuntu Server, Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-31-generic x86_64)

path to Hbase bin folder: /home/kirill/hbase/hbase-1.2.5/bin

IP of host: 192.168.0.18

conf/hbase-site.xml:

<configuration>

	<property>
		<name>hbase.rootdir</name>
		<value>file:///home/kirill/hbase/hbase-1.2.5/</value>
	</property>
	
	<property>
		<name>hbase.zookeeper.property.dataDir</name>
		<value>/home/kirill/zookeeper</value>
	</property>

	<property>
		<name>hbase.zookeeper.property.clientPort</name>
		<value>2181</value>
	</property>
	<property>
		<name>hbase.zookeeper.quorum</name>
		<value>192.168.0.18</value>
	</property>
	
</configuration>

/etc/hosts:

127.0.0.1	localhost
192.168.0.18	ubuntu
@wbolster
Copy link
Member

wbolster commented Jun 6, 2017

>>> co = happybase.Connection('192.168.0.18',2181)

seems like you are not connecting to the thrift server, which generally listens on another port.

@kirillsavine
Copy link
Author

kirillsavine commented Jun 6, 2017 via email

@wbolster wbolster closed this as completed Jun 7, 2017
@wbolster
Copy link
Member

wbolster commented Jun 7, 2017

you're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants