HBase 安装版本 HBase-0.94.22.tar.gz 单机版安装,使用自带的zookeeper
安装环境 CentOS
启动HBase
在浏览器 输入 <localhost>:60010 正常。
验证自带的zookeeper能否启动。
在另一台安装了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。但是本人这样做了貌似没有读取到配置!
解决方案
10
啊,怎么弄的,能说详细点吗,还有你是在什么系统上执行的!
10
啊,在Windows系统上有没有什么区别,本人还是一直有这个报错