搭建hbase-0.94.26集群环境
先安装hadoop1.2.1,见http://blog.csdn.net/jediael_lu/article/details/38926477
1、配置hbase-site.xml
<property> <name>hbase.zookeeper.quorum</name> <value>master,slave1,slave2</value> </property> <property> <name>hbase.rootdir</name> <value>hdfs://master:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property>2、配置regionservers
slave1 slave23、配置hbase-env.sh
export JAVA_HOME=/usr/java/jdk1.7.0_51
4、用hadoop的最新版本取代hbase的自带版本
$ cd lib/ $ rm hadoop-core-1.0.4.jar $ cp /opt/jediael/hadoop-1.2.1/hadoop-core-1.2.1.jar .
5、将hbases整个目录复制到slave中。
scp -r hbase-0.94.26/ slave1:/opt/jediael scp -r hbase-0.94.26/ slave2:/opt/jediael
6、启动hbase
$ bin/start-hbase.sh slave1: starting zookeeper, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-zookeeper-slave1.out slave2: starting zookeeper, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-zookeeper-slave2.out starting master, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-master-master.out slave1: starting regionserver, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-regionserver-slave1.out slave2: starting regionserver, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-regionserver-slave2.out
7、验证
(1)http://master:60010/master-status
(2)jps命令
$ jps 5620 JobTracker 5377 NameNode 8641 Jps 5535 SecondaryNameNode 5890 Bootstrap 8476 HMaster $ jps 27888 HQuorumPeer 27977 HRegionServer 26628 TaskTracker 28085 Jps 26536 DataNode $ jps 27736 HQuorumPeer 26654 DataNode 26747 TaskTracker 27816 HRegionServer 27922 Jps
(3)文件操作
异常
2015-01-21 22:06:53,258 INFO org.apache.hadoop.hbase.master.ActiveMasterManager: Master=master:60000
2015-01-21 22:06:53,590 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
java.io.IOException: Call to master/10.171.29.191:9000 failed on local exception: java.io.EOFException
at org.apache.hadoop.ipc.Client.wrapException(Client.java:775)
at org.apache.hadoop.ipc.Client.call(Client.java:743)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220)
at com.sun.proxy.$Proxy5.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:359)
at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:113)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:215)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:177)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:82)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1378)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1390)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:196)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:175)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:364)
at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:81)
at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:346)
at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:282)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:501)
at org.apache.hadoop.ipc.Client$Connection.run(Client.java:446)
2015-01-21 22:06:53,599 INFO org.apache.hadoop.hbase.master.HMaster: Aborting
2015-01-21 22:06:53,599 DEBUG org.apache.hadoop.hbase.master.HMaster: Stopping service threads
2015-01-21 22:06:53,599 INFO org.apache.hadoop.ipc.HBaseServer: Stopping server on 60000
2015-01-21 22:06:53,599 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 0 on 60000: exiting
2015-01-21 22:06:53,599 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 1 on 60000: exiting
2015-01-21 22:06:53,599 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 2 on 60000: exiting
2015-01-21 22:06:53,600 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 3 on 60000: exiting
2015-01-21 22:06:53,600 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 4 on 60000: exiting
2015-01-21 22:06:53,600 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 5 on 60000: exiting
2015-01-21 22:06:53,600 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 6 on 60000: exiting
2015-01-21 22:06:53,600 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 7 on 60000: exiting
2015-01-21 22:06:53,601 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 8 on 60000: exiting
2015-01-21 22:06:53,601 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 9 on 60000: exiting
2015-01-21 22:06:53,601 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server listener on 60000
2015-01-21 22:06:53,603 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server Responder
2015-01-21 22:06:53,622 INFO org.apache.zookeeper.ZooKeeper: Session: 0x4b0cd139190000 closed
2015-01-21 22:06:53,622 INFO org.apache.hadoop.hbase.master.HMaster: HMaster main thread exiting
2015-01-21 22:06:53,623 INFO org.apache.zookeeper.ClientCnxn: EventThread shut down