Multi-Graph Configuration Management#
HugeGraph supports running multiple named graphs simultaneously by placing one *.properties file per graph in a shared graphs/ directory. However, the Docker entrypoint and startup scripts were written assuming a single default graph (hugegraph.properties) and do not iterate over all graph configs in that directory. This asymmetry is a known gap between the shell-layer startup code and the Java initialization layer.
Configuration Layout#
| File | Purpose |
|---|---|
conf/rest-server.properties | Top-level server config; graphs=./conf/graphs points at the graphs directory |
conf/graphs/hugegraph.properties | Default single-graph config shipped with the distribution (backend, store, cache, etc.) |
Additional *.properties files | User-defined additional graphs in the same directory โ supported by the Java layer, but not addressed by startup scripts |
rest-server.properties sets graphs=./conf/graphs , which is a directory path, not a file path.
Where the Single-Graph Assumption Lives#
Docker Entrypoint (docker-entrypoint.sh)#
docker-entrypoint.sh hard-codes a single graph config path at the top of the file:
GRAPH_CONF="./conf/graphs/hugegraph.properties" # line 22
Every env-to-config mapping in the "Map env โ properties file" block writes exclusively to this single path :
HG_SERVER_BACKENDโbackendinGRAPH_CONFauth.token_secret,pd.peers,rocksdb.data_path,rocksdb.wal_path, androcksdb.providerare all written only toGRAPH_CONF
The post-startup backend check also reads the backend from only this file (via grep ... "${GRAPH_CONF}"). A second graph using a different backend would be invisible to this check.
ToplingDB / RocksDB Provider Check (PR #179)#
PR #179 introduced optional ToplingDB integration. The entrypoint at commit 4a852e2e reads the backend and rocksdb.provider from GRAPH_CONF alone and derives the ROCKSDB_DATA_ROOT and provider-marker path from that single value. If a deployment has a second graph config that uses RocksDB with a different provider, the provider marker validation (verify-rocksdb-provider.sh, called by the entrypoint) sees only the first graph's backend โ the secondary graphs are never verified.
init-store.sh#
bin/init-store.sh calls org.apache.hugegraph.cmd.InitStore with conf/rest-server.properties as its sole argument . At this level the problem does not exist โ InitStore.java uses ConfigUtil.scanGraphsDir() to discover every *.properties file in the graphs directory and iterates over all of them . So store initialization is already multi-graph aware.
Affected Operations (Single-Graph Only)#
The following operations touch only hugegraph.properties, regardless of what other graphs exist:
| Operation | Location |
|---|---|
Writing backend, pd.peers, auth token, RocksDB paths | docker-entrypoint.sh env-to-config block |
Reading backend for post-startup hstore check | docker-entrypoint.sh (grep on GRAPH_CONF) |
Reading/writing auth.token_secret (token sync logic) | docker-entrypoint.sh lines 132โ170 |
| ToplingDB provider marker verification | docker-entrypoint.sh โ verify-rocksdb-provider.sh (PR #179) |
Java Layer: Multi-Graph Support (ConfigUtil.scanGraphsDir)#
ConfigUtil.scanGraphsDir() scans the graphs directory for all *.properties files, uses the filename (minus the .properties suffix) as the graph name, and returns a Map<String, String> of graph-name โ config-path . InitStore.java calls this and initializes each graph individually , skipping only hstore-backed graphs.
This means that adding a new graph is fully supported at the Java level by dropping a new *.properties file into conf/graphs/ โ but any Docker-managed properties (backend override, RocksDB paths, auth token) will not be propagated to that file by the entrypoint.
Key Files & References#
docker-entrypoint.shโ hardcodedGRAPH_CONF; all shell-level config mutationshugegraph.propertiesโ the single graph config assumed by the entrypointrest-server.propertiesโgraphs=./conf/graphs(directory)init-store.shโ callsInitStore.javaviarest-server.propertiesInitStore.javaโ multi-graph aware (usesscanGraphsDir)ConfigUtil.javaโscanGraphsDirimplementation- PR #179 โ ToplingDB integration โ introduced the provider marker check that reads from the single hardcoded
GRAPH_CONF