Skip to content

Commit 126885d

Browse files
authored
docs(store): update guidance for store module (#2894)
1 parent 5b3d295 commit 126885d

File tree

7 files changed

+425
-423
lines changed

7 files changed

+425
-423
lines changed

hugegraph-store/README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,12 @@ From the project root:
104104
mvn install -pl hugegraph-struct -am -DskipTests
105105

106106
# Build Store and all dependencies
107-
mvn clean package -pl hugegraph-store -am -DskipTests
108-
```
109-
110-
Or build from the `hugegraph-store` directory:
111-
112-
```bash
113-
cd hugegraph-store
114-
mvn clean install -DskipTests
107+
mvn clean package -pl hugegraph-store/hugegraph-store-dist -am -DskipTests
115108
```
116109

117110
The assembled distribution will be available at:
118111
```
119-
hugegraph-store/hg-store-dist/target/apache-hugegraph-store-incubating-<version>.tar.gz
112+
hugegraph-store/apache-hugegraph-store-incubating-1.7.0/lib/hg-store-node-1.7.0.jar```
120113
```
121114

122115
### Configuration
@@ -220,8 +213,8 @@ For detailed configuration options, RocksDB tuning, and deployment topologies, s
220213
Start the Store server:
221214

222215
```bash
223-
tar -xzf apache-hugegraph-store-incubating-<version>.tar.gz
224-
cd apache-hugegraph-store-incubating-<version>
216+
# Replace {version} with your hugegraph version
217+
cd apache-hugegraph-store-incubating-{version}
225218
226219
# Start Store node
227220
bin/start-hugegraph-store.sh
@@ -258,13 +251,13 @@ ps aux | grep hugegraph-store
258251
grpcurl -plaintext localhost:8500 list
259252
260253
# Check REST API health
261-
curl http://localhost:8520/actuator/health
254+
curl http://localhost:8520/v1/health
262255
263256
# Check logs
264257
tail -f logs/hugegraph-store.log
265258
266259
# Verify registration with PD (from PD node)
267-
curl http://localhost:8620/pd/v1/stores
260+
curl http://localhost:8620/v1/stores
268261
```
269262

270263
For production deployment, see [Deployment Guide](docs/deployment-guide.md) and [Best Practices](docs/best-practices.md).
@@ -307,14 +300,12 @@ bin/start-hugegraph.sh
307300

308301
```bash
309302
# Check backend via REST API
310-
curl http://localhost:8080/graphs/<graph-name>/backend
311-
303+
curl --location --request GET 'http://localhost:8080/metrics/backend' \
304+
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
312305
# Response should show:
313306
# {"backend": "hstore", "nodes": [...]}
314307
```
315308

316-
For detailed integration steps, client API usage, and migration from other backends, see [Integration Guide](docs/integration-guide.md).
317-
318309
---
319310

320311
## Testing

hugegraph-store/docs/best-practices.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,12 @@ grpc:
345345
bin/enable-auth.sh
346346
347347
# Configure users and roles via REST API
348-
curl -X POST http://localhost:8080/graphs/hugegraph/auth/users \
349-
-H "Content-Type: application/json" \
350-
-d '{
351-
"user_name": "admin",
352-
"user_password": "password123",
353-
"user_role": "admin"
354-
}'
348+
curl -X POST "http://localhost:8080/graphspaces/{graph_spcace_name}/graphs/{graph}/auth/users" \
349+
-H "Content-Type: application/json" \
350+
-d '{
351+
"user_name": "admin",
352+
"user_password": "password123"
353+
}'
355354
```
356355

357356
### Data Encryption

hugegraph-store/docs/deployment-guide.md

Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,34 @@ curl http://localhost:8620/actuator/health
471471

472472
```bash
473473
# Check cluster members
474-
curl http://192.168.1.10:8620/pd/v1/members
474+
curl http://192.168.1.10:8620/v1/members
475475
476476
# Expected output:
477-
# {
478-
# "members": [
479-
# {"id": "1", "name": "pd-1", "address": "192.168.1.10:8686"},
480-
# {"id": "2", "name": "pd-2", "address": "192.168.1.11:8686"},
481-
# {"id": "3", "name": "pd-3", "address": "192.168.1.12:8686"}
482-
# ],
483-
# "leader": "1"
484-
# }
477+
{
478+
"message":"OK",
479+
"data":{
480+
"pdLeader":null,
481+
"pdList":[{
482+
"raftUrl":"127.0.0.1:8610",
483+
"grpcUrl":"",
484+
"restUrl":"",
485+
"state":"Offline",
486+
"dataPath":"",
487+
"role":"Leader",
488+
"replicateState":"",
489+
"serviceName":"-PD",
490+
"serviceVersion":"1.7.0",
491+
"startTimeStamp":1761818483830
492+
}],
493+
"stateCountMap":{
494+
"Offline":1
495+
},
496+
"numOfService":1,
497+
"state":"Cluster_OK",
498+
"numOfNormalService":0
499+
},
500+
"status":0
501+
}
485502
```
486503

487504
---
@@ -560,23 +577,45 @@ bin/start-hugegraph-store.sh
560577
tail -f logs/hugegraph-store.log
561578
562579
# Verify Store is running
563-
curl http://localhost:8520/actuator/health
580+
curl http://localhost:8520/v1/health
564581
```
565582

566583
**Verify Store registration with PD**:
567584

