sqlline-thin.py does not work either. Did I have anything missing? I can run /sqlline.py localhost:2181:hbase without any problem.
# ./sqlline-thin.py http://localhost:8765 Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF. Setting property: [incremental, false] Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none org.apache.phoenix.queryserver.client.Driver Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization =PROTOBUF java.lang.RuntimeException: org.apache.calcite.avatica.org.apache.http.conn.HttpHostConnectException: Connect to localhost:8765 [localhost/127.0.0.1] failed: Connection refused (Connection refused) at org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl.send(AvaticaCommonsHttpClientImpl.java:143) at org.apache.calcite.avatica.remote.RemoteProtobufService._apply(RemoteProtobufService.java:44) at org.apache.calcite.avatica.remote.ProtobufService.apply(ProtobufService.java:81) at org.apache.calcite.avatica.remote.Driver.connect(Driver.java:175) at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157) at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203) at sqlline.Commands.connect(Commands.java:1064) at sqlline.Commands.connect(Commands.java:996) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36) at sqlline.SqlLine.dispatch(SqlLine.java:803) at sqlline.SqlLine.initArgs(SqlLine.java:588) at sqlline.SqlLine.begin(SqlLine.java:656) at sqlline.SqlLine.start(SqlLine.java:398) at sqlline.SqlLine.main(SqlLine.java:292) at org.apache.phoenix.queryserver.client.SqllineWrapper.main(SqllineWrapper.java:83) Caused by: org.apache.calcite.avatica.org.apache.http.conn.HttpHostConnectException: Connect to localhost:8765 [localhost/127.0.0.1] failed: Connection refused (Connection refused) at org.apache.calcite.avatica.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158) at org.apache.calcite.avatica.org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.calcite.avatica.org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.calcite.avatica.org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.calcite.avatica.org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.calcite.avatica.org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.calcite.avatica.org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.calcite.avatica.org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.calcite.avatica.org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl.send(AvaticaCommonsHttpClientImpl.java:131) ... 18 more Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.calcite.avatica.org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.calcite.avatica.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141) ... 27 more sqlline version 1.1.9 0: jdbc:phoenix:thin:url=http://localhost:876> On Fri, Dec 16, 2016 at 10:42 AM, Cui Lin <[email protected]> wrote: > Hi Will, > > curl http://localhost:8765 > curl: (7) Failed to connect to localhost port 8765: Connection refused > > How I open this connection? > > > > On Fri, Dec 16, 2016 at 10:38 AM, Will Xu <[email protected]> wrote: > >> A few things. >> >> 1. Are you on 0.5 version of the connector? >> >> $>pip freeze | grep phoenixdb >> >> Should be==> phoenixdb==0.5 >> >> >> 2. Can you try curl http://localhost:8765 to see if the server is >> actually running? If you open the page in browser you should see a Jetty >> 404 page. >> >> >> PQS is a think wrapper around Phoenix client. It's actually a service. If >> you have sqlline-thin client you can test it out. >> >> $>bin/sqlline-thin.py http://localhost:8765 >> >> Regards, >> Will >> ------------------------------ >> *From:* Cui Lin <[email protected]> >> *Sent:* Friday, December 16, 2016 10:29 AM >> *To:* [email protected] >> *Subject:* Phoenix database adapter for Python not working >> >> I followed the instruction from http://python-phoenixdb.readth >> edocs.io/en/latest/ >> >> to connect Hbase in cloudera cluster, but I got the following error below. >> >> >> >>> import phoenixdb >> >>> database_url = 'http://localhost:8765/' >> >>> conn = phoenixdb.connect(database_url, autocommit=True) >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/root/anaconda2/lib/python2.7/site-packages/phoenixdb/__init__.py", >> line 63, in connect >> client.connect() >> File "/root/anaconda2/lib/python2.7/site-packages/phoenixdb/avatica.py", >> line 152, in connect >> raise errors.InterfaceError('Unable to connect to the specified service', >> e) >> phoenixdb.errors.InterfaceError: ('Unable to connect to the specified >> service', error(111, 'Connection refused'), None, None) >> >> >> I can create table using phoenix-sqlline.py localhost:2181:/hbase or even >> use ./psql.py to import CSV, why the python adaopter does not work? Could >> someone give me a simple example that allows the adapter to connect Hbase >> in Cloudera? >> >> I've been trying to find the solution for days... please help! >> >> >> -- >> Best regards! >> >> Lin,Cui >> > > > > -- > Best regards! > > Lin,Cui > -- Best regards! Lin,Cui
