机器环境是:zookeeper 3.4.12 和hbase 2.0.1。
一、 zookeeper安装
1. 解压
tar zxf zookeeper-3.4.12.tar.gz -C /opt/modules/
2. 修改配置
cp conf/zoo_sample.cfg zoo.cfg
mkdir zkData
vi zoo.cfg
dataDir=/opt/modules/zookeeper-3.4.12/zkData
3. 启动zookeeper(单节点)
bin/zkServer.sh start
bin/zkServer.sh status
二、HBase安装部署
1. 启动zookeeper
2. 解压缩hbase,修改配置
vi hbase-env.sh
export JAVA_HOME=/opt/modules/jdk1.8.0_172
export HBASE_MANAGES_ZK=false
3. 修改hbase-site.xml
<property>
<name>hbase.rootdir</name>
<value>hdfs://lee:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>lee</value>
</property>
4. 修改regionservers
vi regionservers
lee
5. 替换lib目录下hadoop和zookeeper包
find share/hadoop/ -name "hadoop*jar" | xargs -i cp {} /opt/modules/hbase-2.0.1/lib/
cp zookeeper-3.4.12.jar /opt/modules/hbase-2.0.1/lib/
6. 启动
启动hdfs
sbin/start-dfs.sh
启动zookeeper
bin/zkServer.sh start
启动master和regionserver
bin/hbase-daemon.sh start master
bin/hbase-daemon.sh start regionserver
|
|