0

在过去的两天里,我几乎尝试了所有方法来让远程机器与 HBase 连接。以下是我收到的错误以及我的所有配置。我正在通过笔记本电脑连接到我的虚拟机。虚拟机是ubuntu,笔记本是win7

任何帮助将不胜感激。

/etc/hosts

127.0.0.1       localhost
192.168.1.139   ubuntuvm-1204-64

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/usr/local/hbase/conf/hbase-site.xml

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>file:///usr/local/hadoop-apps/hbase/</value>
</property>
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
</property>
<property>
    <name>hbase.zookeeper.quorum</name>
    <value>192.168.1.139</value>
</property>
<property>
    <name>hbase.master.info.port</name>
    <value>60010</value>
</property>
<property>
  <name>hbase.master.info.bindAddress</name>
  <value>192.168.1.139</value>
</property>
</configuration>

纳米 /usr/local/hbase/conf/regionservers

192.168.1.139

Java 代码

Configuration config = HBaseConfiguration.create();

config.set("hbase.master", "192.168.1.139:60010");
config.set("hbase.zookeeper.quorum", "192.168.1.139");
config.set("hbase.zookeeper.property.clientPort","2181");

HTable table;
try 
{
    table = new HTable(config, "t");
    Put p = new Put(Bytes.toBytes("r1"));
    p.add(Bytes.toBytes("cf"), Bytes.toBytes("someQualifier"),
    Bytes.toBytes("Some Value"));
    table.put(p);
.......

Hbase 外壳

Version 0.94.3, r1408904, Wed Nov 14 19:55:11 UTC 2012

hbase(main):001:0> list
TABLE                                                                          
t                                                                              
1 row(s) in 0.8950 seconds

hbase(main):002:0> 

错误

13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:host.name=WABELHL.org
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_09
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.home=C:\Program Files\Java\jre7
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.class.path=C:\Users\laptop\workspace\textXML\bin;C:\Users\laptop\Downloads\hbase-0.94.3\lib\commons-configuration-1.6.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\commons-lang-2.5.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\commons-logging-1.1.1.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\hadoop-core-1.0.4.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\log4j-1.2.16.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\protobuf-java-2.4.0a.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\slf4j-api-1.4.3.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\slf4j-log4j12-1.4.3.jar;C:\Users\laptop\Downloads\hbase-0.94.3\lib\zookeeper-3.4.3.jar;C:\Users\laptop\Downloads\hbase-0.94.3\hbase-0.94.3.jar
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.library.path=C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\app\laptop...
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=C:\Users\laptop\AppData\Local\Temp\
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows 7
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:os.version=6.1
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:user.name=laptop
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:user.home=C:\Users\laptop
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Client environment:user.dir=C:\Users\laptop\workspace\textXML
13/01/15 21:53:08 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.1.139:2181 sessionTimeout=180000 watcher=hconnection
13/01/15 21:53:08 INFO zookeeper.ClientCnxn: Opening socket connection to server /192.168.1.139:2181
13/01/15 21:53:08 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 7148@WABELHLP0532619
13/01/15 21:53:13 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
13/01/15 21:53:13 INFO zookeeper.ClientCnxn: Socket connection established to 192.168.1.139/192.168.1.139:2181, initiating session
13/01/15 21:53:13 INFO zookeeper.ClientCnxn: Session establishment complete on server 192.168.1.139/192.168.1.139:2181, sessionid = 0x13c41eaab9b0005, negotiated timeout = 180000
org.apache.hadoop.hbase.client.NoServerForRegionException: Unable to find region for t,,99999999999999 after 10 tries.
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:955)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:860)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:962)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:864)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:821)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:234)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:174)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:133)
at runTest.main(runTest.java:46)
4

1 回答 1

1

我对本地机器进行了一次更改。我将 VM ip 和名称添加到 drivers\etc\host 文件中,这似乎解决了问题。

于 2013-01-24T22:02:01.907 回答