imbajin commented on code in PR #3041: URL: https://github.com/apache/hugegraph/pull/3041#discussion_r3328397596
########## docker/hbase/README.md: ########## @@ -1,422 +1,293 @@ -# HBase Backend Testing with Docker +# HugeGraph + HBase Backend -This guide explains how to start HBase locally with Docker, verify it is working, and validate HugeGraph API operations. +This guide covers running HugeGraph with HBase backend. -> **All commands in this guide should be run from the repository root** unless otherwise noted. -> **Security note**: The HBase Docker build enforces SHA512 verification by default and fails when checksum download/parsing/validation fails. Only use `--build-arg ALLOW_UNVERIFIED_DOWNLOAD=true` for trusted test environments with restricted networks. +> All commands below run from the repository root (this project folder). ---- - -## Quick Start - -### 0. (Optional) Build the HBase Docker Image -```bash -docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase -``` - -### 1. Start HBase with Docker +Use this once at the start of your terminal session: ```bash -docker compose -f docker/hbase/docker-compose.hbase.yml up -d +ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" +cd "$ROOT_DIR" ``` -### 2. Wait for HBase to be Ready (~2 minutes) - -```bash -# Check ZooKeeper connectivity -nc -z localhost 2181 && echo "Ready" || echo "Not ready" +--- -# Or watch the logs -docker compose -f docker/hbase/docker-compose.hbase.yml logs -``` +## Quick Start Paths (Choose One) -### 3. (Optional) Clean Up Leftover HBase Tables +<details> +<summary><b>Option 1: Standalone HugeGraph (using start-hugegraph.sh)</b></summary> -For reruns, drop any leftover HugeGraph tables after the container is up: +Prerequisite: build local artifact first. ```bash -docker exec hg-hbase-test bash -c ' - for t in $(echo "list" | hbase shell -n 2>/dev/null | grep "^default_hugegraph"); do - echo "disable '"'"'$t'"'"'; drop '"'"'$t'"'"'" - done | hbase shell -' +mvn clean package -DskipTests ``` -Verify tables are gone before proceeding: - ```bash -docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n" -# Expected: TABLE (empty), 0 row(s) -``` - - -### 4. Configure and Init the HugeGraph Server (required for API tests) +cd "$ROOT_DIR" -> This step is only needed for HugeGraph API sanity checks. - -> **Prerequisite**: Run `mvn clean package -DskipTests` from the repository root to generate the distribution. This creates an `apache-hugegraph-<version>/` directory with all necessary binaries and configs. - -Set backend to HBase in the server config: +# 1) Start HBase +docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml down -v +docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase +docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml up -d Review Comment: ‼️ **Fix standalone HBase advertised host** Option 1 configures the host-side HugeGraph runtime with `hbase.hosts=localhost`, but this startup command leaves the HBase container advertising the default hostname `hbase` through the new `entrypoint.sh` rewrite. A host process can reach ZooKeeper on `localhost:2181`, then HBase redirects it to `hbase:16000/16020`, which normally is only resolvable inside the Docker network. Please override the standalone path to advertise host-reachable names, for example `HBASE_MASTER_HOSTNAME=localhost HBASE_REGIONSERVER_HOSTNAME=localhost docker compose ... up -d`, or document the required host mapping so this path works out of the box. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
