Reputation: 457
I have a standalone HBase installed in a server(Remote).
I written a Java Client, which communicates using Phoenix, and saw it tries for 36 attempts and hence throws exception.
HBase-Version : 1.1.5
Phoenix-core: 4.8.0-HBase-1.1
ConnectionString:
Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
Connection connection = DriverManager.getConnection("jdbc:phoenix:192.168.1.xxx:2181");
Am I missing somethinghere, cz its not connecting at all.
Exception:
Exception in thread "main" java.sql.SQLException: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Mon Oct 17 11:50:18 IST 2016, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=80992: row 'SYSTEM:CATALOG,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=HOSTNAME,16201,1476683863488, seqNum=0
Can some one help me out..!
Upvotes: 1
Views: 1750
Reputation: 457
Well its internal ip mapping error,
Anybody, struggles first push of the request towards server, please makesure the host string is configured. Modifying host here
Upvotes: 2
Reputation: 4636
In my experience, this usually occurs when you're getting timeouts on the scanners. And in your case, that appears to be true, as well b/c in your error message it says:
callTimeout=60000, callDuration=80992
meaning you went on for 81 seconds when your timeout was a minute. When querying HBase, you want to make sure you're using the rowkey or in newer versions of phoenix, the timestamp as well. Any other HBase query is going to be ridiculously inefficient. You can try a few things:
Again, change your query to use the existing rowkey. In one table we have, the first character of the rowkey is 0-9 so we'll run the following:
select * from TABLE WHERE ROWKEY like '0%' AND [other_conditions]
select * from TABLE WHERE ROWKEY like '1%' AND [other_conditions]
etc...
And then combine the results or if we're counting, just multiply by 10 b/c that's usually good enough for our purposes
Finally, you may have to write a better rowkey to optimize for your phoenix queries. This is more of an advanced topic, but it's true of all HBase querying. HBase is good at one thing and that's querying its one, powerful index: the rowkey. Using phoenix doesn't alleviate that issue.
And by the way, from a stack overflow standpoint, it helps if you post a little about your query and your table structure.
Upvotes: 3