Hbase安裝詳情
1.首先保證 Zookeeper 叢集的正常部署,並啟動之:
[[email protected]]$ zkServer.sh start
2.Hadoop 叢集的正常部署並啟動
[[email protected]]$start-dfs.sh
[[email protected]] start-yarn.sh
3.解壓 HBase 到指定目錄
tar -zxf ~/softwares/installations/hbase-1.3.1-bin.tar.gz -C ~/modules/
4.HBase 的配置檔案
5.需要修改HBase 對應的配置檔案。
hbase-env.sh
export JAVA_HOME=/home/admin/modules/jdk1.8.0_121
export HBASE_MANAGES_ZK=false
6.hbase-site.xml 修改內容:
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://linux01:8020/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <!-- 0.98 後的新變動,之前版本沒有.port,預設埠為 60000 --> <property> <name>hbase.master.port</name> <value>16000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>linux01:2181,linux02:2181,linux03:2181</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/admin/modules/zookeeper-3.4.5/zkData</value> </property> </configuration>
更改regionservers配置檔案
linux01 <!--這裡是自己叢集中的regionserver地址-->
linux02
linux03
7.HBase 需要依賴的 Jar 包
由於 HBase 需要依賴Hadoop,所以替換 HBase 的 lib 目錄下的 jar 包,以解決相容問題:
[[email protected]] rm -rf /home/admin/modules/hbase-1.3.1/lib/hadoop-*
[[email protected]]$ rm -rf /home/admin/modules/hbase-1.3.1/lib/zookeeper-3.4.6.jar
8.拷貝新 jar,涉及的 jar 有:
hadoop-annotations-2.7.2.jar
hadoop-auth-2.7.2.jar
hadoop-client-2.7.2.jar
hadoop-common-2.7.2.jar
hadoop-hdfs-2.7.2.jar
hadoop-mapreduce-client-app-2.7.2.jar
hadoop-mapreduce-client-common-2.7.2.jar
hadoop-mapreduce-client-core-2.7.2.jar
hadoop-mapreduce-client-hs-2.7.2.jar
hadoop-mapreduce-client-hs-plugins-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2-tests.jar
hadoop-mapreduce-client-shuffle-2.7.2.jar
hadoop-yarn-api-2.7.2.jar
hadoop-yarn-applications-distributedshell-2.7.2.jar
hadoop-yarn-applications-unmanaged-am-launcher-2.7.2.jar
hadoop-yarn-client-2.7.2.jar
hadoop-yarn-common-2.7.2.jar
hadoop-yarn-server-applicationhistoryservice-2.7.2.jar
hadoop-yarn-server-common-2.7.2.jar
hadoop-yarn-server-nodemanager-2.7.2.jar
hadoop-yarn-server-resourcemanager-2.7.2.jar
hadoop-yarn-server-tests-2.7.2.jar
hadoop-yarn-server-web-proxy-2.7.2.jar
zookeeper-3.4.5.jar
特別提示:這些 jar 包的對應版本應替換成你目前使用的 hadoop 版本,具體情況具體分析
查詢 jar 包舉例:
[[email protected]]$ find /home/admin/modules/hadoop-2.7.2/ -name hadoop-annotations*
然後將找到的 jar 包複製到 HBase 的 lib 目錄下即可。
9.HBase 軟連線 Hadoop 配置(或者直接去hadoop的安裝目錄拷貝這兩個檔案)
[[email protected]]$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/core-site.xml ~/modules/hbase-1.3.1/conf/core-site.xml
[[email protected]]$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/hdfs-site.xml
~/modules/hbase-1.3.1/conf/hdfs-site.xml
10.HBase 遠端 scp 到其他叢集
[[email protected]]$ scp -r /home/admin/modules/hbase-1.3.1/ linux02:/home/admin/modules/
[[email protected]]$ scp -r /home/admin/modules/hbase-1.3.1/ linux03:/home/admin/modules/