Skip to content
41 changes: 31 additions & 10 deletions content/cn/docs/clients/restful-api/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/clear?confirm_
##### Method & Url

```
POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_graph_name=hugegraph
POST http://localhost:8080/graphspaces/DEFAULT/graphs/cloneGraph?clone_graph_name=hugegraph
```

##### Request Body (可选)
Expand All @@ -124,7 +124,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_grap
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"backend": "rocksdb",
"serializer": "binary",
"store": "hugegraph_clone",
"store": "cloneGraph",
"rocksdb.data_path": "./rks-data-xx",
"rocksdb.wal_path": "./rks-data-xx"
}
Expand All @@ -144,7 +144,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_grap

```javascript
{
"name": "hugegraph_clone",
"name": "cloneGraph",
"backend": "rocksdb"
}
```
Expand All @@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx

##### Request Body

创建一个非鉴权模式的图(设置 `Content-Type: application/json`)
创建一个图(设置 `Content-Type: application/json`)

**`gremlin.graph` 配置说明:**
- 鉴权模式:`"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"`(推荐)
- 非鉴权模式:`"gremlin.graph": "org.apache.hugegraph.HugeFactory"`

**注意**!!
1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。
2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note mentions "1.7.0 及之前版本" (version 1.7.0 and earlier) but the first point says "在 1.7.0 版本中" (in version 1.7.0) the issue exists and "1.7.0 之前的版本不受此问题影响" (versions before 1.7.0 are not affected). This creates confusion about whether version 1.7.0 itself has the issue. If only 1.7.0 has the issue, then point 2 should say "1.7.0 版本" not "1.7.0 及之前版本".

Copilot uses AI. Check for mistakes.

**RocksDB 示例:**

```json
{
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy",
"backend": "rocksdb",
"serializer": "binary",
"store": "hugegraph",
Expand All @@ -179,9 +189,20 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx
}
```

> Note:
> 1. Rocksdb 存储路径不能与现有图相同(需使用不同的目录)
> 2. 如需开启新图的权限系统,需替换设置 `gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy`
**HStore 示例(适用于 1.7.0 及之前版本):**

```json
{
"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}
```

> Note: Rocksdb 存储路径不能与现有图相同(需使用不同的目录)

##### Response Status

Expand Down Expand Up @@ -216,7 +237,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx
##### Method & Url

```javascript
DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/graphA?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
```

##### Response Status
Expand Down Expand Up @@ -486,4 +507,4 @@ PUT http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/compact
"local": "OK"
}
}
```
```
21 changes: 21 additions & 0 deletions content/cn/docs/quickstart/hugegraph/hugegraph-server.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码层面默认不携带 http:// 前缀, 作为默认 prefix_scheme

当用户自己指定 https 或其他 scheme 再覆盖

doc 之后统一为 ip+port 默认值

Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,29 @@ task.scheduler_type=distributed
pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
```

```properties
# 简单示例(带鉴权)
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy

# 指定存储 hstore(必须)
backend=hstore
serializer=binary
store=hugegraph

# 指定任务调度器(1.7.0及之前必须)
task.scheduler_type=distributed

# pd config
pd.peers=127.0.0.1:8686
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Minor - Missing pd.peers explanation in simplified example

The comment says "pd config" but doesn't explain what pd.peers is or how to configure it for different scenarios (single PD vs multiple PD nodes).

Suggestion:

# PD 配置(必须)- 配置 PD 服务的地址和 RPC 端口
# 单个 PD 节点时配置一个地址,多个 PD 节点时用逗号分隔
pd.peers=127.0.0.1:8686

```

2. 修改 HugeGraph-Server 的 `rest-server.properties` 配置:

```properties
usePD=true

# 若需要 auth
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "若需要 auth" (if auth is needed) but should be more specific. The English version says "If auth is needed" which is also vague. Both should clarify when authentication is actually needed or recommended, matching the context from the examples which use auth mode by default.

Suggested change
# 若需要 auth
# 在生产环境或需要访问控制/多租户隔离时,建议启用鉴权功能,可取消注释并配置如下:

