title: Hadoop and hbase java client.. issues with HbaseRPC
body: <p>I am trying to insert the data into hbase.I am running java program from remote machine. I have mentioned the code below.</p>
  
  <pre><code>try {
      Configuration conf = HBaseConfiguration.create();
      conf.clear();
      conf.set("hbase.zookeeper.quorum", "&lt;HOST_IP&gt;:2181");
      conf.set("hbase.zookeeper.property.clientPort", "2181");
      conf.set("hbase.zookeeper.dns.nameserver", "&lt;HOST_IP&gt;");
      conf.set("hbase.regionserver.port","60020");
      conf.set("hbase.master", "&lt;HOST_IP&gt;:9000");
      HTable table = new HTable(conf, "test");
      Put put = new Put(Bytes.toBytes("row5"));
      put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"),
      Bytes.toBytes("val1"));
      put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"),
      Bytes.toBytes("val2"));
      table.put(put);
  } catch (MasterNotRunningException e) { 
      e.printStackTrace(); 
  } catch (ZooKeeperConnectionException e) { 
      e.printStackTrace(); 
  } catch (TableNotFoundException e) { 
      e.printStackTrace(); 
  } catch (IOException e) { 
      e.printStackTrace();
  }
  </code></pre>
  
  <p>I am getting the following error</p>
  
  <pre><code>INFO ipc.HbaseRPC: Server at localhost/127.0.0.1:60020 could not be reached after 1 tries, giving up.
  org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1
      at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:355)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:1176)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:1195)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:898)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:797)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.relocateRegion(HConnectionManager.java:772)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:1002)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:801)
      at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:766)
      at org.apache.hadoop.hbase.client.HTable.&lt;init&gt;(HTable.java:189)
      at org.apache.hadoop.hbase.client.HTable.&lt;init&gt;(HTable.java:163)
      at com.tcs.hbase.HbaseSample.insertData(HbaseSample.java:30)
      at com.tcs.hbase.HbaseSample.main(HbaseSample.java:82)
  Caused by: java.net.ConnectException: Connection refused: no further information
      at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
      at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
      at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
      at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:406)
      at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328)
      at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:883)
      at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750)
      at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
      at $Proxy4.getProtocolVersion(Unknown Source)
      at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419)
      at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393)
      at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444)
      at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:349)
      ... 12 more
  </code></pre>
  
  <p>When i run this same code in the machine where hbase is installed its workin fine.. from the logs it is clear the rpc is resolving to localhost ip. i wanted to know how to configure the rpc ip to the ip of the machine where hbase is installed.</p>