HBase與Zookeeper在CentOS上的協同工作主要涉及安裝、配置以及啟動服務,并理解它們在HBase集群中的作用和相互關系。以下是詳細步驟:
chmod +x zookeeper-3.4.5.tar.gz
tar -xzvf zookeeper-3.4.5.tar.gz
/opt/bigdata/zookeeper-3.4.5
。/etc/profile
文件,添加以下內容:export ZOOKEEPER_HOME=/opt/bigdata/zookeeper-3.4.5
export PATH=$ZOOKEEPER_HOME/bin:$PATH
source /etc/profile
cd /opt/bigdata/zookeeper-3.4.5/bin
./zkServer.sh start
./zkServer.sh status
chmod +x hbase-1.2.6-bin.tar.gz
tar -xzvf hbase-1.2.6-bin.tar.gz
/opt/bigdata/hbase-1.2.6
。/etc/profile
文件,添加以下內容:export HBASE_HOME=/opt/bigdata/hbase-1.2.6
export PATH=$HBASE_HOME/bin:$PATH
hbase-env.sh
:編輯 /opt/bigdata/hbase-1.2.6/conf/hbase-env.sh
文件,設置 JAVA_HOME
:export JAVA_HOME=/usr/local/src/software/jdk1.8
export HBASE_MANAGES_ZK=false
hbase-site.xml
:編輯 /opt/bigdata/hbase-1.2.6/conf/hbase-site.xml
文件,添加以下內容:<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://namenode:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.master.port</name>
<value>16000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>zookeeper1,zookeeper2,zookeeper3</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/src/software/zookeeper/mydata</value>
</property>
</configuration>
regionservers
文件:編輯 /opt/bigdata/hbase-1.2.6/conf/regionservers
文件,去掉默認的 localhost
,加入如下內容:hadoop001
hadoop002
hadoop003
scp
命令將HBase文件夾復制到其他節點。/etc/profile
文件,添加HBase相關環境變量,然后重新載入配置文件:source /etc/profile
cd /opt/bigdata/hbase-1.2.6/bin
./start-hbase.sh
hbase shell status 'simple'
./zkServer.sh status
通過以上步驟,你可以在CentOS上成功集成HBase與Zookeeper,并理解它們在HBase集群中的作用和相互關系。請根據實際需求調整配置和版本號。