HBase的安裝部署
部署HBase必須配置先部署好 JDK返劲、Hadoop、Zookeeper疗垛,配置3臺(tái)服務(wù)器就要加挠阁,啟動(dòng)只需要啟動(dòng)028即可
1宾肺、配置環(huán)境變量
[bxwl@snode028 hbase-2.4.11]$ cat /etc/profile.d/bxwl.sh
export JAVA_HOME=/opt/jdk1.8.0_291
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export HADOOP_HOME=/opt/hadoop-3.3.2
#export HADOOP_CONF_DIR=/opt/hadoop-3.3.2/etc
export HBASE_HOME=/opt/hbase-2.4.11
export HBASE_CONF_DIR=${HBASE_HOME}/conf
export PATH=${JAVA_HOME}/bin:${HADOOP_HOME}/bin:${HBASE_HOME}/bin:$PATH
2、配置hbase-env.sh
HBase不使用自帶的Zookeeper侵俗。這里其實(shí)都是配置環(huán)境變量锨用,在上一步其實(shí)也可以完成“ィ可以試試
[bxwl@snode028 hbase-2.4.11]$ cd conf
[bxwl@snode028 conf]$ vim hbase-env.sh
export HBASE_MANAGES_ZK=false
3增拥、配置hbase-site.xml
[bxwl@snode028 conf]$ vim hbase-site.xml
<configuration>
? <!--The following properties are set for running HBase as a single process on a
? ? developer workstation. With this configuration, HBase is running in
? ? "stand-alone" mode and without a distributed file system. In this mode, and
? ? without further configuration, HBase and ZooKeeper data are stored on the
? ? local filesystem, in a path under the value configured for `hbase.tmp.dir`.
? ? This value is overridden from its default value of `/tmp` because many
? ? systems clean `/tmp` on a regular basis. Instead, it points to a path within
? ? this HBase installation directory.
? ? Running against the `LocalFileSystem`, as opposed to a distributed
? ? filesystem, runs the risk of data integrity issues and data loss. Normally
? ? HBase will refuse to run in such an environment. Setting
? ? `hbase.unsafe.stream.capability.enforce` to `false` overrides this behavior,
? ? permitting operation. This configuration is for the developer workstation
? ? only and __should not be used in production!__
? ? See also https://hbase.apache.org/book.html#standalone_dist-->
? <property>
? ? <name>hbase.cluster.distributed</name>
? ? <value>true</value>
? </property>
? <property>
? ? <name>hbase.tmp.dir</name>
? ? <value>./tmp</value>
? </property>
? <property>
? ? <name>hbase.unsafe.stream.capability.enforce</name>
? ? <value>false</value>
? </property>
? <property>
? ? <name>hbase.rootdir</name>
? ? <value>hdfs://snode028:8020/hbase</value>
? </property>
? <property>
? ? <name>hbase.zookeeper.quorum</name>
? ? <value>snode028,snode029,snode030</value>
? </property>
? <property>
? ? <name>zookeeper.znode.parent</name>
? ? <value>/hbase</value>
? </property>
? <property>
? ? <name>hbase.zookeeper.property.dataDir</name>
? ? <value>/opt/apache-zookeeper-3.8.0-bin/zkData</value>
? </property>
? <property>
? ? <name>hbase.wal.provider</name>
? ? <value>filesystem</value>
? </property>
</configuration>
4、配置regionservers
[bxwl@snode028 conf]$ vim regionservers
snode028
snode029
snode030
5、軟連接 hadoop 配置文件到 HBase
[bxwl@snode028 conf]$ ln -s /opt/hadoop-3.3.2/etc/hadoop/core-site.xml /opt/hbase-2.4.11/conf/core-site.xml
[bxwl@snode028 conf]$ ln -s /opt/hadoop-3.3.2/etc/hadoop/hdfs-site.xml /opt/hbase-2.4.11/conf/hdfs-site.xml
6跪者、啟動(dòng)關(guān)閉HBase
// 啟動(dòng)
[bxwl@snode028 hbase-2.4.11]$ bin/start-hbase.sh
[bxwl@snode028 hbase-2.4.11]$ ~/bin/jpsall
---------- snode028 jps ------------
7809 NameNode
10468 HMaster
10680 HRegionServer
7961 DataNode
8234 NodeManager
11131 Jps
6029 QuorumPeerMain
---------- snode029 jps ------------
6784 SecondaryNameNode
6866 NodeManager
6675 DataNode
5750 QuorumPeerMain
10877 HRegionServer
11166 Jps
---------- snode030 jps ------------
9160 HRegionServer
5595 QuorumPeerMain
9467 Jps
7276 NodeManager
6973 DataNode
7150 ResourceManager
[bxwl@snode028 hbase-2.4.11]$
// 關(guān)閉
[bxwl@snode028 hbase-2.4.11]$ bin/stop-hbase.sh
瀏覽器直接訪問(wèn):http://ip:16010