| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # 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. |
| # |
| # HBase standalone for local HugeGraph HBase backend development & testing. |
| # |
| # Usage: |
| # Start: docker compose -f docker/hbase/docker-compose.hbase.yml up -d |
| # Standalone HugeGraph on host: |
| # HBASE_MASTER_HOSTNAME=localhost HBASE_REGIONSERVER_HOSTNAME=localhost \ |
| # docker compose -f docker/hbase/docker-compose.hbase.yml up -d |
| # Wait: until docker exec hg-hbase-test nc -z localhost 2181; do sleep 2; done |
| # Verify: nc -z localhost 2181 && echo "ZooKeeper OK" |
| # Test: mvn test -pl hugegraph-server/hugegraph-test -am -P core-test,hbase |
| # Stop: docker compose -f docker/hbase/docker-compose.hbase.yml down -v |
| # |
| # HugeGraph test config (hugegraph-server/hugegraph-test/src/main/resources/hugegraph.properties): |
| # hbase.hosts=localhost |
| # hbase.port=2181 |
| # hbase.znode_parent=/hbase |
| # |
| # Ports exposed to host: |
| # 2181 - ZooKeeper (HBase embedded) |
| # 16000 - HBase Master RPC |
| # 16010 - HBase Master Web UI -> http://localhost:16010 |
| # 16020 - HBase RegionServer RPC |
| # 16030 - HBase RegionServer Web UI -> http://localhost:16030 |
| |
| services: |
| hbase: |
| build: |
| context: . |
| dockerfile: Dockerfile |
| args: |
| HBASE_VERSION: "2.6.5" |
| # Optional overrides for flaky networks/corporate mirrors. |
| HBASE_PRIMARY_URL: "${HBASE_PRIMARY_URL:-https://downloads.apache.org/hbase/2.6.5/hbase-2.6.5-bin.tar.gz}" |
| HBASE_FALLBACK_URL: "${HBASE_FALLBACK_URL:-https://archive.apache.org/dist/hbase/2.6.5/hbase-2.6.5-bin.tar.gz}" |
| image: hugegraph/hbase:2.6.5 |
| container_name: hg-hbase-test |
| hostname: "${HBASE_HOSTNAME:-hbase}" |
| environment: |
| HBASE_HOSTNAME: "${HBASE_HOSTNAME:-hbase}" |
| HBASE_MASTER_HOSTNAME: "${HBASE_MASTER_HOSTNAME:-}" |
| HBASE_REGIONSERVER_HOSTNAME: "${HBASE_REGIONSERVER_HOSTNAME:-}" |
| ports: |
| - "2181:2181" # ZooKeeper (matches hbase.port in hugegraph.properties) |
| - "16000:16000" # Master RPC |
| - "16010:16010" # Master Web UI -> http://localhost:16010 |
| - "16020:16020" # RegionServer RPC |
| - "16030:16030" # RegionServer Web UI -> http://localhost:16030 |
| volumes: |
| - hbase-data:/tmp/hbase |
| - hbase-zk-data:/tmp/zookeeper |
| healthcheck: |
| # nc -z confirms ZooKeeper is accepting connections |
| test: ["CMD", "nc", "-z", "localhost", "2181"] |
| interval: 10s |
| timeout: 10s |
| retries: 15 |
| start_period: 90s |
| restart: unless-stopped |
| |
| volumes: |
| hbase-data: |
| hbase-zk-data: |
| |
| |