Copilot uses AI. Check for mistakes.
# auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator
```

如果配置多个 HugeGraph-Server 节点,需要为每个节点修改 `rest-server.properties` 配置文件,例如:
Expand All @@ -213,6 +232,7 @@ usePD=true
usePD=true
restserver.url=http://127.0.0.1:8081
gremlinserver.url=http://127.0.0.1:8181
pd.peers=127.0.0.1:8686

rpc.server_host=127.0.0.1
rpc.server_port=8091
Expand All @@ -226,6 +246,7 @@ server.role=master
usePD=true
restserver.url=http://127.0.0.1:8082
gremlinserver.url=http://127.0.0.1:8182
pd.peers=127.0.0.1:8686

rpc.server_host=127.0.0.1
rpc.server_port=8092
Expand Down
45 changes: 33 additions & 12 deletions content/en/docs/clients/restful-api/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/clear?confirm_
##### Method & Url

```
POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_graph_name=hugegraph
POST http://localhost:8080/graphspaces/DEFAULT/graphs/cloneGraph?clone_graph_name=hugegraph
```

##### Request Body [Optional]
Expand All @@ -124,13 +124,13 @@ Clone a `non-auth` mode graph (set `Content-Type: application/json`)
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"backend": "rocksdb",
"serializer": "binary",
"store": "hugegraph",
"store": "cloneGraph",
"rocksdb.data_path": "./rks-data-xx",
"rocksdb.wal_path": "./rks-data-xx"
}
```

> Note:
> Note:
> 1. The data/wal_path can't be the same as the existing graph (use separate directories)
> 2. Replace "gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy" to enable auth mode

Expand All @@ -142,10 +142,10 @@ Clone a `non-auth` mode graph (set `Content-Type: application/json`)

##### Response Body

```javascript
```json
{
"name": "hugegraph_clone",
"backend": "rocksdb"
"name": "cloneGraph",
"backend": "rocksdb"
}
```

Expand All @@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph2

##### Request Body

Create a non-auth graph (set `Content-Type: application/json`)
Create a graph (set `Content-Type: application/json`)

**`gremlin.graph` Configuration:**
- Auth mode: `"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"` (Recommended)
- Non-auth mode: `"gremlin.graph": "org.apache.hugegraph.HugeFactory"`

**Note**!!
1. In version 1.7.0, dynamic graph creation would cause a NPE. This issue has been fixed in [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912). The current master version and versions after 1.7.0 do not have this problem.
2. For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore).
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note mentions "For version 1.7.0 and earlier" but point 1 states that the NPE issue exists in version 1.7.0 and that "versions after 1.7.0 do not have this problem." This creates confusion about whether versions before 1.7.0 also need the workaround. If only 1.7.0 has the issue, then this should say "For version 1.7.0" not "For version 1.7.0 and earlier".

Copilot uses AI. Check for mistakes.

**RocksDB Example:**

```json
{
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy",
"backend": "rocksdb",
"serializer": "binary",
"store": "hugegraph2",
Expand All @@ -179,9 +189,20 @@ Create a non-auth graph (set `Content-Type: application/json`)
}
```

> Note:
> 1. The data/wal_path can't be the same as the existing graph (use separate directories)
> 2. Replace "gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy" to enable auth mode
**HStore Example (for version 1.7.0 and earlier):**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 英文版 HStore 示例标题需要补充版本说明

与中文版类似,英文版的 HStore 示例也需要明确版本适用范围。

建议修改:

Suggested change
**HStore Example (for version 1.7.0 and earlier):**
**HStore Example (for version 1.7.0 and earlier - non-auth mode):**

或提供 1.7.0+ 版本的示例(建议同时提供两个版本的示例)。


```json
{
"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}
```

> Note: The data/wal_path can't be the same as the existing graph (use separate directories)

##### Response Status

Expand Down Expand Up @@ -216,7 +237,7 @@ Since deleting a graph is a dangerous operation, we have added parameters for co
##### Method & Url

```
DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/graphA?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
```

##### Response Status
Expand Down
19 changes: 19 additions & 0 deletions content/en/docs/quickstart/hugegraph/hugegraph-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,27 @@ task.scheduler_type=distributed
pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
```

```properties
# Simple example (with authentication)
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy

# Specify storage backend hstore
backend=hstore
serializer=binary
store=hugegraph
task.scheduler_type=distributed

# pd config
pd.peers=127.0.0.1:8686
```

Then enable PD discovery in `rest-server.properties` (required for every HugeGraph-Server node):

```properties
usePD=true

# If auth is needed
# auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator
```

If configuring multiple HugeGraph-Server nodes, you need to modify the `rest-server.properties` configuration file for each node, for example:
Expand All @@ -229,6 +246,7 @@ Node 1 (Master node):
usePD=true
restserver.url=http://127.0.0.1:8081
gremlinserver.url=http://127.0.0.1:8181
pd.peers=127.0.0.1:8686

rpc.server_host=127.0.0.1
rpc.server_port=8091
Expand All @@ -242,6 +260,7 @@ Node 2 (Worker node):
usePD=true
restserver.url=http://127.0.0.1:8082
gremlinserver.url=http://127.0.0.1:8182
pd.peers=127.0.0.1:8686

rpc.server_host=127.0.0.1
rpc.server_port=8092
Expand Down