This is the multi-page printable view of this section. .
GUIDES
- 1: HugeGraph Architecture Overview
- 2: HugeGraph Design Concepts
- 3: HugeGraph Plugin mechanism and plug-in extension process
- 4: HugeGraph Toolchain Local Testing Guide
- 5: Backup and Restore
- 6: HugeGraph Docker Cluster Guide
- 7: FAQ
- 8: Security Report
This section covers HugeGraph architecture, design, backup and restore, plugin development, security settings, and frequently asked questions.
1 - HugeGraph Architecture Overview
Full-Stack Components
The HugeGraph ecosystem combines a graph database, graph computing engines, graph AI, and a toolchain with distinct responsibilities. HugeGraph Server provides OLTP graph database services; HugeGraph-Computer and Vermeer are independent OLAP engines; HugeGraph-AI provides graph AI capabilities. Toolchain clients, import tools, visualization, and operations tools provide entry points for applications and operators.

Figure: Server uses HStore as an example backend; see the Mermaid diagram below for independent backends such as RocksDB and HBase. Vermeer and HugeGraph-Computer are independent OLAP engines. Dashed arrows indicate optional integration.
Ecosystem Integration
flowchart TB
Apps["Applications / Operations"] --> Toolchain["Toolchain"] --> Server["Server REST API"]
AI["AI"] -. REST .-> Server
Computer["Computer"] -. REST .-> Server
Vermeer["Vermeer"] -. PD .-> PD["PD"]
Vermeer -. Scan .-> Store["Store"]
Vermeer -. Write .-> ServerOptional connections do not mean every AI, Computer, or Vermeer task must connect to Server, PD, or Store. Computer and AI read and write through the Server REST API. Vermeer’s HugeGraph input queries PD for partition metadata and scans HStore partitions directly through Store. With HugeGraph result output, it writes results back through the Server REST API.
Server Internals
flowchart TB
API["REST API / Gremlin"] --> Core["Core"] --> Adapter["Backend adapter"]
Adapter --> RocksDB["RocksDB"]
Adapter --> HBase["HBase"]
Adapter --> HStore["HStore"]
HStore --> PD["PD"]
HStore --> Store["Store"]Server REST APIs and Gremlin send requests to Core, which reads and writes through a backend adapter. RocksDB and HBase are independent backends. The HStore adapter obtains cluster metadata and partition information from PD and sends graph operations to Store nodes. PD manages metadata and partitions; it does not carry graph data reads and writes.
Current Server implementations include RocksDB, HBase, HStore, and memory backends. Memory is for testing or temporary use, not a persistent production deployment. See the Server quick start for production deployment options.
Main Toolchain components:
- Hubble: Connects to the graph database through a web interface to manage schemas, import data, and run queries.
- Loader: Converts multiple data sources and imports them into graph data in batches.
- Tools: Provides command-line deployment, management, backup, and restore operations.
- Client: Wraps Server connections, schema management, graph reads and writes, and queries. Clients are available for Java, Python, and Go; a Rust client is under development.
Independent Graph Computing Engines
- Vermeer: Provides independent graph computing services and algorithm APIs.
- HugeGraph-Computer: A Java distributed graph computing engine based on BSP/Pregel.
Historical Architecture
The following diagram is retained for historical reference. Its depiction of Server providing both OLTP and OLAP, and of various old backends, does not describe current master.

2 - HugeGraph Design Concepts
1. Property Graph
Version note: This page retains early design material. The property graph model and vertex ID strategies remain consistent with current master, but figures, partitioning conclusions, and transaction descriptions have the scope stated in each section. They are not current deployment or storage implementation guarantees.
There are two common graph data representation models, namely the RDF (Resource Description Framework) model and the Property Graph (Property Graph) model. Both RDF and Property Graph are the most basic and well-known graph representation modes, and both can represent entity-relationship modeling of various graphs. RDF is a W3C standard, while Property Graph is an industry standard and is widely supported by graph database vendors. HugeGraph currently uses Property Graph.
HugeGraph uses the property graph model. This person-and-book example shows labels and properties on vertices and directed edges. It is a logical model, not an illustration of the current internal data layout.

Figure: Vertices and edges each carry their own labels and properties.
Inside HugeGraph, each vertex/edge is identified by a unique VertexId/EdgeId, and the attributes are stored inside the corresponding vertex/edge. The relationship/mapping between vertices is stored through edges.
When the vertex attribute value is stored by edge pointer, if you want to update a vertex-specific attribute value, you can directly write it by overwriting. The disadvantage is that the VertexId is redundantly stored; if you want to update the attribute of the relationship, you need to use the read-and-modify method , read all attributes first, modify some attributes, and then write to the storage system, the update efficiency is low. According to experience, there are more requirements for modifying vertex attributes, but less for edge attributes. For example, calculations such as PageRank and Graph Cluster require frequent modification of vertex attribute values.
2. Graph Partition Scheme
Version note: The Edge Cut and Vertex Cut comparison is historical design background. Current PD and Store code does not define “HugeGraph uses Edge Cut” as an implementation contract. Do not use that conclusion to describe current partitioning or replication; see the HStore quick start for current distributed deployments.
For distributed graph databases, there are two partition storage methods for graphs: Edge Cut and Vertex Cut, as shown in the following figure. When using the Edge Cut method to store graphs, any vertex will only appear on one machine, while edges may be distributed on different machines. This storage method may lead to multiple storage of edges. When using the Vertex Cut method to store graphs, any edge will only appear on one machine, and each same point may be distributed to different machines. This storage method may result in multiple storage of vertices.

