Skip to content
33 changes: 27 additions & 6 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,7 +166,15 @@ 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.HugeFactory"`
- 鉴权模式:`"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"`

**注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。

**RocksDB 示例(非鉴权模式):**

```json
{
Expand All @@ -179,6 +187,19 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx
}
```

**HStore 示例:**
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ HStore 示例标题不够明确

第 190 行的标题 "HStore 示例:" 缺少版本和模式说明,用户无法清楚知道这个示例适用于什么场景。

建议修改:

Suggested change
**HStore 示例:**
**HStore 示例(非鉴权模式 - 仅适用于 1.7.0 及之前版本)**

或者,如果要提供 1.7.0+ 的示例,应该使用:

Suggested change
**HStore 示例:**
**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"
}
\`\`\`

Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The Chinese HStore example section title is missing version information for consistency with the English version. The English version says "HStore Example (for version 1.7.0 and earlier):" while the Chinese version only says "HStore 示例:". Consider adding version information like "HStore 示例(1.7.0 及之前):" to match the English documentation.

Suggested change
**HStore 示例:**
**HStore 示例(1.7.0 及之前)**

Copilot uses AI. Check for mistakes.

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

> Note:
> 1. Rocksdb 存储路径不能与现有图相同(需使用不同的目录)
> 2. 如需开启新图的权限系统,需替换设置 `gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy`
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
39 changes: 30 additions & 9 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,7 +166,15 @@ 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:**
- Non-auth mode: `"gremlin.graph": "org.apache.hugegraph.HugeFactory"`
- Auth mode: `"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"`

**Note**!! 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).

**RocksDB Example (non-auth mode):**

```json
{
Expand All @@ -179,7 +187,20 @@ Create a non-auth graph (set `Content-Type: application/json`)
}
```

> Note:
**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.HugeFactory",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}
```

> 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 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