1. 程式人生 > >【HBase-1.2.0】1000-HBase1.2.0 的安裝

【HBase-1.2.0】1000-HBase1.2.0 的安裝

JDK版本和HBASE對應關係
HBase Version JDK 6 JDK 7 JDK 8
2 Not Supported Not Supported yes
1.3 Not Supported yes yes
1.2 Not Supported yes yes
1.1 Not Supported yes Running with JDK 8 will work but is not well tested.
1 Not Supported yes Running with JDK 8 will work but is not well tested.
0.98 yes yes Running with JDK 8 works but is not well tested. Building with JDK 8 would require removal of the deprecated remove() method of thePoolMap class and is under consideration. See HBASE-7608 for more information about JDK 8 support.
0.94 yes yes N/A

Hadoop和HBASE對應關係
HBase-0.94.x HBase-0.98.x
 (Support for Hadoop 1.1+ is eprecated.)
HBase-1.0.x (Hadoop 1.x is NOT supported) HBase-1.1.x HBase-1.2.x HBase-1.3.x
Hadoop-1.0.x X X X X X X
Hadoop-1.1.x S NT X X X X
Hadoop-0.23.x S X X X X X
Hadoop-2.0.x-alpha NT X X X X X
Hadoop-2.1.0-beta NT X X X X X
Hadoop-2.2.0 NT S NT NT X X
Hadoop-2.3.x NT S NT NT X X
Hadoop-2.4.x NT S S S S S
Hadoop-2.5.x NT S S S S S
Hadoop-2.6.0 X X X X X X
Hadoop-2.6.1+ NT NT NT NT S S
Hadoop-2.7.0 X X X X X X
Hadoop-2.7.1+ NT NT NT NT S S
Hadoop version support matrix
"S" = supported
"X" = not supported
"NT" = Not tested

我們這裡選用的軟體版本如下 Hadoop2.7.1 Hbase 1.2.0 jdk 1.7 
1.上傳HBase安裝包 2.解壓 hbase-1.2.0-bin.tar.gz 配置環境變數 vi .basrrc HBASE_HOME=/home/hadoop/siz/local/hbase-1.2.0 並新增到path變數中 3.配置hbase叢集,要修改3個檔案(首先zk叢集已經安裝好了) 注意:由於hbase最終資料存放到hdfs,故需要要把hadoop的hdfs-site.xml和core-site.xml 放到hbase/conf下 3.1在master 上修改hbase-env.sh export JAVA_HOME=/home/hadoop/siz/local/jdk1.7.0_79 //告訴hbase使用外部的zk export HBASE_MANAGES_ZK=false # The maximum amount of heap to use. Default is left to JVM default. export HBASE_HEAPSIZE=8G 3.2vim hbase-site.xml
<configuration>
<property>
        <name>hbase.rootdir</name>
        <value>hdfs://10.8.1.8:9000/hbase</value>
</property>
<property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
</property>
<property>
        <name>hbase.zookeeper.quorum</name>
        <value>10.8.1.120:2181,10.8.1.130:2181,10.8.1.140:2181</value>
</property>
<property>
    <name>hbase.master.port</name>
    <value>16000</value>
</property>
<property>
    <name>hbase.master.info.port</name>
    <value>16010</value>
</property>
</configuration>
說明:這裡我們可以設定hbase.master.info.port和hbase.master.port   這裡和0.98 版本不同,需要特別注意
關於hbase-site.xml 配置詳見 :http://hbase.apache.org/book.html#quickstart_fully_distributed 3.3 指定機器為regionserver,不單獨指定master。其中:在哪個機器上啟動,哪臺就是master,在regionservers檔案說明要啟動的HRegionServer vim regionservers
10.8.1.8
10.8.1.9
10.8.1.10
3.4 在$HBASE_HOME/lib 下替換Hadoop版本和Zookeeper對應的版本 (1)rm -rf $HBASE_HOME/lib/hadoop*.jar
find /home/hadoop/siz/local/hadoop-2.7.1/share/ -name "hadoop*jar"| xargs -i cp {} $HBASE_HOME/lib
這裡可以刪除hadoop中test/sources 相關的包(可以選擇) (2)替換zookeeper的包,我們這裡採用3.4.6 (3) hbase1.2.0 依賴 amazonaws包下的兩個檔案,故需要把下面兩個檔案上傳至$HBASE_HOME/lib 目錄下,否則會出現下面的錯誤 依賴的兩個檔案: aws-java-sdk-core-1.10.77.jar aws-java-sdk-s3-1.11.34.jar 不新增問題出現ClassNotFoundException: Caused by: java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.s3.AmazonS3 說明: 這裡和0.98 版本不同,需要特別注意
3.4拷貝hbase到其他節點 4.將配置好的HBase拷貝到每一個節點並同步時間。 5.啟動所有的hbase      分別啟動zk           ./zkServer.sh start      啟動hdfs叢集           start-dfs.sh      啟動hbase,在主節點上執行:           start-hbase.sh 6.通過瀏覽器訪問hbase1.2.0版本管理頁面         10.8.1.8:16010(於0.98 版本不同) 7.為保證叢集的可靠性,要啟動多個HMaster(可選)         hbase-daemon.sh start master