1.首先保证 Zookeeper 集群的正常部署,并启动之:
[hadoop@mini6]$ zkServer.sh start
2.Hadoop 集群的正常部署并启动
[hadoop@mini6]$start-dfs.sh
[hadoop@mini6] 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 包,以解决兼容问题:
[hadoop@mini6] rm -rf /home/admin/modules/hbase-1.3.1/lib/hadoop-*
[hadoop@mini6]$ 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 包举例:
[hadoop@mini6]$ find /home/admin/modules/hadoop-2.7.2/ -name hadoop-annotations*
然后将找到的 jar 包复制到 HBase 的 lib 目录下即可。
9.HBase 软连接 Hadoop 配置(或者直接去hadoop的安装目录拷贝这两个文件)
[hadoop@mini6]$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/core-site.xml ~/modules/hbase-1.3.1/conf/core-site.xml
[hadoop@mini6]$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/hdfs-site.xml
~/modules/hbase-1.3.1/conf/hdfs-site.xml
10.HBase 远程 scp 到其他集群
[hadoop@mini6]$ scp -r /home/admin/modules/hbase-1.3.1/ linux02:/home/admin/modules/
[hadoop@mini6]$ scp -r /home/admin/modules/hbase-1.3.1/ linux03:/home/admin/modules/
|
|