「CentOS Stream 8」docker-composeで分散データベースhbaseをインストールする方法

事前確認
dockerバージョン確認
# docker –version
Docker version 20.10.5, build 55c4c88
docker-composeバージョン確認
# docker-compose –version
docker-compose version 1.28.5, build c4eb3a1f

インストール方法
1.docker-compose.ymlをダウンロード
# git clone https://github.com/big-data-europe/docker-hbase.git

Cloning into 'docker-hbase'...
remote: Enumerating objects: 146, done.
remote: Total 146 (delta 0), reused 0 (delta 0), pack-reused 146
Receiving objects: 100% (146/146), 25.81 KiB | 4.30 MiB/s, done.
Resolving deltas: 100% (84/84), done.

2.docker-compose-standalone.yml内容確認
# cd docker-hbase/
# cat docker-compose-standalone.yml

version: "3"

services:
  namenode:
    image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8
    container_name: namenode
    volumes:
      - hadoop_namenode:/hadoop/dfs/name
    environment:
      - CLUSTER_NAME=test
    env_file:
      - ./hadoop.env

  datanode:
    image: bde2020/hadoop-datanode:2.0.0-hadoop2.7.4-java8
    container_name: datanode
    volumes:
      - hadoop_datanode:/hadoop/dfs/data
    environment:
      SERVICE_PRECONDITION: "namenode:50070"
    env_file:
      - ./hadoop.env

  resourcemanager:
    image: bde2020/hadoop-resourcemanager:2.0.0-hadoop2.7.4-java8
    container_name: resourcemanager
    environment:
      SERVICE_PRECONDITION: "namenode:50070 datanode:50075"
    env_file:
      - ./hadoop.env

  nodemanager1:
    image: bde2020/hadoop-nodemanager:2.0.0-hadoop2.7.4-java8
    container_name: nodemanager
    environment:
      SERVICE_PRECONDITION: "namenode:50070 datanode:50075 resourcemanager:8088"
    env_file:
      - ./hadoop.env

  historyserver:
    image: bde2020/hadoop-historyserver:2.0.0-hadoop2.7.4-java8
    container_name: historyserver
    volumes:
      - hadoop_historyserver:/hadoop/yarn/timeline
    environment:
      SERVICE_PRECONDITION: "namenode:50070 datanode:50075 resourcemanager:8088"
    env_file:
      - ./hadoop.env

  hbase:
    image: bde2020/hbase-standalone:1.0.0-hbase1.2.6
    container_name: hbase
    volumes:
      - hbase_data:/hbase-data
      - hbase_zookeeper_data:/zookeeper-data
    ports:
      - 16000:16000
      - 16010:16010
      - 16020:16020
      - 16030:16030
      - 2888:2888
      - 3888:3888
      - 2181:2181
    environment:
      SERVICE_PRECONDITION: "namenode:50070 datanode:50075"
    env_file:
      - ./hbase-standalone.env

volumes:
  hadoop_namenode:
  hadoop_datanode:
  hadoop_historyserver:
  hbase_data:
  hbase_zookeeper_data:

3.firewallを設定
# firewall-cmd –add-port=8088/tcp –zone=public –permanent
success
# firewall-cmd –reload
success

# firewall-cmd –add-port=16010/tcp –zone=public –permanent
success
# firewall-cmd –reload
success

4.dockerを実行
# docker-compose -f docker-compose-standalone.yml up -d

Creating network "docker-hbase_default" with the default driver
Creating volume "docker-hbase_hadoop_namenode" with default driver
Creating volume "docker-hbase_hadoop_datanode" with default driver
Creating volume "docker-hbase_hadoop_historyserver" with default driver
Creating volume "docker-hbase_hbase_data" with default driver
Creating volume "docker-hbase_hbase_zookeeper_data" with default driver
略
Status: Downloaded newer image for bde2020/hbase-standalone:1.0.0-hbase1.2.6
Creating historyserver   ... done
Creating datanode        ... done
Creating resourcemanager ... done
Creating nodemanager     ... done
Creating hbase           ... done
Creating namenode        ... done

5.ブラウザでhbaseの管理画面にアクセス
http://192.168.229.129:16010/master-status

CentOS

Posted by arkgame