Copilot commented on code in PR #3041:
URL: https://github.com/apache/hugegraph/pull/3041#discussion_r3340826592
##########
docker/hbase/entrypoint.sh:
##########
@@ -17,7 +17,39 @@
#
set -e
+HBASE_HOSTNAME="${HBASE_HOSTNAME:-hbase}"
+HBASE_MASTER_HOSTNAME="${HBASE_MASTER_HOSTNAME:-${HBASE_HOSTNAME}}"
+HBASE_REGIONSERVER_HOSTNAME="${HBASE_REGIONSERVER_HOSTNAME:-${HBASE_HOSTNAME}}"
+HBASE_SITE_XML="${HBASE_HOME}/conf/hbase-site.xml"
+
+escape_sed_replacement() {
+ printf '%s' "$1" | sed -e 's/[&|]/\\&/g'
+}
Review Comment:
`escape_sed_replacement()` doesn’t escape backslashes (`\`). In sed
replacement text, backslashes can be interpreted (e.g., `\1`, `\n`) and may
corrupt the generated XML or cause sed errors if a value ever contains `\`.
Update the escaping to also canonicalize backslashes before escaping `&`/`|`
(and ideally guard against newlines), so the replacement is always treated
literally.
##########
docker/hbase/README.md:
##########
@@ -1,422 +1,301 @@
-# 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
+Use this once at the start of your terminal session:
-### 0. (Optional) Build the HBase Docker Image
```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase
+ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+cd "$ROOT_DIR"
```
-### 1. Start HBase with Docker
-
-```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml up -d
-```
+---
-### 2. Wait for HBase to be Ready (~2 minutes)
+## Quick Start Paths (Choose One)
-```bash
-# Check ZooKeeper connectivity
-nc -z localhost 2181 && echo "Ready" || echo "Not ready"
+<details>
+<summary><b>Option 1: Standalone HugeGraph (using
start-hugegraph.sh)</b></summary>
-# Or watch the logs
-docker compose -f docker/hbase/docker-compose.hbase.yml logs
+Prerequisite: build local artifact first.
+mvn clean package -DskipTests
```
-
-### 3. (Optional) Clean Up Leftover HBase Tables
-
-For reruns, drop any leftover HugeGraph tables after the container is up:
-
-```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
-'
+cd "$ROOT_DIR"
```
-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)
+# 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
+HBASE_MASTER_HOSTNAME=localhost HBASE_REGIONSERVER_HOSTNAME=localhost \
+docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml up -d
+until docker exec hg-hbase-test nc -z localhost 2181 >/dev/null 2>&1; do sleep
2; done
+echo "HBase ZooKeeper is reachable on 2181"
+# Optional troubleshooting stream:
+# docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml logs -f
hbase
```
-
-
-### 4. Configure and Init the HugeGraph Server (required for API tests)
-
-> 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:
-
```bash
-SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
-SERVER_DIR="${SERVER_DIR#./}"
-[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+# 2) Configure HugeGraph (standalone runtime)
+SERVER_DIR="$(find . -maxdepth 4 -type d -path
'./hugegraph-server/apache-hugegraph-server-*' | head -n 1)"
+[ -n "$SERVER_DIR" ] || { echo "Build artifact not found"; exit 1; }
CONF="$SERVER_DIR/conf/graphs/hugegraph.properties"
-# Switch backend to hbase
-perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
+perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
perl -pi -e 's/^serializer=.*/serializer=hbase/' "$CONF"
-
-# Uncomment HBase connection settings
-perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
-perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
perl -pi -e 's/^#(hbase\.znode_parent=.*)/$1/' "$CONF"
-```
-
-Initialize HBase tables and start the server:
+perl -pi -e 's/^hbase\.hosts=.*/hbase.hosts=localhost/' "$CONF"
+perl -pi -e 's/^hbase\.port=.*/hbase.port=2181/' "$CONF"
+perl -pi -e 's|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|' "$CONF"
-```bash
-printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
-"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+grep -E '^(backend|serializer|hbase\.)' "$CONF"
```
-After `init-store.sh`, you can verify the tables were created:
-
```bash
-docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
-```
+# 3) Init and start server
+cd "$SERVER_DIR"
+printf 'pa\npa\n' | ./bin/init-store.sh
+./bin/start-hugegraph.sh -t 60
----
-
-## Docker Compose Services
-
-### HBase Container
-
-- **Image**: `hugegraph/hbase:2.6.5`
-- **Container Name**: `hg-hbase-test`
-- **Hostname**: `hbase`
-- **Ports**:
- - `2181` - ZooKeeper (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)
-- **Health Check**: ZooKeeper connectivity on port 2181
-- **Startup Time**: ~90-120 seconds
+# 4) Verify backend logs mention hbase
+grep -Eai 'hbase|rocksdb|hstore' "$SERVER_DIR"/logs/*.log | tail -n 30
+```
----
+</details>
-## Manual Verification
+<details>
+<summary><b>Option 2: Docker HugeGraph (fully containerized)</b></summary>
Review Comment:
The fenced code block is closed with four backticks instead of three, which
breaks Markdown rendering for the rest of the document in many renderers.
Change the closing fence to match the opening fence.
##########
docker/hbase/README.md:
##########
@@ -1,422 +1,301 @@
-# 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
+Use this once at the start of your terminal session:
-### 0. (Optional) Build the HBase Docker Image
```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase
+ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+cd "$ROOT_DIR"
```
-### 1. Start HBase with Docker
-
-```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml up -d
-```
+---
-### 2. Wait for HBase to be Ready (~2 minutes)
+## Quick Start Paths (Choose One)
-```bash
-# Check ZooKeeper connectivity
-nc -z localhost 2181 && echo "Ready" || echo "Not ready"
+<details>
+<summary><b>Option 1: Standalone HugeGraph (using
start-hugegraph.sh)</b></summary>
-# Or watch the logs
-docker compose -f docker/hbase/docker-compose.hbase.yml logs
+Prerequisite: build local artifact first.
+mvn clean package -DskipTests
```
-
-### 3. (Optional) Clean Up Leftover HBase Tables
-
-For reruns, drop any leftover HugeGraph tables after the container is up:
-
-```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
-'
+cd "$ROOT_DIR"
```
-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)
+# 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
+HBASE_MASTER_HOSTNAME=localhost HBASE_REGIONSERVER_HOSTNAME=localhost \
+docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml up -d
+until docker exec hg-hbase-test nc -z localhost 2181 >/dev/null 2>&1; do sleep
2; done
+echo "HBase ZooKeeper is reachable on 2181"
+# Optional troubleshooting stream:
+# docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml logs -f
hbase
```
-
-
-### 4. Configure and Init the HugeGraph Server (required for API tests)
-
-> 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:
-
```bash
-SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
-SERVER_DIR="${SERVER_DIR#./}"
-[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+# 2) Configure HugeGraph (standalone runtime)
+SERVER_DIR="$(find . -maxdepth 4 -type d -path
'./hugegraph-server/apache-hugegraph-server-*' | head -n 1)"
+[ -n "$SERVER_DIR" ] || { echo "Build artifact not found"; exit 1; }
CONF="$SERVER_DIR/conf/graphs/hugegraph.properties"
-# Switch backend to hbase
-perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
+perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
perl -pi -e 's/^serializer=.*/serializer=hbase/' "$CONF"
-
-# Uncomment HBase connection settings
-perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
-perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
perl -pi -e 's/^#(hbase\.znode_parent=.*)/$1/' "$CONF"
-```
-
-Initialize HBase tables and start the server:
+perl -pi -e 's/^hbase\.hosts=.*/hbase.hosts=localhost/' "$CONF"
+perl -pi -e 's/^hbase\.port=.*/hbase.port=2181/' "$CONF"
+perl -pi -e 's|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|' "$CONF"
-```bash
-printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
-"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+grep -E '^(backend|serializer|hbase\.)' "$CONF"
```
-After `init-store.sh`, you can verify the tables were created:
-
```bash
-docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
-```
+# 3) Init and start server
+cd "$SERVER_DIR"
+printf 'pa\npa\n' | ./bin/init-store.sh
+./bin/start-hugegraph.sh -t 60
----
-
-## Docker Compose Services
-
-### HBase Container
-
-- **Image**: `hugegraph/hbase:2.6.5`
-- **Container Name**: `hg-hbase-test`
-- **Hostname**: `hbase`
-- **Ports**:
- - `2181` - ZooKeeper (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)
-- **Health Check**: ZooKeeper connectivity on port 2181
-- **Startup Time**: ~90-120 seconds
+# 4) Verify backend logs mention hbase
+grep -Eai 'hbase|rocksdb|hstore' "$SERVER_DIR"/logs/*.log | tail -n 30
+```
----
+</details>
-## Manual Verification
+<details>
+<summary><b>Option 2: Docker HugeGraph (fully containerized)</b></summary>
-### 1. Check Container is Healthy
+```
+cd "$ROOT_DIR"
+````
```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml ps
-docker logs hg-hbase-test | tail -50
+# 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
+HBASE_HOSTNAME=hbase docker compose -p hg-hbase -f
docker/hbase/docker-compose.hbase.yml up -d
+until docker exec hg-hbase-test nc -z localhost 2181 >/dev/null 2>&1; do sleep
2; done
+echo "HBase ZooKeeper is reachable on 2181"
+# Optional troubleshooting stream:
+# docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml logs -f
hbase
```
-### 2. Check ZooKeeper Connectivity
-
```bash
-# From host machine
-nc -z localhost 2181 && echo "ZooKeeper OK" || echo "ZooKeeper not ready"
+# 2) Build HugeGraph server image
+docker build -f hugegraph-server/Dockerfile -t hugegraph/server:dev .
-# From inside the container
-docker exec hg-hbase-test nc -z localhost 2181 && echo "Ready" || echo "Not
ready"
+# 3) Resolve HBase network
+HBASE_NETWORK="$(docker inspect -f '{{range $k,$v :=
.NetworkSettings.Networks}}{{println $k}}{{end}}' hg-hbase-test | head -n 1)"
+echo "$HBASE_NETWORK"
```
-### 3. Check HBase Master and RegionServer Web UIs
-
```bash
-# HBase Master Web UI (should return HTML)
-curl -s http://localhost:16010 | head -20
-
-# RegionServer Web UI
-curl -s http://localhost:16030 | head -20
-
-# Or open in browser
-open http://localhost:16010
+# 4) One-shot init-store
+docker rm -f hg-server-init >/dev/null 2>&1 || true
+docker run --rm --name hg-server-init \
+ --network "$HBASE_NETWORK" \
+ hugegraph/server:dev \
+ bash -lc '
+ set -euo pipefail
+ CONF=/hugegraph-server/conf/graphs/hugegraph.properties
+ perl -pi -e "s/^backend=.*/backend=hbase/" "$CONF"
+ perl -pi -e "s/^serializer=.*/serializer=hbase/" "$CONF"
+ perl -pi -e "s/^#(hbase\.hosts=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.port=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.znode_parent=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^hbase\.hosts=.*/hbase.hosts=hbase/" "$CONF"
+ perl -pi -e "s/^hbase\.port=.*/hbase.port=2181/" "$CONF"
+ perl -pi -e "s|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|" "$CONF"
+ ./bin/init-store.sh
+ '
Review Comment:
The `init-store.sh` step is invoked non-interactively but (based on this
doc’s other path) it typically prompts for the auth/admin password; as written,
this `docker run` can hang waiting for input and look “stuck”. Pipe the
expected input (as done elsewhere with `printf 'pa\npa\n' | ...`) or explicitly
document that it will prompt interactively and requires a TTY/attached run.
##########
docker/hbase/README.md:
##########
@@ -1,422 +1,301 @@
-# 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
+Use this once at the start of your terminal session:
-### 0. (Optional) Build the HBase Docker Image
```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase
+ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
+cd "$ROOT_DIR"
```
-### 1. Start HBase with Docker
-
-```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml up -d
-```
+---
-### 2. Wait for HBase to be Ready (~2 minutes)
+## Quick Start Paths (Choose One)
-```bash
-# Check ZooKeeper connectivity
-nc -z localhost 2181 && echo "Ready" || echo "Not ready"
+<details>
+<summary><b>Option 1: Standalone HugeGraph (using
start-hugegraph.sh)</b></summary>
-# Or watch the logs
-docker compose -f docker/hbase/docker-compose.hbase.yml logs
+Prerequisite: build local artifact first.
+mvn clean package -DskipTests
```
-
-### 3. (Optional) Clean Up Leftover HBase Tables
-
-For reruns, drop any leftover HugeGraph tables after the container is up:
-
-```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
-'
+cd "$ROOT_DIR"
```
-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)
+# 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
+HBASE_MASTER_HOSTNAME=localhost HBASE_REGIONSERVER_HOSTNAME=localhost \
+docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml up -d
+until docker exec hg-hbase-test nc -z localhost 2181 >/dev/null 2>&1; do sleep
2; done
+echo "HBase ZooKeeper is reachable on 2181"
+# Optional troubleshooting stream:
+# docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml logs -f
hbase
```
-
-
-### 4. Configure and Init the HugeGraph Server (required for API tests)
-
-> 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:
-
```bash
-SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
-SERVER_DIR="${SERVER_DIR#./}"
-[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+# 2) Configure HugeGraph (standalone runtime)
+SERVER_DIR="$(find . -maxdepth 4 -type d -path
'./hugegraph-server/apache-hugegraph-server-*' | head -n 1)"
+[ -n "$SERVER_DIR" ] || { echo "Build artifact not found"; exit 1; }
CONF="$SERVER_DIR/conf/graphs/hugegraph.properties"
-# Switch backend to hbase
-perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
+perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
perl -pi -e 's/^serializer=.*/serializer=hbase/' "$CONF"
-
-# Uncomment HBase connection settings
-perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
-perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
perl -pi -e 's/^#(hbase\.znode_parent=.*)/$1/' "$CONF"
-```
-
-Initialize HBase tables and start the server:
+perl -pi -e 's/^hbase\.hosts=.*/hbase.hosts=localhost/' "$CONF"
+perl -pi -e 's/^hbase\.port=.*/hbase.port=2181/' "$CONF"
+perl -pi -e 's|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|' "$CONF"
-```bash
-printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
-"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+grep -E '^(backend|serializer|hbase\.)' "$CONF"
```
-After `init-store.sh`, you can verify the tables were created:
-
```bash
-docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
-```
+# 3) Init and start server
+cd "$SERVER_DIR"
+printf 'pa\npa\n' | ./bin/init-store.sh
+./bin/start-hugegraph.sh -t 60
----
-
-## Docker Compose Services
-
-### HBase Container
-
-- **Image**: `hugegraph/hbase:2.6.5`
-- **Container Name**: `hg-hbase-test`
-- **Hostname**: `hbase`
-- **Ports**:
- - `2181` - ZooKeeper (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)
-- **Health Check**: ZooKeeper connectivity on port 2181
-- **Startup Time**: ~90-120 seconds
+# 4) Verify backend logs mention hbase
+grep -Eai 'hbase|rocksdb|hstore' "$SERVER_DIR"/logs/*.log | tail -n 30
+```
----
+</details>
-## Manual Verification
+<details>
+<summary><b>Option 2: Docker HugeGraph (fully containerized)</b></summary>
-### 1. Check Container is Healthy
+```
+cd "$ROOT_DIR"
+````
```bash
-docker compose -f docker/hbase/docker-compose.hbase.yml ps
-docker logs hg-hbase-test | tail -50
+# 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
+HBASE_HOSTNAME=hbase docker compose -p hg-hbase -f
docker/hbase/docker-compose.hbase.yml up -d
+until docker exec hg-hbase-test nc -z localhost 2181 >/dev/null 2>&1; do sleep
2; done
+echo "HBase ZooKeeper is reachable on 2181"
+# Optional troubleshooting stream:
+# docker compose -p hg-hbase -f docker/hbase/docker-compose.hbase.yml logs -f
hbase
```
-### 2. Check ZooKeeper Connectivity
-
```bash
-# From host machine
-nc -z localhost 2181 && echo "ZooKeeper OK" || echo "ZooKeeper not ready"
+# 2) Build HugeGraph server image
+docker build -f hugegraph-server/Dockerfile -t hugegraph/server:dev .
-# From inside the container
-docker exec hg-hbase-test nc -z localhost 2181 && echo "Ready" || echo "Not
ready"
+# 3) Resolve HBase network
+HBASE_NETWORK="$(docker inspect -f '{{range $k,$v :=
.NetworkSettings.Networks}}{{println $k}}{{end}}' hg-hbase-test | head -n 1)"
+echo "$HBASE_NETWORK"
```
-### 3. Check HBase Master and RegionServer Web UIs
-
```bash
-# HBase Master Web UI (should return HTML)
-curl -s http://localhost:16010 | head -20
-
-# RegionServer Web UI
-curl -s http://localhost:16030 | head -20
-
-# Or open in browser
-open http://localhost:16010
+# 4) One-shot init-store
+docker rm -f hg-server-init >/dev/null 2>&1 || true
+docker run --rm --name hg-server-init \
+ --network "$HBASE_NETWORK" \
+ hugegraph/server:dev \
+ bash -lc '
+ set -euo pipefail
+ CONF=/hugegraph-server/conf/graphs/hugegraph.properties
+ perl -pi -e "s/^backend=.*/backend=hbase/" "$CONF"
+ perl -pi -e "s/^serializer=.*/serializer=hbase/" "$CONF"
+ perl -pi -e "s/^#(hbase\.hosts=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.port=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.znode_parent=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^hbase\.hosts=.*/hbase.hosts=hbase/" "$CONF"
+ perl -pi -e "s/^hbase\.port=.*/hbase.port=2181/" "$CONF"
+ perl -pi -e "s|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|" "$CONF"
+ ./bin/init-store.sh
+ '
```
-### 4. Verify HBase Tables via Shell
-
```bash
-# List all tables (should show HugeGraph tables after init-store)
-docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
-
-# Check a specific table exists (example: after backend init)
-docker exec hg-hbase-test bash -lc 'echo "describe
'"'"'default_hugegraph:g_v'"'"'" | hbase shell -n'
+# 5) Start HugeGraph container
+docker rm -f hg-server-dev-hbase >/dev/null 2>&1 || true
+docker run -d --name hg-server-dev-hbase \
+ --network "$HBASE_NETWORK" \
+ -p 8080:8080 \
+ -p 8182:8182 \
+ hugegraph/server:dev \
+ bash -lc '
+ set -euo pipefail
+ CONF=/hugegraph-server/conf/graphs/hugegraph.properties
+ perl -pi -e "s/^backend=.*/backend=hbase/" "$CONF"
+ perl -pi -e "s/^serializer=.*/serializer=hbase/" "$CONF"
+ perl -pi -e "s/^#(hbase\.hosts=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.port=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^#(hbase\.znode_parent=.*)/\$1/" "$CONF"
+ perl -pi -e "s/^hbase\.hosts=.*/hbase.hosts=hbase/" "$CONF"
+ perl -pi -e "s/^hbase\.port=.*/hbase.port=2181/" "$CONF"
+ perl -pi -e "s|^hbase\.znode_parent=.*|hbase.znode_parent=/hbase|" "$CONF"
+ ./bin/start-hugegraph.sh -t 120
+ tail -f /hugegraph-server/logs/hugegraph-server.log
+ '
```
-### 5. Verify HBase Logs for Errors
-
```bash
-# Check for any ERROR lines in HBase logs
-docker exec hg-hbase-test bash -lc "grep -i error /opt/hbase/logs/*.log | tail
-20"
-
-# Tail live logs (run from repo root)
-docker compose -f docker/hbase/docker-compose.hbase.yml logs
+# 6) Verify hbase backend
+docker exec hg-server-dev-hbase bash -lc "grep -E
'^(backend|serializer|hbase\.)'
/hugegraph-server/conf/graphs/hugegraph.properties"
+docker exec hg-server-dev-hbase bash -lc "grep -Ei 'hbase|rocksdb|hstore'
/hugegraph-server/logs/*.log | tail -n 30"
```
-> **Known benign messages** — these are safe to ignore in standalone mode:
-> - `SASL config status: Will not attempt to authenticate using SASL (unknown
error)` — ZooKeeper SASL is not configured; standalone HBase does not need it.
-> - `Invalid configuration, only one server specified (ignoring)` — expected
when running a single-node ZooKeeper.
-> - `NoClassDefFoundError: org/eclipse/jetty/...` — Jetty UI dependency
missing in the container; does not affect HBase or ZooKeeper functionality.
+</details>
+
+After either path is up, run the shared tests below.
---
-## Manual API Sanity (curl)
+## Common Testing Steps
-These steps assume the HugeGraph server is running at `http://localhost:8080`
with auth enabled (`admin/pa`).
+### Apache HugeGraph Persistent Runbook (REST Engine)
-> **Note on Idempotency**: Schema creation calls below use `"check_exist":
false`, which skips strict "already exists" checks for matching schema
definitions. If a re-submitted schema conflicts with an existing definition,
HugeGraph can still return an error.
->
-> **Prerequisite**: The HBase backend tables must be initialized before any
API calls will work. If you see `TableNotFoundException` errors, re-run
`init-store.sh` (see Step 0 below or the Quick Start section).
+### Prerequisites and Constants
-### 0. Initialize Backend and Start Server
+- Base URL: `http://localhost:8080`
+- Graph target name: `hugegraph`
+- Storage backend: persistent (HBase/Cassandra/RocksDB)
-> **Skip this if the server is already running.** This step is required the
first time or after a full cleanup.
->
-> **Prerequisite**: Run `mvn clean package -DskipTests` from the repository
root first to generate the distribution.
+---
-```bash
-SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
-SERVER_DIR="${SERVER_DIR#./}"
-[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+### Step 1: Purge Database (Fresh Restart)
-# Initialize HBase tables (enter password 'pa' when prompted)
-printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
+Wipe any conflicting test records and data schema.
Review Comment:
The runbook curl commands no longer include authentication (earlier versions
referenced `admin/pa`). If auth is enabled by default, these requests will fail
with `401`. Either add `-u admin:pa` (and keep it consistent across all runbook
calls) or clearly state the required auth configuration for these examples.
--
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]