The EdgeCut partition scheme can support high-performance insert and update operations, while the VertexCut partition scheme is more suitable for static graph query analysis, so EdgeCut is suitable for OLTP graph query, and VertexCut is more suitable for OLAP graph query. Early design material described HugeGraph as using Edge Cut. That historical conclusion is retained here and does not describe the current partitioning implementation.
3. VertexId Strategy
Vertex of HugeGraph supports four ID strategies. Different VertexLabels in the same graph database can use different Id strategies. Currently, the Id strategies supported by HugeGraph are:
- Automatic generation (AUTOMATIC): Use the Snowflake algorithm to automatically generate a globally unique Id, Long type;
- Primary Key (PRIMARY_KEY): Generate Id through VertexLabel+PrimaryKeyValues, String type;
- Custom (CUSTOMIZE_STRING|CUSTOMIZE_NUMBER): User-defined Id, which is divided into two types: String and Long, and you need to ensure the uniqueness of the Id yourself;
- Custom UUID (CUSTOMIZE_UUID): User-defined Id in UUID form, you need to ensure the uniqueness of the Id yourself;
The default Id policy is AUTOMATIC, if the user calls the primaryKeys() method and sets the correct PrimaryKeys, the PRIMARY_KEY policy is automatically enabled. After enabling the PRIMARY_KEY strategy, HugeGraph can implement data deduplication based on PrimaryKeys.
- AUTOMATIC ID Policy
- PRIMARY_KEY ID policy
- CUSTOMIZE_STRING ID Policy
- CUSTOMIZE_NUMBER ID Policy
- CUSTOMIZE_UUID ID Policy
If users need Vertex deduplication, there are three options:
- Adopt PRIMARY_KEY strategy, automatic overwriting, suitable for batch insertion of large amount of data, users cannot know whether overwriting has occurred
- Adopt AUTOMATIC strategy, read-and-modify, suitable for small data insertion, users can clearly know whether overwriting occurs
- Using the CUSTOMIZE_STRING or CUSTOMIZE_NUMBER strategy, the user guarantees the uniqueness
4. EdgeId policy
Current implementation: The four-part composition below is a historical simplification. Current
EdgeIdalso distinguishes edge direction and parent/child edge labels. SeeEdgeIdin the Server source; use the source for your version when relying on ID formats or persistent keys.
The EdgeId of HugeGraph is composed of srcVertexId + edgeLabel + sortKey + tgtVertexId. Among them sortKey is an important concept of HugeGraph.
There are two reasons for adding sortKey to Edge as the unique ID of Edge:
- If there are multiple edges of the same Label between two vertices, they can be distinguished by
sortKey - For SuperNode nodes, edges can be sorted and truncated by
sortKey.
Since EdgeId is composed of srcVertexId + edgeLabel + sortKey + tgtVertexId, HugeGraph will automatically overwrite when the same Edge is inserted
multiple times to achieve deduplication. It should be noted that the properties of Edge will also be overwritten in the batch insert mode.
In addition, because HugeGraph’s EdgeId adopts an automatic deduplication strategy, HugeGraph considers that there is only one edge in the case of self-loop (a vertex has an edge pointing to itself), while a graph database that uses the AUTOMATIC strategy (TitanDB for example) considers that the graph has two edges.
The edges of HugeGraph only support directed edges, and undirected edges can be realized by creating two edges, Out and In.
5. HugeGraph transaction overview
Version scope: The isolation-level, thread-binding, and backend atomicity descriptions below are historical implementation notes. Transaction isolation and rollback boundaries depend on the backend implementation; do not treat these historical descriptions as cross-backend guarantees.
TinkerPop transaction overview
A TinkerPop transaction refers to a unit of work that performs operations on the database. A set of operations within a transaction either succeeds or all fail. For a detailed introduction, please refer to the official documentation of TinkerPop: http://tinkerpop.apache.org/docs/current/reference/#transactions
TinkerPop transaction interfaces
- open open transaction
- commit commit transaction
- rollback rollback transaction
- close closes the transaction
TinkerPop transaction specification
- The transaction must be explicitly committed before it can take effect (the modification operation can only be seen by the query in this transaction if it is not committed)
- A transaction must be opened before it can be committed or rolled back
- If the transaction setting is automatically turned on, there is no need to explicitly turn it on (the default method), if it is set to be turned on manually, it must be turned on explicitly
- When the transaction is closed, you can set three modes: automatic commit, automatic rollback (default mode), manual (explicit shutdown is prohibited), etc.
- The transaction must be closed after committing or rolling back
- The transaction must be open after the query
- Transactions (non-threaded tx) must be thread-isolated, and multi-threaded operations on the same transaction do not affect each other
For more transaction specification use cases, see: Transaction Test
HugeGraph transaction implementation
- All operations in a transaction either succeed or fail
- A transaction can only read what has been committed by another transaction (Read committed)
- All uncommitted operations can be queried in this transaction, including:
- Adding a vertex can query the vertex
- Delete a vertex to filter out the vertex
- Deleting a vertex can filter out the related edges of the vertex
- Adding an edge can query the edge
- Delete edge can filter out the edge
- Adding/modifying (vertex, edge) attributes can take effect when querying
- Delete (vertex, edge) attributes can take effect at query time
- All uncommitted operations become invalid after the transaction is rolled back, including:
- Adding and deleting vertices and edges
- Addition/modification, deletion of attributes
Example: One transaction cannot read another transaction’s uncommitted content
Principle of transaction realization
- The server internally realizes isolation by binding transactions to threads (ThreadLocal)
- The uncommitted content of this transaction overwrites the old data in chronological order for this transaction to query the latest version of data
- The bottom layer relies on the back-end database to ensure transaction atomicity (for example, the batch interface of RocksDB guarantees atomicity)
Notice
REST APIs do not expose a separate transaction lifecycle interface; write APIs invoke the relevant Server-side transaction commit logic.
TinkerPop API allows open transactions, which are automatically closed when the request is completed (Gremlin Server forces close)
3 - HugeGraph Plugin mechanism and plug-in extension process
Background
- HugeGraph is not only open source and open, but also simple and easy to use. General users can easily add plug-in extension functions without changing the source code.
- HugeGraph supports a variety of built-in storage backends, and also allows users to extend custom backends without changing the existing source code.
- HugeGraph supports full-text search. The full-text search function involves word segmentation in various languages. Currently, there are 7 built-in word breakers (ansj, hanlp, smartcn, jieba, jcseg, mmseg4j, ikanalyzer), and it also allows users to expand custom word breakers without changing the existing source code.
Scalable dimension
Currently, the plug-in method provides extensions in the following dimensions:
- backend storage
- serializer
- Custom configuration items
- tokenizer
Plug-in implementation mechanism
- HugeGraph provides a plug-in interface HugeGraphPlugin, which supports plug-in through the Java SPI mechanism
- HugeGraph provides four extension registration functions as static methods on HugeGraphPlugin: registerOptions(), registerBackend(), registerSerializer(), registerAnalyzer()
- The plug-in implementer implements the corresponding Options, Backend, Serializer or Analyzer interface
- The plug-in implementer implements register()the method of the HugeGraphPlugin interface, registers the specific implementation class listed in the above point 3 in this method, and packs it into a jar package
- The plug-in user puts the jar package in the HugeGraph Server installation directory plugins, modifies the relevant configuration items to the plug-in custom value, and restarts to take effect
Plug-in implementation process example
1 Create a new maven project
1.1 Name the project name: hugegraph-plugin-demo
1.2 Add hugegraph-core Jar package dependencies
The Maven pom.xml is shown below. Match hugegraph.version to the target Server version; this example uses the current master version 1.7.0:
2 Realize extended functions
2.1 Extending a custom backend
2.1.1 Implement the interface BackendStoreProvider
- Realizable interfaces:
org.apache.hugegraph.backend.store.BackendStoreProvider - Or inherit an abstract class:
org.apache.hugegraph.backend.store.AbstractBackendStoreProvider
Take the RocksDB backend RocksDBStoreProvider as an example:
2.1.2 Implement interface BackendStore
The main abstract methods of BackendStore are shown below; default helper methods are omitted:
2.1.3 Extending custom serializers
The serializer must inherit the abstract class: org.apache.hugegraph.backend.serializer.AbstractSerializer
( implements GraphSerializer, SchemaSerializer) The main interface is defined as follows:
2.1.4 Extend custom configuration items
When adding a custom backend, it may be necessary to add new configuration items. The implementation process mainly includes:
- Add a configuration item container class and implement the interface
org.apache.hugegraph.config.OptionHolder - Provide a singleton method
public static OptionHolder instance(), and call the method when the object is initializedOptionHolder.registerOptions() - Add configuration item declaration, single-value configuration item type is
ConfigOption, multi-value configuration item type isConfigListOption
Take the RocksDB configuration item definition as an example:
2.2 Extend custom tokenizer
The tokenizer needs to implement the interface org.apache.hugegraph.analyzer.Analyzer, take implementing a SpaceAnalyzer space tokenizer as an example.
3. Implement the plug-in interface and register it
The plug-in registration entry is HugeGraphPlugin.register(), the custom plug-in must implement this interface method, and register the extension
items defined above inside it. The interface org.apache.hugegraph.plugin.HugeGraphPlugin is defined as follows:
And HugeGraphPlugin provides 4 static methods for registering extensions:
- registerOptions(String name, String classPath): register configuration items
- registerBackend(String name, String classPath): register backend (BackendStoreProvider)
- registerSerializer(String name, String classPath): register serializer
- registerAnalyzer(String name, String classPath): register tokenizer
The following is an example of registering the SpaceAnalyzer tokenizer:
4. Configure SPI entry
- Make sure the services directory exists: hugegraph-plugin-demo/resources/META-INF/services
- Create a text file in the services directory: org.apache.hugegraph.plugin.HugeGraphPlugin
- The content of the file is as follows: org.apache.hugegraph.plugin.DemoPlugin
5. Make Jar package
Through maven packaging, execute the command in the project directory mvn package, and a Jar package file will be generated in the
target directory. Copy the Jar package to the plugins directory when using it, and restart the service to take effect.
4 - HugeGraph Toolchain Local Testing Guide
This guide helps developers run HugeGraph toolchain tests locally.
1. Core Concepts
1.1 Core Dependency: HugeGraph Server
Integration and functional tests of the toolchain depend on HugeGraph Server, including Client, Loader, Hubble, Spark Connector, Tools, and other components.
1.2 Test Types
- Unit Tests: Test individual functions/methods, no external dependencies required
- API Tests (ApiTestSuite): Test API interfaces, requires running HugeGraph Server
- Functional Tests (FuncTestSuite): End-to-end tests, require complete system environment
2. Environment Setup
2.1 System Requirements
- Operating System: Linux / macOS (Windows use WSL2)
- JDK: >= 11, configure
JAVA_HOME - Maven: >= 3.6
- Python: >= 3.11 (only required for Hubble tests)
2.2 Clone Code
3. Deploy Test Environment
Deployment Options
- Script Deployment: Specify a Server commit to reproduce the server version used by CI
- Docker Deployment: Suitable for quick checks; if tests fail, first verify compatibility between the image and Toolchain
For detailed installation instructions, refer to Community Documentation
3.1 Script Deployment
Parameter Description
$COMMIT_ID: Specify Server source code Git Commit ID$DB_DATABASE/$DB_PASS: MySQL database name and password for Loader JDBC tests
Deployment Steps
1. Install HugeGraph Server
- The script starts HTTP and HTTPS instances on ports 8080 and 8443 and configures
admin/paauthentication. - Ensure both ports are available before running it.
2. Install Optional Dependencies
3. Health Check
3.2 Docker Deployment
Note: Docker images may have version lag, use script deployment if encountering compatibility issues
Quick Start
docker-compose Configuration (Optional)
Complete configuration example including Server, MySQL, Hadoop services (requires Docker Compose V2):
Hadoop Configuration Mounts
Create a ./config folder in the same directory as docker-compose.yml to mount Hadoop configuration files. You can skip this step if HDFS testing is not required.
📁 ./config/core-site.xml content:
📁 ./config/hdfs-site.xml content:
Docker Operations
4. Run Tests
Test process for each tool:

4.1 hugegraph-client
Compile
Dependent Services
Start HugeGraph Server (refer to Section 3)
Server Authentication Configuration
ApiTest requires authentication. No additional configuration is needed when using the script in Section 3.1. For a manually deployed Server, the authentication settings and test credentials must match the test code.
Run Tests
Check Server log if tests fail:
logs/hugegraph-server.log
4.2 hugegraph-loader
Compile
Dependent Services
- Required: HugeGraph Server
- Optional: Hadoop (HDFS tests), MySQL (JDBC tests); Kafka tests use Testcontainers to start Kafka and also require an available Docker daemon.
Run Tests
4.3 hugegraph-hubble
Compile
Dependent Services
1. Start Server (refer to Section 3)
2. Python Environment
3. Build and Verify
Run Tests
4.4 hugegraph-spark-connector
Compile
Run Tests
4.5 hugegraph-tools
Compile
Run Tests
5. Common Issues
Service Connection Issues
If Server, MySQL, or Hadoop cannot be reached:
- Confirm services are running (Server must be on port 8080)
- Check port usage:
lsof -i:8080 - Docker check:
docker compose psanddocker compose logs
Configuration Issues
If files cannot be found or parameters are invalid:
- Check environment variables:
echo $COMMIT_ID - Script permissions:
chmod +x hugegraph-*/assembly/travis/*.sh
HDFS Test Failures
- Confirm NameNode/DataNode running normally
- Check Hadoop logs
- Verify HDFS connection:
hdfs dfsadmin -report
JDBC Test Failures
- Confirm MySQL running normally
- Verify database connection:
mysql -u root -p$DB_PASS - Check MySQL logs
6. References
- HugeGraph GitHub Repository: https://github.com/apache/hugegraph
- HugeGraph Toolchain GitHub Repository: https://github.com/apache/hugegraph-toolchain
- HugeGraph Server Documentation: https://hugegraph.apache.org/docs/quickstart/hugegraph/hugegraph-server/
- CI Configuration:
.github/workflows/*-ci.yml - Dependency Installation Scripts:
hugegraph-*/assembly/travis/
5 - Backup and Restore
Description
Backup and Restore are functions of backup map and restore map. The data backed up and restored includes metadata (schema) and graph data (vertex and edge).
Backup
Export the metadata and graph data of a graph in the HugeGraph system in JSON format.
Restore
Re-import the data in JSON format exported by Backup to a graph in the HugeGraph system.
Restore has two modes:
- In Restoring mode, the metadata and graph data exported by Backup are restored to the HugeGraph system intact. It can be used for graph backup and recovery, and the general target graph is a new graph (without metadata and graph data). for example:
- System upgrade, first back up the map, then upgrade the system, and finally restore the map to the new system
- Graph migration, from a HugeGraph system, use the Backup function to export the graph, and then use the Restore function to import the graph into another HugeGraph system
- In the Merging mode, the metadata and graph data exported by Backup are imported into another graph that already has metadata or graph data. During the process, the ID of the metadata may change, and the IDs of vertices and edges will also change accordingly.
- Can be used to merge graphs
Instructions
You can use hugegraph-tools to backup and restore the graph.
Backup
This command backs up all the metadata and graph data of the hugegraph graph of http://127.0.0.1:8080 (the default –url) to the data directory.
Backup works in any graph mode, it does not check the graph mode
Restore
Restore has two modes: RESTORING and MERGING. Before restore, you must first set the graph mode according to your needs, the restore command fails when the graph is in any other mode.
Step 1: View and set graph mode
This command is used to view the current graph mode, including: NONE, RESTORING, MERGING, LOADING.
This command is used to set the graph mode. Before Restore, it can be set to RESTORING or MERGING mode. In the example, it is set to RESTORING.
Step 2: Restore data
This command re-imports all metadata and graph data in the data directory to the hugegraph graph at http://127.0.0.1:8080.
Step 3: Restoring Graph Mode
This command is used to restore the graph mode to NONE.
So far, a complete graph backup and graph recovery process is over.
help
For detailed usage of backup and restore commands, please refer to the hugegraph-tools documentation.
API description for Backup/Restore usage and implementation
Backup
Backup uses the corresponding list(GET) API export of metadata and graph data, and no new API is added.
Restore
Restore uses the corresponding create(POST) API imports for metadata and graph data, and does not add new APIs.
There are two different modes for Restore: Restoring and Merging. In addition, there is a regular mode of NONE (default), the differences are as follows:
- In None mode, the writing of metadata and graph data is normal, please refer to the function description. special:
- ID is not allowed when metadata (schema) is created
- Graph data (vertex) is not allowed to specify an ID when the id strategy is Automatic
- Restoring mode, restoring to a new graph, in particular:
- ID is allowed to be specified when metadata (schema) is created
- Graph data (vertex) allows specifying an ID when the id strategy is Automatic
- Merging mode, merging into a graph with existing metadata and graph data, in particular:
- ID is not allowed when metadata (schema) is created
- Graph data (vertex) allows specifying an ID when the id strategy is Automatic
Normally, the graph mode is None. When you need to restore the graph, you need to temporarily change the graph mode to Restoring mode or Merging mode as needed, and when the Restore is completed, restore the graph mode to None.
The implemented RESTful API for setting graph mode is as follows:
View the mode of a graph
When authentication is enabled, graph read permission is required (space_member or the graph owner).
Method & Url
Response Status
Response Body
Legal graph modes include: NONE, RESTORING, MERGING, LOADING
Set the mode of a graph
When authentication is enabled, graph-space management permission (space) is required; administrators can satisfy it through permission inheritance.
Method & Url
Request Body
Legal graph modes include: NONE, RESTORING, MERGING, LOADING
Response Status
Response Body
6 - HugeGraph Docker Cluster Guide
Overview
Docker Compose provides a quick way to run a complete HugeGraph distributed cluster (PD + Store + Server) on Linux or macOS.
Prerequisites
- Docker Engine 20.10+ or Docker Desktop 4.x+
- Docker Compose v2
- For a three-node cluster on macOS, allocate at least 12 GB of memory (Settings → Resources → Memory). Adjust resources to suit other platforms.
Tested environments: Linux (native Docker) and macOS (Docker Desktop on ARM M4).
Compose Files
The HugeGraph repository provides four Compose files in docker/:
| File | Services | Use case |
|---|---|---|
docker-compose.yml | 1 RocksDB Server + 1 Hubble | Default standalone Quick Start; recommended starting point |
docker-compose-hstore.yml | 1 PD + 1 Store + 1 Server + 1 Hubble | Local distributed development |
docker-compose-3pd-3store-3server.yml | 3 PD + 3 Store + 3 Server + 1 Hubble | HA reference and evaluation |
docker-compose.dev.yml | Override only | Source-build override for the minimal HStore topology; always combine with docker-compose-hstore.yml |
Standalone uses hugegraph/hugegraph:${HUGEGRAPH_VERSION:-latest}; HStore uses matching hugegraph/pd, hugegraph/store, and hugegraph/server tags. Hubble is selected separately by ${HUBBLE_IMAGE:-hugegraph/hubble:latest}.
The following steps assume you have cloned the
hugegraphrepository, or at least itsdocker/directory.
HStore and HA instructions use current master Compose files and require PD, Store, and Server images built from the same master source. Do not combine these files with HStore component images tagged 1.7.0. The standalone example separately pins hugegraph/hugegraph:1.7.0.
Authentication Environment
This .env template applies to current master Compose. Angle-bracket values and replace-with-your-password are placeholders: replace them before loading the file or starting services. Follow the master authentication environment instructions to generate .env, then replace the administrator password placeholder:
For master HStore and HA topologies, HG_PD_AUTH_SECRET_KEY is the PD REST Basic password, shared by all PD nodes, Server, and Hubble. Current master PD Docker images require it. Hubble does not read .env directly: generate the local configuration for its topology using this value before startup, as described below. Do not commit .env or generated .local.properties files.
A nonempty HUGEGRAPH_ADMIN_PASSWORD enables Server authentication through PASSWORD; Hubble detects this mode through the Server API. It initializes the built-in admin password only on first initialization. An unset or empty value disables authentication and is suitable only for trusted local environments.
Current master Compose passes HUGEGRAPH_AUTH_TOKEN_SECRET as HG_SERVER_AUTH_TOKEN_SECRET. A shared secret lets master Server replicas verify the same tokens and retain token validity after container recreation; HA Compose requires an explicit secret. The standalone hugegraph/hugegraph:1.7.0 entrypoint enables authentication through PASSWORD but ignores HG_SERVER_AUTH_TOKEN_SECRET, so this .env variable does not fix its JWT secret. For a stable JWT secret in 1.7.0, explicitly set auth.token_secret in its authentication graph configuration, conf/graphs/hugegraph.properties, and persist that file across container replacement. See the authentication guide for graph paths and secret generation.
Changing HUGEGRAPH_ADMIN_PASSWORD later does not rotate an existing password; use the user API.
Production component access controls
In production, enable Server authentication and authorization for graph APIs, maintain the Server IP allowlist, grant minimum permissions, and retain Server audit-*.log with restricted read access. Configure PD REST credentials and PD/Store gRPC, Raft, and REST network boundaries separately; Server Auth does not protect those ports. Expose PD/Store only to cluster nodes and trusted operations networks.
Standalone Quick Start
This section pins the standalone image hugegraph/hugegraph:1.7.0. HStore/HA examples use master-built images; do not reuse this version for them.
Verify:
Hubble binds only to host loopback (127.0.0.1:8088) by default. Set HUBBLE_PUBLISH_HOST only behind an HTTPS reverse proxy and trusted network controls.
Minimal HStore Quick Start (Current Master Images)
Build PD, Store, and HStore Server images from the HugeGraph Server master repository root:
From the repository root, enter docker/, load .env, and generate Hubble configuration for the minimal topology. A read-only bind mount cannot create a valid missing hstore.local.properties; generate it before startup:
Verify:
To build this topology from local source instead of pulling images, add the development override and keep both files in all subsequent lifecycle commands:
The override builds images tagged dev. If you already built local images above, start with the base Compose file and HUGEGRAPH_VERSION=local; keep the tag choices consistent.
Three-Node Cluster Quick Start (Current Master Images)
HA Compose has no source-build override. First build hugegraph/pd:local, hugegraph/store:local, and hugegraph/server:local from the same master source as in the minimal HStore section, then load .env in docker/, generate HA Hubble configuration, and start:
HA Hubble bind-mounts conf/hubble/hstore-ha.local.properties; generate this before startup. It is separate from the minimal topology’s hstore.local.properties, but both use the same HG_PD_AUTH_SECRET_KEY from .env.
The default startup order is:
- PD nodes start first and must pass
/v1/healthchecks. - Store nodes start after all PD nodes are healthy.
- Server nodes start after all Store and PD nodes are healthy.
Verify the cluster: PD /v1/health and /v1/ready probes require no authentication. Store registration and partition queries are protected PD REST management APIs: use Basic username hg and HG_PD_AUTH_SECRET_KEY from .env.
With authentication enabled, graph listing should reject anonymous access and accept the administrator:
The other Server nodes listen on 8081 and 8082; the remaining PD and Store nodes use 8621/8622 and 8521/8522.
Environment Variable Reference
The following tables describe current master entrypoints and Compose files, not the standalone hugegraph/hugegraph:1.7.0 environment-variable contract. PD and Store build SPRING_APPLICATION_JSON from their variables and log selected nonsensitive settings at startup. PD secrets are excluded from that summary. Use docker logs to check listed settings; an absent secret in the logs does not establish whether it was applied. Server instead rewrites keys in conf/graphs/hugegraph.properties and conf/rest-server.properties.
PD Variables
| Variable | Required | Default | Configuration mapping |
|---|---|---|---|
HG_PD_GRPC_HOST | Yes | None | grpc.host |
HG_PD_RAFT_ADDRESS | Yes | None | raft.address |
HG_PD_RAFT_PEERS_LIST | Yes | None | raft.peers-list |
HG_PD_INITIAL_STORE_LIST | Yes | None | pd.initial-store-list |
HG_PD_GRPC_PORT | No | 8686 | grpc.port |
HG_PD_REST_PORT | No | 8620 | server.port |
HG_PD_DATA_PATH | No | /hugegraph-pd/pd_data | pd.data-path |
HG_PD_INITIAL_STORE_COUNT | No | 1 | pd.initial-store-count |
HG_PD_AUTH_SECRET_KEY | Yes (current master Docker) | None | auth.secret-key; PD REST Basic password, also used by Server and Hubble |
Deprecated aliases:
GRPC_HOST→HG_PD_GRPC_HOST,RAFT_ADDRESS→HG_PD_RAFT_ADDRESS,RAFT_PEERS→HG_PD_RAFT_PEERS_LIST,PD_INITIAL_STORE_LIST→HG_PD_INITIAL_STORE_LIST. Old names are mapped only when new names are unset, with a warning. Missing required variables cause the entrypoint to exit with code 2.
Store Variables
| Variable | Required | Default | Configuration mapping |
|---|---|---|---|
HG_STORE_PD_ADDRESS | Yes | None | pdserver.address |
HG_STORE_GRPC_HOST | Yes | None | grpc.host |
HG_STORE_RAFT_ADDRESS | Yes | None | raft.address |
HG_STORE_GRPC_PORT | No | 8500 | grpc.port |
HG_STORE_REST_PORT | No | 8520 | server.port |
HG_STORE_DATA_PATH | No | /hugegraph-store/storage | app.data-path |
Deprecated aliases:
PD_ADDRESS→HG_STORE_PD_ADDRESS,GRPC_HOST→HG_STORE_GRPC_HOST,RAFT_ADDRESS→HG_STORE_RAFT_ADDRESS.
Server Variables
Unlike PD and Store, Server has no mandatory entrypoint variables: only set values are written to configuration. Distributed deployment nevertheless requires at least HG_SERVER_BACKEND and HG_SERVER_PD_PEERS.
| Variable | Default | Configuration mapping |
|---|---|---|
HG_SERVER_BACKEND | Template value (rocksdb, or hstore in hugegraph/server) | backend in conf/graphs/hugegraph.properties |
HG_SERVER_PD_PEERS | None | pd.peers in hugegraph.properties and rest-server.properties |
HG_SERVER_USE_PD | false | usePD in rest-server.properties |
HG_SERVER_CLUSTER | hg-test | cluster in rest-server.properties |
HG_SERVER_REST_URL | http://0.0.0.0:8080 (set in the image) | restserver.url |
HG_SERVER_MIN_FREE_MEMORY | 64(MB) | restserver.min_free_memory |
HG_SERVER_INIT_STORE_ENABLED | true | init_store.enabled; set false for PD/HStore deployments whose metadata is managed by storage |
HG_SERVER_AUTH_TOKEN_SECRET | Generated when PASSWORD is set | auth.token_secret in both configuration files; at least 32 bytes |
HG_SERVER_REQUIRE_AUTH_TOKEN_SECRET | false | When true, refuse startup if PASSWORD is set without HG_SERVER_AUTH_TOKEN_SECRET |
PASSWORD | None | auth.admin_pa; runs bin/enable-auth.sh to enable authentication |
PRELOAD | None | When true, preload the example graph from scripts/example.groovy |
JAVA_OPTS | Set in the image | Passed to bin/start-hugegraph.sh -j |
HG_SERVER_STARTUP_TIMEOUT_S | 120 seconds | Passed to bin/start-hugegraph.sh -t, range 1–86400; see Server startup timeout below |
STORE_REST | store:8520 | Store REST address polled by wait-partition.sh, for HStore only |
HG_SERVER_PD_REST_ENDPOINT | Derived from pd.peers by replacing :8686 with :8620 | PD REST address polled by wait-storage.sh |
PD_AUTH_USER | store | Basic username for PD REST calls from wait-storage.sh |
PD_AUTH_PASSWORD | Empty | PD REST Basic password; must match HG_PD_AUTH_SECRET_KEY when PD REST authentication is enabled |
WAIT_PARTITION_TIMEOUT_S | 120 | Partition allocation wait time in wait-partition.sh |
Deprecated aliases:
BACKEND→HG_SERVER_BACKEND,PD_PEERS→HG_SERVER_PD_PEERS.
wait-storage.sh waits up to 300 seconds for an Up Store. This duration is hardcoded and cannot be changed through environment variables.
HG_SERVER_INIT_STORE_ENABLED accepts only the case-insensitive boolean values recognized by HugeConfig: y, t, yes, on, true, n, f, no, off, false. Other values, including 0 and 1, terminate the entrypoint.
After successful initialization, the entrypoint writes docker/init_complete; later starts skip reinitialization but still invoke bin/init-store.sh to revalidate configuration each time initialization is disabled.
Compose Variables
Compose files, rather than entrypoints, read these variables:
| Variable | Default | Purpose |
|---|---|---|
HUGEGRAPH_VERSION | latest | Server, PD, and Store image tag |
HUGEGRAPH_PULL_POLICY | missing | Image pull_policy; use never to retain locally built images |
HUBBLE_IMAGE | hugegraph/hubble:latest | Hubble image, selected independently of HUGEGRAPH_VERSION |
HUBBLE_PULL_POLICY | missing | Hubble image pull_policy |
HUBBLE_PUBLISH_HOST | 127.0.0.1 | Host interface for publishing Hubble port 8088 |
HUGEGRAPH_ADMIN_PASSWORD | None | Passed to Server as PASSWORD |
HUGEGRAPH_AUTH_TOKEN_SECRET | None | Master Compose passes this to Server as HG_SERVER_AUTH_TOKEN_SECRET; the 1.7.0 image ignores it |
HG_PD_AUTH_SECRET_KEY | None | HStore PD REST Basic password; Compose supplies it to PD and Server and uses it to generate local Hubble configuration |
Port Reference
Published ports in the three-node cluster:
| Service | Host port | Container port | Purpose |
|---|---|---|---|
| pd0 | 8620 | 8620 | REST API |
| pd0 | 8686 | 8686 | gRPC |
| pd1 | 8621 | 8620 | REST API |
| pd1 | 8687 | 8686 | gRPC |
| pd2 | 8622 | 8620 | REST API |
| pd2 | 8688 | 8686 | gRPC |
| store0 | 8500 | 8500 | gRPC |
| store0 | 8510 | 8510 | Raft |
| store0 | 8520 | 8520 | REST API |
| store1 | 8501 | 8500 | gRPC |
| store1 | 8511 | 8510 | Raft |
| store1 | 8521 | 8520 | REST API |
| store2 | 8502 | 8500 | gRPC |
| store2 | 8512 | 8510 | Raft |
| store2 | 8522 | 8520 | REST API |
| server0 | 8080 | 8080 | Graph API |
| server1 | 8081 | 8080 | Graph API |
| server2 | 8082 | 8080 | Graph API |
| hubble | 8088 | 8088 | Hubble UI, bound to 127.0.0.1 by default |
Standalone publishes only 8080 and 8088; minimal HStore publishes 8620 (PD REST), 8520 (Store REST), 8080, and 8088. PD Raft uses internal port 8610, unpublished in all topologies.
Troubleshooting
Container OOM exit (code 137): Increase Docker Desktop memory beyond 12 GB or adjust JVM memory for the killed process.
Raft election timeout: Verify every PD node has the same
HG_PD_RAFT_PEERS_LIST. Check connectivity withdocker exec hg-pd0 ping pd1.Partition allocation incomplete: Load
.envindocker/, then check Store registration with PD REST Basic authentication:PD can complete partition allocation once all three Stores report
"state":"Up".Connection refused: Use container hostnames (
pd0,store0) inHG_*variables rather than127.0.0.1.Unexpected retained data:
docker compose downkeeps named volumes. To delete topology data too, usedocker compose down -v.
Runtime logs: docker logs <container-name> (for example, docker logs hg-pd0) shows logs without entering containers. Standalone hugegraph/hugegraph sets STDOUT_MODE=true and sends service logs to stdout. The HStore hugegraph/server image does not set this variable: docker logs shows only entrypoint output; inspect logs/hugegraph-server.log inside the container for service logs.
Container Monitoring and Health Checks
Version scope: This section describes current master Docker images; these behaviors are not included in 1.7.0 images. Use the master-built
localimages above or alatestimage containing these changes.
Process Monitoring
Previously, all three entrypoints ended with tail -f /dev/null, keeping containers alive even after Java crashed. Because containers never exited, Docker’s restart: unless-stopped policy did not trigger.
Entrypoints now monitor Java directly:
- PD and Store: The entrypoint passes
-d falseto the startup script, which replaces itself with Java usingexec. When Java exits, the container exits immediately and Docker’s restart policy applies. - Server: The entrypoint waits with
tail --pid=$PID -f /dev/null.SIGTERM/SIGINTtraps forward Docker stop signals to Java and wait for graceful shutdown (exit 0). If Java crashes, the entrypoint exits with code 1, triggering the restart policy. - PID 1 in every image is
dumb-init, which forwards Docker signals to the entrypoint.
Server Startup Timeout
HG_SERVER_STARTUP_TIMEOUT_S controls how long the Server startup script waits for a REST response; the default is 120 seconds. Values must be decimal integers without leading zeros, from 1 to 86400 seconds. Empty strings, 0, negative numbers, fractions, and out-of-range values log an error and exit with code 1.
The entrypoint passes this value to bin/start-hugegraph.sh -t. If Server does not become ready within the deadline or exits early, startup fails and the container exits with code 1; its restart policy may restart it. This duration excludes earlier storage initialization and backend readiness waits.
For example, from the HugeGraph repository’s docker/ directory, extend the standalone Server wait to 300 seconds (Compose passes this variable to the container):
This setting is independent of Docker health-check start_period, interval, timeout, and retries. Those determine when a container becomes unhealthy; extending health-check grace periods does not extend the startup script deadline. Adjusting this variable does not update health-check settings, so check both for slow startup.
Health-Check Endpoints
All four master Docker images include HEALTHCHECK. docker ps displays health status. Failures during the 90-second startup grace period do not count; three consecutive failures afterward mark a container unhealthy.
| Image | Health-check endpoint | Port | Parameters |
|---|---|---|---|
hugegraph/hugegraph (standalone RocksDB Server) | GET /versions | 8080 | --interval=15s --timeout=10s --start-period=90s --retries=3 |
hugegraph/server (HStore Server) | GET /versions | 8080 | Same as above |
hugegraph/pd | GET /v1/health | 8620 | Same as above |
hugegraph/store | GET /v1/health | 8520 | Same as above |
Compose defines additional health checks, so --wait and depends_on: condition: service_healthy do not depend on image-level checks. Compose uses shorter startup periods (30–120 seconds depending on service and topology) and more retries.
Note: The cron-based
-m truemonitoring option instart-hugegraph.shis for VM/bare-metal deployments. Docker images neither install nor use it; use built-inHEALTHCHECKand Docker restart policies.
7 - FAQ
How to choose the back-end storage? RocksDB or distributed storage?
HugeGraph supports multiple deployment modes. Choose based on your data scale and scenario:
- Standalone Mode: Server + RocksDB, suitable for development, testing, Graph AI, and small to medium-scale production environments (≤ 2 TB)
- Distributed Mode: HugeGraph-PD + HugeGraph-Store (HStore), for deployments that require horizontal scaling and multiple replicas, supporting data scales up to 1 PB
Version 1.7.0 supports RocksDB, HStore, HBase, and Memory. Legacy backends such as Cassandra, ScyllaDB, MySQL, and PostgreSQL require version 1.5.x or earlier.
Prompt when starting the service:
xxx (core dumped) xxxFirst confirm that the JDK version is Java 11 or later. HugeGraph 1.7.0 no longer supports Java 8.
The service is started successfully, but there is a prompt similar to “Unable to connect to the backend or the connection is not open” when operating the graph
Persistent local backends such as RocksDB and HBase must be initialized with
init-storebefore their first startup. HStore is managed by PD and Store and does not use this script.Do all backends need to be executed before use init-store, and can the serialization options be filled in at will?
Memory and HStore do not use
init-store; persistent local backends such as RocksDB and HBase must be initialized before first use. The serializer must match the backend, for example RocksDB usesbinary.Execution
init-storeerror:Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni3226083071221514754.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.10' not found (required by /tmp/librocksdbjni3226083071221514754.so)RocksDB requires gcc 4.3.0 (GLIBCXX_3.4.10) and above
The
bindirectory containsstart-hugegraph.sh,start-restserver.shandstart-gremlinserver.sh. These scripts seem to be related to startup. Which one should be used?Current release packages retain only
start-hugegraph.shas the Server startup script. GremlinServer and the REST Server run in the same process.Two graphs are configured, the names are
hugegraphandhugegraph1, and the command to start the service isstart-hugegraph.sh. Is only the hugegraph graph opened?The script name is unrelated to the graph name. Server scans and loads local graph configurations from
conf/graphsby default; change the directory withgraphsinconf/rest-server.properties.graph.load_from_local_configdefaults tofalseand controls only constructor preloading and rescanning onreload(), not whether startup loads local graphs. Give each local graph its own configuration file. See the Server configuration guide.After the service starts successfully, garbled characters are returned when using
curlto query all verticesThe batch vertices/edges returned by the server are compressed (gzip), and can be redirected to
gunzipfor decompression (curl http://example | gunzip), or can be sent with thepostmanofFirefoxor therestletplug-in of Chrome browser. request, the response data will be decompressed automatically.When using the vertex Id to query the vertex through the
RESTful API, it returns empty, but the vertex does existCheck the type of the vertex ID. If it is a string type, the “id” part of the API URL needs to be enclosed in double quotes, while for numeric types, it is not necessary to enclose the ID in quotes.
Vertex Id has been double quoted as required, but querying the vertex via the RESTful API still returns empty
Check whether the vertex id contains
+,space,/,?,%,&, and=reserved characters of theseURLs. If they exist, they need to be encoded. The following table gives the coded values:Timeout when querying vertices or edges of a certain category (
query by label)Since the amount of data belonging to a certain label may be relatively large, please add a limit limit.
It is possible to operate the graph through the
RESTful API, but when sendingGremlinstatements, an error is reported:Request Failed(500)It may be that the configuration of
GremlinServeris wrong, check whether thehostandportofgremlin-server.yamlmatch thegremlinserver.urlofrest-server.properties, if they do not match, modify them, and then Restart the service.When using
Loaderto import data, aSocket Timeoutexception occurs, and thenLoaderis interruptedContinuously importing data will put too much pressure on the
Server, which will cause some requests to time out. The pressure onServercan be appropriately relieved by adjusting the parameters ofLoader(such as: number of retries, retry interval, error tolerance, etc.), and reduce the frequency of this problem.How to delete all data from a graph
An administrator can call
DELETE /graphspaces/{graphspace}/graphs/{graph}/clear?confirm_message=I'm sure to delete all data. Theconfirm_messagequery parameter must match that value exactly, otherwise the request is rejected. See the Graph API for details. This operation removes schemas, vertices, edges, and indexes.The database has been cleared and
init-storehas been executed, but when trying to add a schema, the prompt “xxx has existed” appeared.There is a cache in the
HugeGraphServer, and it is necessary to restart theServerwhen the database is cleared, otherwise the residual cache will be inconsistent.An error is reported during the process of inserting vertices or edges:
The max length of vertex id is 16384, but got xxx {yyy}orThe max length of edge id is 65536, but got xxx {yyy}In order to ensure query performance, the current backend storage limits the length of the id column. The vertex id cannot exceed 16384 bytes and the edge id cannot exceed 65536 bytes. An index id longer than 32 bytes is stored as a hash instead of being rejected.
Is there support for nested attributes, and if not, are there any alternatives?
Nested attributes are currently not supported. Alternative: Nested attributes can be taken out as individual vertices and connected with edges.
Can an
EdgeLabelconnect multiple pairs ofVertexLabel, such as “investment” relationship, which can be “individual” investing in “enterprise”, or “enterprise” investing in “enterprise”?Yes. Call
link(sourceLabel, targetLabel)once per pair when building theEdgeLabel; every pair is kept, so one “investment” label can cover both “individual” to “enterprise” and “enterprise” to “enterprise”. The oldersourceLabel()andtargetLabel()builder methods are deprecated and accept only a single pair.Prompt
HTTP 415 Unsupported Media Typewhen sending a request throughRestAPIContent-Type: application/jsonneeds to be specified in the request header
Other issues can be searched in the issue area of the corresponding project, such as Server-Issues / Loader Issues
8 - Security Report
Reporting New Security Problems with Apache HugeGraph
Production security requirements
HugeGraph disables user authentication by default. In production, enable authentication and authorization, set white_ip.status=enable, maintain the IP allowlist, and grant minimum permissions. Do not expose Gremlin, Cypher, or other query endpoints directly to the public network. See the IP allowlist API. Isolate the Server process, for example with Docker or Kubernetes.
Standard Server configuration writes authentication-proxy audit records to audit-*.log. Retain these files and restrict read access. auth.audit_log_rate controls the maximum per-user log output rate rather than serving as a dedicated audit-log on/off switch.
Vulnerability reporting scope
The community has received many reports about the flexibility of graph query languages. Until the security architecture is refactored, known risks from DSL queries executed with Auth disabled or deliberately skipped, outside an authorized session, will not be treated individually as new vulnerabilities.
Exploitation through anonymous or unauthorized access despite Auth being enabled, or bypassing an IP allowlist or escaping a container to cause serious privilege violations or system compromise, remains a high-risk security vulnerability. Please report these cases to the community.
Following ASF procedures, the HugeGraph community actively works to resolve security issues.
Report security issues privately to the dedicated security list first. See the ASF security procedures for details.
The security list handles undisclosed vulnerabilities and their resolution. Report ordinary software bugs through GitHub Issues/Discussions or the developer mailing list. Messages unrelated to security sent to the security list will be ignored.
Security mailing list: security@hugegraph.apache.org
The general vulnerability-handling process is:
- The reporter privately sends the HugeGraph security list the affected versions, description, reproduction steps, and impact.
- The project security team works privately with the reporter on a fix. A
CVEidentifier can be requested after initial confirmation. - The project releases an updated version of the affected software containing the fix.
- At an appropriate time, the project discloses the general issue and how to apply the fix, following ASF rules and omitting sensitive reproduction details.
- CVE publication and related steps follow the ASF security procedures.
Known Security Vulnerabilities (CVEs)
HugeGraph main repository (Server/PD/Store)
- CVE-2024-27348: HugeGraph-Server - Command execution in gremlin
- CVE-2024-27349: HugeGraph-Server - Bypass whitelist in Auth mode
- CVE-2024-43441: HugeGraph-Server - Fixed JWT Token (Secret)
- CVE-2025-26866: HugeGraph-Server - RAFT and deserialization vulnerability
HugeGraph-Toolchain repository (Hubble/Loader/Client/Tools/..)
- CVE-2024-27347: HugeGraph-Hubble - SSRF in Hubble connection page