centos7 기준입니다. 백업 마스터 2대를 둔 hbase cluster를 설치하도록 하겠습니다.
hadoop, zookeeper가 설치되어있음을 가정합니다.
실행 유저:hadoop
mast01: hbase master
mast02: hbase master
mast03: hbase master
work01:regionserver
work02:regionserver
work03:regionserver
https://developer-woong.tistory.com/36
https://developer-woong.tistory.com/39
1. hbase 압축파일 다운로드 및 해제
action server: mast01
user: root
pwd: /opt/apps
cmd:
# mast01서버에서 설정 파일 수정 후 다른 서버들에게 배포 예정
wget https://archive.apache.org/dist/hbase/2.3.7/hbase-2.3.7-bin.tar.gz
tar xvfz hbase-2.3.7-bin.tar.gz
cd /opt/apps/hbase-2.3.7
2. hbase 설정파일 수정
action server: mast01
user: root
pwd: /opt/apps/hbase-2.3.7
cmd:
vi conf/hbase-env.sh
export JAVA_HOME=/opt/apps/jdk8
export HBASE_OPTS="$HBASE_OPTS -XX:+UseConcMarkSweepGC"
# 직접 설치한 주키퍼사용
export HBASE_MANAGES_ZK=false
# ssh포트 지정
export HBASE_SSH_OPTS="-p 22002"
# 로그 디렉토리 설정
export HBASE_LOG_DIR=/data01/logs/hbase
# PID 디렉토리 설정
export HBASE_PID_DIR=/opt/apps/hbase/pid
vi conf/hbase-site.xml
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://NNHA:8020/hbase</value>
</property>
<property>
<name>hbase.master</name>
<value>mast01:6000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>mast01,mast02,mast03</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/data/zookeeper</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
<property>
<name>dfs.datanode.max.xcievers</name>
<value>4096</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60000</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>
<property>
<name>hbase.regionserver.port</name>
<value>60020</value>
</property>
<property>
<name>hbase.regionserver.info.port</name>
<value>60030</value>
</property>
<property>
<name>hbase.rest.port</name>
<value>33333</value>
</property>
</configuration>
vi conf/regionservers
work01
work02
work03
vi conf/backup-masters
mast02
mast03
cd ..
3. hbase 재 압축 및 다른 서버들에게 배포
action server: mast01
user: root
pwd: /opt/apps
cmd:
tar cvfz hbase.tar.gz ./hbase-2.3.7
scp -P 22002 ./hbase.tar.gz root@mast02:/opt/apps
scp -P 22002 ./hbase.tar.gz root@mast03:/opt/apps
scp -P 22002 ./hbase.tar.gz root@work01:/opt/apps
scp -P 22002 ./hbase.tar.gz root@work02:/opt/apps
scp -P 22002 ./hbase.tar.gz root@work03:/opt/apps
4. hbase 재 배포 파일 압축 해제
action server: mast02, mast03, work01, work02, work03
user: root
pwd: -
cmd:
cd /opt/apps
tar xvfz hbase.tar.gz
5. hbase 폴더 권한 부여 및 환경변수 설정
action server: all
user: /opt/apps
pwd: -
cmd:
# hbase-env.sh에서 설정한 pid 디렉토리 생성
mkdir /opt/apps/hbase-2.3.7/pid
# hbase-env.sh에서 설정한 로그 디렉토리 생성
mkdir -p /data/hbase/log
chown -R hadoop:hadoop /opt/apps/hbase-2.3.7
chown -R hadoop:hadoop /data/hbase
vi /etc/profile.d/hbase.sh
export HBASE_HOME=/opt/apps/hbase-2.3.7
export PATH=$PATH:$HBASE_HOME/bin
source /etc/profile.d/hbase.sh
su - hadoop
cd /opt/apps/hbase-2.3.7
6. hbase 기동 및 확인
action server: mast01
user: hadoop
pwd: /opt/apps/hbase-2.3.7
cmd:
# mast01서버에서 실행
./bin/start-hbase.sh
mast01:60010 웹 UI확인