568585
```bash
569586
# Query PD for registered stores
570-
curl http://192.168.1.10:8620/pd/v1/stores
587+
curl http://192.168.1.10:8620/v1/stores
571588
572589
# Expected output:
573-
# {
574-
# "stores": [
575-
# {"id": "1", "address": "192.168.1.20:8500", "state": "Online"},
576-
# {"id": "2", "address": "192.168.1.21:8500", "state": "Online"},
577-
# {"id": "3", "address": "192.168.1.22:8500", "state": "Online"}
578-
# ]
579-
# }
590+
{
591+
"message":"OK",
592+
"data":{
593+
"stores":[{
594+
"storeId":"1783423547167821026",
595+
"address":"192.168.1.10:8500",
596+
"raftAddress":"192.168.1.10:8510",
597+
"version":"","state":"Up",
598+
"deployPath":"/Users/user/incubator-hugegraph/hugegraph-store/hg-store-node/target/classes/",
599+
"dataPath":"./storage",
600+
"startTimeStamp":1761818547335,
601+
"registedTimeStamp":1761818547335,
602+
"lastHeartBeat":1761818727631,
603+
"capacity":245107195904,
604+
"available":118497292288,
605+
"partitionCount":0,
606+
"graphSize":0,
607+
"keyCount":0,
608+
"leaderCount":0,
609+
"serviceName":"192.168.1.10:8500-store",
610+
"serviceVersion":"",
611+
"serviceCreatedTimeStamp":1761818547000,
612+
"partitions":[]}],
613+
"stateCountMap":{"Up":1},
614+
"numOfService":1,
615+
"numOfNormalService":1
616+
},
617+
"status":0
618+
}
580619
```
581620

582621
---
@@ -904,47 +943,45 @@ kubectl port-forward svc/hugegraph-store 8500:8500 -n hugegraph
904943

905944
```bash
906945
# PD health
907-
curl http://192.168.1.10:8620/actuator/health
946+
curl http://192.168.1.10:8620/v1/health
908947
909948
# Store health
910-
curl http://192.168.1.20:8520/actuator/health
911-
912-
# Server health
913-
curl http://192.168.1.30:8080/actuator/health
949+
curl http://192.168.1.20:8520/v1/health
914950
```
915951

916952
### Cluster Status
917953

918954
```bash
919955
# PD cluster members
920-
curl http://192.168.1.10:8620/pd/v1/members
956+
curl http://192.168.1.10:8620/v1/members
921957
922958
# Registered stores
923-
curl http://192.168.1.10:8620/pd/v1/stores
959+
curl http://192.168.1.10:8620/v1/stores
924960
925961
# Partitions
926-
curl http://192.168.1.10:8620/pd/v1/partitions
962+
curl http://192.168.1.10:8620/v1/partitions
927963
928964
# Graph list
929-
curl http://192.168.1.30:8080/graphs
965+
curl http://192.168.1.10:8620/v1/graphs
930966
```
931967

932968
### Basic Operations Test
933969

934970
```bash
935971
# Create vertex via Server
936-
curl -X POST http://192.168.1.30:8080/graphs/hugegraph/graph/vertices \
937-
-H "Content-Type: application/json" \
938-
-d '{
939-
"label": "person",
940-
"properties": {
941-
"name": "Alice",
942-
"age": 30
943-
}
944-
}'
945-
946-
# Query vertex
947-
curl http://192.168.1.30:8080/graphs/hugegraph/graph/vertices
972+
curl -X POST "http://192.168.1.30:8080/graphspaces/{graphspace_name}/graphs/{graph_name}/graph/vertices" \
973+
-H "Content-Type: application/json" \
974+
-d '{
975+
"label": "person",
976+
"properties": {
977+
"name": "marko",
978+
"age": 29
979+
}
980+
}'
981+
982+
# Query vertex (using -u if auth is enabled)
983+
curl -u admin:admin \
984+
-X GET "http://localhost:8080/graphspaces/{graphspace_name}/graphs/graphspace_name}/graph/vertices/{graph_id}
948985
```
949986

950987
### Performance Baseline Test

hugegraph-store/docs/development-guide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ cd hugegraph-store/hg-store-dist/target/apache-hugegraph-store-incubating-1.7.0
220220
bin/start-hugegraph-store.sh
221221
```
222222

223+
If you want to run store module in debug mode
224+
Directly run HgStoreNodeService in your IDE (ensure PD is on).
223225
---
224226

225227
## Build and Test
@@ -823,7 +825,7 @@ cd install-dist/scripts/dependency
823825
- Slack: (link in project README)
824826

825827
**Related Projects**:
826-
- Apache JRaft: https://github.com/sofastack/sofa-jraft
828+
- SOFA-JRaft: https://github.com/sofastack/sofa-jraft
827829
- RocksDB: https://rocksdb.org/
828830
- gRPC: https://grpc.io/docs/languages/java/
829831

hugegraph-store/docs/distributed-architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ HugeGraph Store follows a layered architecture with clear separation of responsi
200200

201201
## Raft Consensus Mechanism
202202

203-
HugeGraph Store uses **Apache JRaft** (Ant Financial's Raft implementation) to achieve strong consistency and high availability.
203+
HugeGraph Store uses **Sofa-JRaft** (Ant Financial's Raft implementation) to achieve strong consistency and high availability.
204204

205205
### Raft per Partition Design
206206

207-
Unlike some distributed systems that use a single Raft group for the entire cluster, HugeGraph Store uses **one Raft group per partition**:
207+
Unlike some distributed systems that use a single Raft group for the entire cluster, HugeGraph Store uses MultiRaft:
208208

209209
```
210210
Store Cluster (3 nodes: S1, S2, S3)

0 commit comments

Comments
 (0)