HBase 安装版本 HBase-0.94.22.tar.gz 单机版安装,使用自带的zookeeper 安装环境 CentOS 启动HBase 在浏览器 输入 <localhost>:60010 正常。 验证自带的zookeeper是否启动。 在另一台安装了zookeeper 的机器上 root@master:/home/conan/toolkit/zookeeper-3.4.5/bin# ./zkCli.sh -server 10.8.1.135 Connecting to 10.8.1.135 2014-08-28 10:36:25,840 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT 2014-08-28 10:36:25,855 [myid:] - INFO [main:Environment@100] - Client environment:host.name=localhost 2014-08-28 10:36:25,864 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.7.0_65 2014-08-28 10:36:25,866 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation 2014-08-28 10:36:25,869 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/java/jdk1.7.0_65/jre 2014-08-28 10:36:25,872 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/home/conan/toolkit/zookeeper-3.4.5/bin/../build/classes:/home/conan/toolkit/zookeeper-3.4.5/bin/../build/lib/*.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../lib/slf4j-api-1.6.1.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../lib/netty-3.2.2.Final.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../lib/log4j-1.2.15.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../lib/jline-0.9.94.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../zookeeper-3.4.5.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../src/java/lib/*.jar:/home/conan/toolkit/zookeeper-3.4.5/bin/../conf:.:/usr/java/jdk1.7.0_65/lib:/usr/java/jdk1.7.0_65/jre/lib: 2014-08-28 10:36:25,875 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 2014-08-28 10:36:25,877 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp 2014-08-28 10:36:25,880 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=<NA> 2014-08-28 10:36:25,882 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux 2014-08-28 10:36:25,884 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64 2014-08-28 10:36:25,889 [myid:] - INFO [main:Environment@100] - Client environment:os.version=3.11.0-12-generic 2014-08-28 10:36:25,892 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root 2014-08-28 10:36:25,896 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root 2014-08-28 10:36:25,907 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/home/conan/toolkit/zookeeper-3.4.5/bin 2014-08-28 10:36:25,944 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=10.8.1.135 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@3b96c67a Welcome to ZooKeeper! 2014-08-28 10:36:25,992 [myid:] - INFO [main-SendThread(10.8.1.135:2181):ClientCnxn$SendThread@966] - Opening socket connection to server 10.8.1.135/10.8.1.135:2181. Will not attempt to authenticate using SASL (unknown error) 2014-08-28 10:36:26,007 [myid:] - INFO [main-SendThread(10.8.1.135:2181):ClientCnxn$SendThread@849] - Socket connection established to 10.8.1.135/10.8.1.135:2181, initiating session JLine support is enabled 2014-08-28 10:36:26,042 [myid:] - INFO [main-SendThread(10.8.1.135:2181):ClientCnxn$SendThread@1207] - Session establishment complete on server 10.8.1.135/10.8.1.135:2181, sessionid = 0x1481bd5fed10006, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: 10.8.1.135(CONNECTED) 0] 说明自带的zookeeper也是启动的。 现在在windows下用ecilpse写了一个客户端。 public class HBase_c2java { private static Configuration conf = null; /** * 初始化配置 */ static { conf = HBaseConfiguration.create(); conf.set("hbase.zookeeper.property.clientPort", "2181"); conf.set("hbase.zookeeper.quorum", "10.8.1.135"); conf.set("hbase.master", "10.8.1.135:60010"); } 运行的时候连接不上zookeeper 14/08/28 10:30:31 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=10.8.1.135:2181 sessionTimeout=180000 watcher=hconnection 14/08/28 10:30:31 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 5272@2013-20140312XP 14/08/28 10:30:41 INFO zookeeper.ClientCnxn: Opening socket connection to server 10.8.1.135/10.8.1.135:2181. Will not attempt to authenticate using SASL (unknown error) 14/08/28 10:30:41 INFO zookeeper.ClientCnxn: Socket connection established to 10.8.1.135/10.8.1.135:2181, initiating session 14/08/28 10:30:41 INFO zookeeper.ClientCnxn: Session establishment complete on server 10.8.1.135/10.8.1.135:2181, sessionid = 0x1481bd5fed10005, negotiated timeout = 40000 14/08/28 10:30:43 INFO client.HConnectionManager$HConnectionImplementation: getMaster attempt 0 of 14 failed; retrying after sleep of 1004 java.net.UnknownHostException: unknown host: master at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.<init>(HBaseClient.java:277) at org.apache.hadoop.hbase.ipc.HBaseClient.createConnection(HBaseClient.java:256) at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1133) at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:993) at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:87) at com.sun.proxy.$Proxy3.getProtocolVersion(Unknown Source) at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:141) at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:813) at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127) at test.HBase_c2java.creatTable(HBase_c2java.java:45) at test.HBase_c2java.main(HBase_c2java.java:144) 还有就在这个配置说是可以通过将 hbase-site.xml文件通过 add external JARS添加到classpath。但是我这样做了貌似没有读取到配置! |
|
#1 |
问题已解决。
在winodws下的 C:\Windows\System32\drivers\etc\hosts文件中 添加服务器端host与ip的映射关系 如: 10.8.1.135 master |
#2 |
|
#310分 |
啊,怎么弄的,能说详细点吗,还有你是在什么系统上执行的!
|
#4 |
回复3楼: 什么意思,。HBase服务器在 Ubuntu上啊。用eclipse写的客户端。去建表,,等一些操作。 |
#510分 |
啊,在Windows系统上有没有什么区别,我还是一直有这个报错
|
#6 |
回复5楼: 你的服务器也在windows上吗? 首先你要保证的你的服务器启动成功! 在就是在客户端 要在 hosts这个文件下加上服务器的 主机名与ip的映射关系。 |
#7 |
我本地就是服务器,对hbase还没什么概念,只是想先在自己机子上尝试一下,大师求教啊!
|
#8 |
遇到了类似的问题!刚安装好hbase,按照zookeeper》Hadoop》hbase的顺序开启的,开启前两个软件时jps显示都运行正常,可是开启hbase时显示:slave2:regionserver running as process 3491. slave1:regionserver running as process 3566.
查看日志显示: 不知道到底是什么问题啊!?而且网页60010也打不开,显示无法连接。 求解!求帮助,弄了好几天了也没有搜到解决办法… |
#9 |
回复8楼:
既然你配置了外部zookeeper就应该设置Hbase使用外部zookeeper来管理,因为hbase默认带了一个zookeeper。所以日志提示,让你先关闭独立的zookeeper在开启hbase。
|