Re: Can not connect local java client to a remote Hbase
you ports are open. Your settings are fine. Issue seems to be elsewhere bu I am not sure where. check with Pentaho maybe. On Fri, Apr 22, 2016 at 8:44 PM, SOUFIANI Mustapha | السفياني مصطفى < s.mustaph...@gmail.com> wrote: > Maybe those ports are not open: > hduser@big-services:~$ telnet localhost 16020 > Trying ::1... > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. >
Re: Can not connect local java client to a remote Hbase
Check these links out http://stackoverflow.com/questions/36377393/connecting-to-hbase-1-0-3-via-java-client-stuck-at-zookeeper-clientcnxn-session http://mail-archives.apache.org/mod_mbox/hbase-user/201604.mbox/browser First what is you machines IP address. If you can specify only IP address in regionserver and hbase-site.xml and also remove 192.168.1.240 master-sigma from hosts then you can be sure everything is getting resolved via IP address only. Also enable trace logging to understand more, as what call is getting failed and why. What I have found is that in HBase some servers are resolved differently as pointed in those links. Hope it helps. Sachin On Thu, Apr 21, 2016 at 11:11 PM, SOUFIANI Mustapha | السفياني مصطفى < s.mustaph...@gmail.com> wrote: > Hi all, > I'm trying to connect my local java client (pentaho) to a remote Hbase but > every time I get a TimeOut error telleing me that this connection couldn't > be established. > > herer is the full message error: > > > *** > > java.io.IOException: > org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after > attempts=36, exceptions: > Wed Apr 20 10:32:43 WEST 2016, null, java.net.SocketTimeoutException: > callTimeout=6, callDuration=75181: row 'pentaho_mappings,,' on table > 'hbase:meta' at region=hbase:meta,,1.1588230740, > hostname=localhost,16020,1461071963695, seqNum=0 > > > at > > com.pentaho.big.data.bundles.impl.shim.hbase.table.HBaseTableImpl.exists(HBaseTableImpl.java:71) > > at > > org.pentaho.big.data.kettle.plugins.hbase.mapping.MappingAdmin.getMappedTables(MappingAdmin.java:502) > > at > > org.pentaho.big.data.kettle.plugins.hbase.output.HBaseOutputDialog.setupMappedTableNames(HBaseOutputDialog.java:818) > > at > > org.pentaho.big.data.kettle.plugins.hbase.output.HBaseOutputDialog.access$900(HBaseOutputDialog.java:88) > > at > > org.pentaho.big.data.kettle.plugins.hbase.output.HBaseOutputDialog$7.widgetSelected(HBaseOutputDialog.java:398) > > at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) > > at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) > > at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) > > at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) > > at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) > > at > > org.pentaho.big.data.kettle.plugins.hbase.output.HBaseOutputDialog.open(HBaseOutputDialog.java:603) > > at > > org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:125) > > at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8783) > > at > org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3072) > > at > > org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:755) > > at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) > > at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) > > at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) > > at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) > > at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) > > at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1347) > > at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7989) > > at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9269) > > at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:662) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92) > > Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed > after attempts=36, exceptions: > Wed Apr 20 10:32:43 WEST 2016, null, java.net.SocketTimeoutException: > callTimeout=6, callDuration=75181: row 'pentaho_mappings,,' on table > 'hbase:meta' at region=hbase:meta,,1.1588230740, > hostname=localhost,16020,1461071963695, seqNum=0 > > > at > > org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:270) > > at > > org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:225) > > at > > org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:63) > > at > > org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200) > > at > org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:314) > > at > > org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:289) > > at > >
Re: Connecting to hbase 1.0.3 via java client stuck at zookeeper.ClientCnxn: Session establishment complete on server
Hi, I figured out the issue. The region server was listening to 192.168.1.102:55964 and not 127.0.0.1: 55964. 192.168.1.102 is the IP of my machine and Sachin-PC is my machine name. In hosts my entry was 127.0.0.1 localhost.localdomain localhost Sachin-PC I removed Sachin-PC from there and it works now. Client now connects to 192.168.1.102:55964. I however don't understand one thing: in regionservers I have specified: 127.0.0.1 Also in my hbase-site.xml I specified hbase.zookeeper.quorum as 127.0.0.1 When I do netstat I see zookeeper, master, master web UI, region server web UI all listening at 0.0.0.0 However regionserver listening at 192.168.1.102 which is my machine's IP address. So why is regionserver listening at a different IP. One more thing, when I start hbase, I see no log file getting generated. How do I specify log file to be generated. Thanks Sachin On Wed, Apr 6, 2016 at 9:27 AM, Ding,Dongchao <dingdongc...@baidu.com> wrote: > > 1、 Is your zk-path 127.0.0.1:2181 ? This is default configuration without > config file. > > 2、Set a cache value (100 or 1000 and so on ) for scan object. > > > 在 16/4/4 01:06, "Sachin Mittal" <sjmit...@gmail.com> 写入: > > >I am stuck on connecting to hbase 1.0.3 via simple java client. > >The program hangs at: > > > >[main] zookeeper.ZooKeeper: Initiating client connection, > >connectString= > >127.0.0.1:2181 sessionTimeout=9 watcher=hconnection-0x1e67b8720x0, > >quorum=127.0.0.1:2181, baseZNode=/hbaseenter code here > >[main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Opening > socket > >connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to > >authenticate using SASL (unknown error) > >[main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Socket > >connection established to 127.0.0.1/127.0.0.1:2181, initiating session > >[main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Session > >establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = > >0x153d8383c530008, negotiated timeout = 4 > > > >The code is very simple and standard: > > > > public static void main(String args[]) throws IOException{ > >// Instantiating Configuration class > >Configuration config = HBaseConfiguration.create(); > >Connection connection = > >ConnectionFactory.createConnection(config); > > // Instantiating Table class > >Table table = > >connection.getTable(TableName.valueOf(HBaseTables.APPLICATION_TRACE_INDEX) > >); > > // Instantiating the Scan class > >Scan scan = new Scan(); > > // Getting the scan result > >ResultScanner scanner = table.getScanner(scan); > >// Reading values from scan result > >for (Result result = scanner.next(); result != null; result = > >scanner.next()) { > >System.out.println("Found row : " + result); > >} > >//closing the scanner > >scanner.close(); > >table.close(); > >connection.close(); > > } > > > > > >The jars I am using are: > > > >commons-collections-3.2.1.jar > >commons-configuration-1.6.jar > >commons-lang-2.6.jar > >commons-logging-1.2.jar > >guava-12.0.1.jar > >hadoop-auth-2.5.1.jar > >hadoop-client-2.5.1.jar > >hadoop-common-2.5.1.jar > >hbase-client-1.0.3.jar > >hbase-common-1.0.3.jar > >hbase-hadoop-compat-1.0.3.jar > >hbase-hadoop2-compat-1.0.3.jar > >hbase-it-1.0.3.jar > >hbase-protocol-1.0.3.jar > >hbase-resource-bundle-1.0.3.jar > >hbase-rest-1.0.3.jar > >htrace-core-3.0.4.jar > >htrace-core-3.1.0-incubating.jar > >log4j-1.2.17.jar > >netty-3.2.4.Final.jar > >netty-all-4.0.23.Final.jar > >protobuf-java-2.5.0.jar > >slf4j-api-1.7.7.jar > >slf4j-log4j12-1.7.7.jar > >zookeeper-3.4.6.jar > > > >My hbase-site.xml is > > > > > > > >hbase.rootdir > >file:///path/to/data/hbase > > > > > >hbase.zookeeper.property.dataDir > >file:///path/to/data/zookeeper > > > > > >hbase.zookeeper.quorum > >127.0.0.1 > > > > > > > >In my hosts I have this entry: > >127.0.0.1 localhost.localdomain localhost Sachin-PC > > > >Also in hbase regionservers has one entry > >localhost > > > >I have tried many options for hbase.zookeeper.quo
Re: Connecting to hbase 1.0.3 via java client stuck at zookeeper.ClientCnxn: Session establishment complete on server
There is additional information I would like to share with you which points to region server dying or something or connecting/resolving a wrong region server. Here is the log when trying to connect to server: [main-EventThread] zookeeper.ZooKeeperWatcher: hconnection-0x1e67b872-0x153e135af570008 connected [main] client.ZooKeeperRegistry: Looking up meta region location in ZK, connection=org.apache.hadoop.hbase.client.ZooKeeperRegistry@69b794e2 [main] client.ZooKeeperRegistry: Looked up meta region location, connection=org.apache.hadoop.hbase.client.ZooKeeperRegistry@69b794e2; serverName=sachin-pc,55964,1459772310378[main] client.MetaCache: Cached location: [region=hbase:meta,,1.1588230740, hostname=sachin-pc,55964,1459772310378, seqNum=0] [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: Connecting to Sachin-PC/127.0.0.1:55964 java.net.SocketException: Socket is closed at sun.nio.ch.SocketAdaptor.getOutputStream(Unknown Source) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.closeConnection(RpcClientImpl.java:429) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.handleConnectionFailure(RpcClientImpl.java:477) java.net.SocketException: Socket is closed at sun.nio.ch.SocketAdaptor.getInputStream(Unknown Source) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.closeConnection(RpcClientImpl.java:436) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.handleConnectionFailure(RpcClientImpl.java:477) [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: IPC Client (1890187342) connection to Sachin-PC/127.0.0.1:55964 from Sachin: marking at should close, reason: Connection refused: no further information So you can see that it gets the right region server and tries to connect to Sachin-PC/127.0.0.1:55964. However here it is getting socket exception. Also via the master web UI I found a region server with name: sachin-pc,55964,1459772310378 Now in logs I see connection to Sachin-PC/127.0.0.1:55964 which is failing. Also on netstat sometimes I see TCP 192.168.1.102:60737 Sachin-PC:0 LISTENING but most of the time I see nothing. This means region servers are failing a lot and it is listening on PC IP address 192.168.1.102 and not on localhost 127.0.0.1 Maybe that is also causing an issue. But again the question is why it is trying to connect to Sachin-PC/127.0.0.1:55964.which is the region server name, actually region server is running on a different port say 55950 or something. Thanks Sachin On Sun, Apr 3, 2016 at 10:36 PM, Sachin Mittal <sjmit...@gmail.com> wrote: > I am stuck on connecting to hbase 1.0.3 via simple java client. > The program hangs at: > > [main] zookeeper.ZooKeeper: Initiating client connection, > connectString=127.0.0.1:2181 sessionTimeout=9 > watcher=hconnection-0x1e67b8720x0, quorum=127.0.0.1:2181, > baseZNode=/hbaseenter code here > [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Opening > socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to > authenticate using SASL (unknown error) > [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Socket > connection established to 127.0.0.1/127.0.0.1:2181, initiating session > [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Session > establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = > 0x153d8383c530008, negotiated timeout = 4 > > The code is very simple and standard: > > public static void main(String args[]) throws IOException{ > // Instantiating Configuration class > Configuration config = HBaseConfiguration.create(); > Connection connection = ConnectionFactory.createConnection(config); > // Instantiating Table class > Table table = > connection.getTable(TableName.valueOf(HBaseTables.APPLICATION_TRACE_INDEX)); >// Instantiating the Scan class > Scan scan = new Scan(); > // Getting the scan result > ResultScanner scanner = table.getScanner(scan); > // Reading values from scan result > for (Result result = scanner.next(); result != null; result = > scanner.next()) { > System.out.println("Found row : " + result); > } > //closing the scanner > scanner.close(); > table.close(); > connection.close(); > } > > > The jars I am using are: > > commons-collections-3.2.1.jar > commons-configuration-1.6.jar > commons-lang-2.6.jar > commons-logging-1.2.jar > guava-12.0.1.jar > hadoop-auth-2.5.1.jar > hadoop-client-2.5.1.jar > hadoop-common-2.5.1.jar > hbase-client-1.0.3.jar > hbase-common-1.0.3.jar > hbase-hadoop-compat-1.0.3.jar > hbase-hadoop2-compat-1.0.3.jar > hbase-it-1.0.3.jar > hbas
Connecting to hbase 1.0.3 via java client stuck at zookeeper.ClientCnxn: Session establishment complete on server
I am stuck on connecting to hbase 1.0.3 via simple java client. The program hangs at: [main] zookeeper.ZooKeeper: Initiating client connection, connectString= 127.0.0.1:2181 sessionTimeout=9 watcher=hconnection-0x1e67b8720x0, quorum=127.0.0.1:2181, baseZNode=/hbaseenter code here [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x153d8383c530008, negotiated timeout = 4 The code is very simple and standard: public static void main(String args[]) throws IOException{ // Instantiating Configuration class Configuration config = HBaseConfiguration.create(); Connection connection = ConnectionFactory.createConnection(config); // Instantiating Table class Table table = connection.getTable(TableName.valueOf(HBaseTables.APPLICATION_TRACE_INDEX)); // Instantiating the Scan class Scan scan = new Scan(); // Getting the scan result ResultScanner scanner = table.getScanner(scan); // Reading values from scan result for (Result result = scanner.next(); result != null; result = scanner.next()) { System.out.println("Found row : " + result); } //closing the scanner scanner.close(); table.close(); connection.close(); } The jars I am using are: commons-collections-3.2.1.jar commons-configuration-1.6.jar commons-lang-2.6.jar commons-logging-1.2.jar guava-12.0.1.jar hadoop-auth-2.5.1.jar hadoop-client-2.5.1.jar hadoop-common-2.5.1.jar hbase-client-1.0.3.jar hbase-common-1.0.3.jar hbase-hadoop-compat-1.0.3.jar hbase-hadoop2-compat-1.0.3.jar hbase-it-1.0.3.jar hbase-protocol-1.0.3.jar hbase-resource-bundle-1.0.3.jar hbase-rest-1.0.3.jar htrace-core-3.0.4.jar htrace-core-3.1.0-incubating.jar log4j-1.2.17.jar netty-3.2.4.Final.jar netty-all-4.0.23.Final.jar protobuf-java-2.5.0.jar slf4j-api-1.7.7.jar slf4j-log4j12-1.7.7.jar zookeeper-3.4.6.jar My hbase-site.xml is hbase.rootdir file:///path/to/data/hbase hbase.zookeeper.property.dataDir file:///path/to/data/zookeeper hbase.zookeeper.quorum 127.0.0.1 In my hosts I have this entry: 127.0.0.1 localhost.localdomain localhost Sachin-PC Also in hbase regionservers has one entry localhost I have tried many options for hbase.zookeeper.quorum like localhost, Sachin-PC, 127.0.0.1 but none have worked. Also note the jars I am using are of same version in hbase lib. I am just not able to wrap my head around as what is causing the failure to scan table for this simple code. Note the code stops at line ResultScanner scanner = table.getScanner(scan); So connection is happening but it is not getting any data. Also note I am able to run hbase and connect to it via shell and scan tables all fine. Please help! Thanks Sachin ps additional logs: DEBUG [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: Use SIMPLE authentication for service ClientService, sasl=false DEBUG [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: Connecting to Sachin-PC/127.0.0.1:55161 DEBUG [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: Use SIMPLE authentication for service ClientService, sasl=false DEBUG [hconnection-0x1e67b872-shared--pool1-t1] ipc.AbstractRpcClient: Not trying to connect to Sachin-PC/127.0.0.1:55161 this server is in the failed servers list