hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Can't connect to hbase via phoenix client
Date Fri, 27 Mar 2015 14:19:32 GMT
The source code is a bit hard to read.
What JDK version are you using ?

Looks like your machine uses IPv6.
You may want to try the following command line option:

-Djava.net.preferIPv4Stack=true

Cheers

On Fri, Mar 27, 2015 at 12:47 AM, James Teng <tenglinxiao@outlook.com>
wrote:

> HI,
> i tried to connect to local deployed hbase with my codes below, but can't
> connect to it successfully. and attach the log data i can see from hbase
> side.
> if anyone give me any tip on it, will be very appreciating.thanks in
> advance.uknow.
> -----------java codes----------------import java.sql.Connection;import
> java.sql.DriverManager;import java.sql.ResultSet;import
> java.sql.SQLException;import java.sql.Statement;
> public class Test {     public static void main(String args[]) throws
> SQLException {            try {
>  Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");         } catch
> (ClassNotFoundException e) {                    e.printStackTrace();
>             return;         }               Connection connection =
> DriverManager
>  .getConnection("jdbc:phoenix:localhost:2181");
> System.out.println("step 1 ...");               Statement statement =
> connection.createStatement();             ResultSet set =
> statement.executeQuery("select * from user");           while (set.next())
> {                    System.out.println(set.getObject(1));           }
>                 connection.close();     }}---------------------hbase logs
> --------------------2015-03-27 15:45:27,144 INFO  [NIOServerCxn.Factory:
> 0.0.0.0/0.0.0.0:2181] server.NIOServerCnxnFactory: Accepted socket
> connection from /0:0:0:0:0:0:0:1:568862015-03-27 15:45:27,150 INFO
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer:
> Client attempting to establish new session at
> /0:0:0:0:0:0:0:1:568862015-03-27 15:45:27,157 INFO  [SyncThread:0]
> server.ZooKeeperServer: Established session 0x14c59bbda3c003d with
> negotiated timeout 40000 for client /0:0:0:0:0:0:0:1:568862015-03-27
> 15:45:32,933 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181]
> server.NIOServerCnxnFactory: Accepted socket connection from
> /fe80:0:0:0:0:0:0:1%1:568872015-03-27 15:45:32,933 INFO
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer:
> Client attempting to establish new session at
> /fe80:0:0:0:0:0:0:1%1:568872015-03-27 15:45:32,942 INFO  [SyncThread:0]
> server.ZooKeeperServer: Established session 0x14c59bbda3c003e with
> negotiated timeout 40000 for client /fe80:0:0:0:0:0:0:1%1:56887
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message