搭建hbase-0.94.26集群环境

先安装hadoop1.2.1,见http://blog.csdn.net/jediael_lu/article/details/38926477

1、配置hbase-site.xml

[html] view plain copy
  1. <property>  
  2.     <name>hbase.zookeeper.quorum</name>  
  3.     <value>master,slave1,slave2</value>  
  4. </property>  
  5. <property>  
  6.     <name>hbase.rootdir</name>  
  7.     <value>hdfs://master:9000/hbase</value>  
  8. </property>  
  9. <property>  
  10.     <name>hbase.cluster.distributed</name>  
  11.     <value>true</value>  
  12. </property>  
2、配置regionservers
[plain] view plain copy
  1. slave1  
  2. slave2  
3、配置hbase-env.sh
[plain] view plain copy
  1. export JAVA_HOME=/usr/java/jdk1.7.0_51  

4、用hadoop的最新版本取代hbase的自带版本
[plain] view plain copy
  1. $ cd lib/  
  2. $ rm hadoop-core-1.0.4.jar  
  3. $ cp /opt/jediael/hadoop-1.2.1/hadoop-core-1.2.1.jar .  


5、将hbases整个目录复制到slave中。

[plain] view plain copy
  1. scp -r hbase-0.94.26/ slave1:/opt/jediael  
  2. scp -r hbase-0.94.26/ slave2:/opt/jediael  

6、启动hbase
[plain] view plain copy
  1. $ bin/start-hbase.sh  
  2. slave1: starting zookeeper, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-zookeeper-slave1.out  
  3. slave2: starting zookeeper, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-zookeeper-slave2.out  
  4. starting master, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-master-master.out  
  5. slave1: starting regionserver, logging to /opt/jediael/hbase-0.90.4/bin/../logs/hbase-jediael-regionserver-slave1.out  
  6. 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命令
[plain] view plain copy
  1. $ jps  
  2. 5620 JobTracker  
  3. 5377 NameNode  
  4. 8641 Jps  
  5. 5535 SecondaryNameNode  
  6. 5890 Bootstrap  
  7. 8476 HMaster  
  8.   
  9. $ jps  
  10. 27888 HQuorumPeer  
  11. 27977 HRegionServer  
  12. 26628 TaskTracker  
  13. 28085 Jps  
  14. 26536 DataNode  
  15.   
  16. $ jps  
  17. 27736 HQuorumPeer  
  18. 26654 DataNode  
  19. 26747 TaskTracker  
  20. 27816 HRegionServer  
  21. 27922 Jps  

(3)文件操作
[plain] view plain copy
  1.   


异常
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

你可能感兴趣的:(搭建hbase-0.94.26集群环境)