phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Kamil <alex.ka...@gmail.com>
Subject Re: jdbc:phoenix connection
Date Thu, 21 Aug 2014 14:21:38 GMT
Pariksheet
- did you update hostname in guest os? what do you see when you run
"hostname -f" command there
- are you running hbase in standalone mode? check if there are any host
names in your hbase/conf/hbase-site.xml that need to be updated (if in
distributed mode than also hadoop/conf/core-site.xml etc)
- I've just posted standalone setup instructions here, hope this helps:
https://issues.apache.org/jira/browse/PHOENIX-1194


On Thu, Aug 21, 2014 at 9:58 AM, Pariksheet Barapatre <pbarapatre@gmail.com>
wrote:

> Guest os /etc/hosts --
> pari@ubuntu:~/Downloads/phoenix/bin$ cat /etc/hosts
> 127.0.0.1       localhost
> 127.0.0.1 ubuntu.ubuntu-domain ubuntu
> 127.0.1.1       myhostname.example.com myhostname
>
> Hbase working fine.. I am able to run java code locally..
>
>
>
> Host OS /etc/hosts ..
>
> pariksheet@Pariksheet:~/Downloads$ cat /etc/hosts
> 127.0.0.1    localhost
> #127.0.1.1    Pariksheet
> 172.16.59.149    myhostname.example.com myhostname
>
>
> But still getting same error-
>
> pariksheet@Pariksheet:~/Downloads$ java -cp
> /home/pariksheet/Downloads/phoenix/phoenix-2.2.3-incubating-client.jar:.
> DataLoader
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client environment:host.name
> =<NA>
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.version=1.7.0_65
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.vendor=Oracle Corporation
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.home=/usr/lib/jvm/java-7-oracle/jre
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.class.path=/home/pariksheet/Downloads/phoenix/phoenix-2.2.3-incubating-client.jar:.
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.io.tmpdir=/tmp
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:java.compiler=<NA>
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client environment:os.name
> =Linux
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:os.arch=amd64
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:os.version=3.16.1-031601-generic
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client environment:user.name
> =pariksheet
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:user.home=/home/pariksheet
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Client
> environment:user.dir=/home/pariksheet/Downloads
> 14/08/21 19:24:31 INFO zookeeper.ZooKeeper: Initiating client connection,
> connectString=myhostname:2181 sessionTimeout=180000 watcher=hconnection
> 14/08/21 19:24:31 INFO zookeeper.ClientCnxn: Opening socket connection to
> server myhostname.example.com/172.16.59.149:2181. Will not attempt to
> authenticate using SASL (unknown error)
> 14/08/21 19:24:31 INFO zookeeper.ClientCnxn: Socket connection established
> to myhostname.example.com/172.16.59.149:2181, initiating session
> 14/08/21 19:24:31 INFO zookeeper.ClientCnxn: Session establishment
> complete on server myhostname.example.com/172.16.59.149:2181, sessionid =
> 0x147f8d70c330005, negotiated timeout = 40000
> 14/08/21 19:24:31 INFO zookeeper.RecoverableZooKeeper: The identifier of
> this process is 17905@localhost
> 14/08/21 19:24:36 INFO
> client.HConnectionManager$HConnectionImplementation: getMaster attempt 0 of
> 14 failed; retrying after sleep of 1007
>
> java.net.ConnectException: Connection refused
>     at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>     at
> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
>     at
> org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
>     at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
>     at
> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:390)
>     at
> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:436)
>     at
> org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1133)
>     at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:980)
>     at
> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
>     at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
>     at
> org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
>     at
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:816)
>     at
> org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:611)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1017)
>     at
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:773)
>     at
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:328)
>     at
> org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:73)
>     at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.executeUpdate(PhoenixStatement.java:347)
>     at
> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1026)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1174)
>     at
> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:77)
>     at
> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:105)
>     at java.sql.DriverManager.getConnection(DriverManager.java:571)
>     at java.sql.DriverManager.getConnection(DriverManager.java:233)
>     at DataLoader.main(DataLoader.java:10)
> 14/08/21 19:24:37 INFO
> client.HConnectionManager$HConnectionImplementation: getMaster attempt 1 of
> 14 failed; retrying after sleep of 1003
> org.apache.hadoop.hbase.ipc.HBaseClient$FailedServerException: This server
> is in the failed servers list: localhost/127.0.0.1:55070
>
>     at
> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:425)
>     at
> org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1133)
>     at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:980)
>     at
> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
>     at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
>     at
> org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
>     at
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:816)
>     at
> org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:611)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1017)
>     at
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:773)
>     at
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:328)
>     at
> org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:73)
>     at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.executeUpdate(PhoenixStatement.java:347)
>     at
> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1026)
>     at
> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1174)
>     at
> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:77)
>     at
> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:105)
>     at java.sql.DriverManager.getConnection(DriverManager.java:571)
>     at java.sql.DriverManager.getConnection(DriverManager.java:233)
>     at DataLoader.main(DataLoader.java:10)
>
>
> Can anybody please help..
>
> Many Thanks
> Pari
>
>
> On 21 August 2014 19:03, Pariksheet Barapatre <pbarapatre@gmail.com>
> wrote:
>
>> Thanks for reply Alex..
>>
>> I have made the changes in /etc/hosts as you suggest. but new error
>> popped-out..hbase is not able start..
>>
>>
>> 127.0.0.1       localhost
>> 127.0.1.1       myhostname.example.com myhostname
>>
>>
>> pari@ubuntu:~/Downloads/hbase/bin$ ./start-hbase.sh
>> starting master, logging to
>> /home/pari/Downloads/hbase/bin/../logs/hbase-pari-master-ubuntu.out
>> pari@ubuntu:~/Downloads/hbase/bin$ jps
>> 6842 Jps
>>
>> cheers
>> pari
>>
>>
>> On 21 August 2014 18:40, Alex Kamil <alex.kamil@gmail.com> wrote:
>>
>>>  ..something like this:
>>>
>>> on hbase/zk server (vm)
>>> hostname myhostname.example.com
>>> vi /etc/hosts
>>>  127.0.0.1       localhost
>>>  127.0.1.1       myhostname.example.com myhostname
>>>
>>>  on the client (desktop/host os)
>>>  vi /etc/hosts
>>>  127.0.0.1       localhost
>>>  172.16.59.149 <http://172.16.59.149:2181/>    myhostname.example.com
>>> myhostname
>>>
>>>
>>> On Thu, Aug 21, 2014 at 8:55 AM, Alex Kamil <alex.kamil@gmail.com>
>>> wrote:
>>>
>>>> Pariksheet, try editing /etc/hosts in both host os and vm (add
>>>> zookeeper quorum host/ip)
>>>>
>>>>
>>>> On Thu, Aug 21, 2014 at 7:37 AM, Pariksheet Barapatre <
>>>> pbarapatre@gmail.com> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I have just started exploring both Phoenix and Hbase.
>>>>>
>>>>> I have configured Hbase0.94.21 and Phoenix 2.2 standalone node VM
>>>>> (ubuntu).
>>>>>
>>>>> I am able to load data and query the same. Refer below program -
>>>>>
>>>>> import java.sql.*;
>>>>>
>>>>> public class DataLoader{
>>>>>
>>>>>         private static Connection conn;
>>>>>
>>>>>         public static void main(String ... args){
>>>>>                 try{
>>>>>
>>>>> Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
>>>>>                         conn =
>>>>> DriverManager.getConnection("jdbc:phoenix:172.16.59.149:2181");
>>>>> //                      conn =
>>>>> DriverManager.getConnection("jdbc:phoenix:localhost");
>>>>>                         String sql = "select * from WEB_STAT";
>>>>>                         //PreparedStatement pstmt =
>>>>> conn.prepareStatement(sql);
>>>>>                         ResultSet rs =
>>>>> conn.createStatement().executeQuery(sql); //pstmt.executeQuery();
>>>>>                         while(rs.next()){
>>>>>                                 System.out.println(" col :"+
>>>>> rs.getString(3));
>>>>>                         }
>>>>>                 }catch(Exception e){
>>>>>                         e.printStackTrace();
>>>>>                 }
>>>>>         }
>>>>> }
>>>>>
>>>>>
>>>>> But when I am trying to run same program from my desktop (ubuntu) ..
>>>>> its giving below error ..
>>>>>
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52
GMT
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client environment:
>>>>> host.name=Pariksheet
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.version=1.7.0_65
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.vendor=Oracle Corporation
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.home=/usr/lib/jvm/java-7-oracle/jre
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.class.path=/home/pariksheet/Downloads/phoenix/phoenix-2.2.3-incubating-client.jar:.
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.io.tmpdir=/tmp
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:java.compiler=<NA>
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client environment:os.name
>>>>> =Linux
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:os.arch=amd64
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:os.version=3.16.1-031601-generic
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client environment:
>>>>> user.name=pariksheet
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:user.home=/home/pariksheet
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Client
>>>>> environment:user.dir=/home/pariksheet/Downloads
>>>>> 14/08/21 17:06:01 INFO zookeeper.ZooKeeper: Initiating client
>>>>> connection, connectString=172.16.59.149:2181 sessionTimeout=180000
>>>>> watcher=hconnection
>>>>> 14/08/21 17:06:01 INFO zookeeper.RecoverableZooKeeper: The identifier
>>>>> of this process is 13794@Pariksheet
>>>>> 14/08/21 17:06:01 INFO zookeeper.ClientCnxn: Opening socket connection
>>>>> to server 172.16.59.149/172.16.59.149:2181. Will not attempt to
>>>>> authenticate using SASL (unknown error)
>>>>> 14/08/21 17:06:01 INFO zookeeper.ClientCnxn: Socket connection
>>>>> established to 172.16.59.149/172.16.59.149:2181, initiating session
>>>>> 14/08/21 17:06:01 INFO zookeeper.ClientCnxn: Session establishment
>>>>> complete on server 172.16.59.149/172.16.59.149:2181, sessionid =
>>>>> 0x147f851164c0007, negotiated timeout = 40000
>>>>> 14/08/21 17:06:01 INFO
>>>>> client.HConnectionManager$HConnectionImplementation: getMaster attempt
0 of
>>>>> 14 failed; retrying after sleep of 1001
>>>>> java.net.ConnectException: Connection refused
>>>>>     at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>>>>>     at
>>>>> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
>>>>>     at
>>>>> org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
>>>>>     at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:390)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:436)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1133)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:980)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
>>>>>     at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
>>>>>     at
>>>>> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:816)
>>>>>     at
>>>>> org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:611)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1017)
>>>>>     at
>>>>> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:773)
>>>>>     at
>>>>> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:328)
>>>>>     at
>>>>> org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:73)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.executeUpdate(PhoenixStatement.java:347)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1026)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1174)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:77)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:105)
>>>>>     at java.sql.DriverManager.getConnection(DriverManager.java:571)
>>>>>     at java.sql.DriverManager.getConnection(DriverManager.java:233)
>>>>>     at DataLoader.main(DataLoader.java:10)
>>>>> 14/08/21 17:06:02 INFO
>>>>> client.HConnectionManager$HConnectionImplementation: getMaster attempt
1 of
>>>>> 14 failed; retrying after sleep of 1000
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient$FailedServerException: This
>>>>> server is in the failed servers list: localhost/127.0.0.1:42770
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:425)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1133)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:980)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
>>>>>     at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
>>>>>     at
>>>>> org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
>>>>>     at
>>>>> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:816)
>>>>>     at
>>>>> org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:611)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1017)
>>>>>     at
>>>>> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:773)
>>>>>     at
>>>>> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:328)
>>>>>     at
>>>>> org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:73)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.executeUpdate(PhoenixStatement.java:347)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1026)
>>>>>     at
>>>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1174)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:77)
>>>>>     at
>>>>> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:105)
>>>>>     at java.sql.DriverManager.getConnection(DriverManager.java:571)
>>>>>     at java.sql.DriverManager.getConnection(DriverManager.java:233)
>>>>>     at DataLoader.main(DataLoader.java:10)
>>>>>
>>>>> Can you please help me...
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> Pari
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Cheers,
>> Pari
>>
>
>
>
> --
> Cheers,
> Pari
>

Mime
View raw message