Skip to content

Version 1.5 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

HugeGraph-PD Quick Start

1 HugeGraph-PD Overview

HugeGraph-PD (Placement Driver) is the metadata management component of HugeGraph’s distributed version, responsible for managing the distribution of graph data and coordinating storage nodes. It plays a central role in distributed HugeGraph, maintaining cluster status and coordinating HugeGraph-Store storage nodes.

2 Prerequisites

2.1 Requirements

  • Operating System: Linux or MacOS (Windows has not been fully tested)
  • Java version: ≥ 11
  • Maven version: ≥ 3.5.0

3 Deployment

There are two ways to deploy the HugeGraph-PD component:

  • Method 1: Download the tar package
  • Method 2: Compile from source

3.1 Download the tar package

Download the latest version of HugeGraph-PD from the Apache HugeGraph official download page:

1# Replace {version} with the latest version number, e.g., 1.5.0
2wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-incubating-{version}.tar.gz  
3tar zxf apache-hugegraph-incubating-{version}.tar.gz
4cd apache-hugegraph-incubating-{version}/apache-hugegraph-pd-incubating-{version}

3.2 Compile from source

 1# 1. Clone the source code
 2git clone https://github.com/apache/hugegraph.git
 3
 4# 2. Build the project
 5cd hugegraph
 6mvn clean install -DskipTests=true
 7
 8# 3. After successful compilation, the PD module build artifacts will be located at
 9#    apache-hugegraph-incubating-{version}/apache-hugegraph-pd-incubating-{version}
10#    target/apache-hugegraph-incubating-{version}.tar.gz

4 Configuration

The main configuration file for PD is conf/application.yml. Here are the key configuration items:

 1spring:
 2  application:
 3    name: hugegraph-pd
 4
 5grpc:
 6  # gRPC port for cluster mode
 7  port: 8686
 8  host: 127.0.0.1
 9
10server:
11  # REST service port
12  port: 8620
13
14pd:
15  # Storage path
16  data-path: ./pd_data
17  # Auto-expansion check cycle (seconds)
18  patrol-interval: 1800
19  # Initial store list, stores in the list are automatically activated
20  initial-store-count: 1
21  # Store configuration information, format is IP:gRPC port
22  initial-store-list: 127.0.0.1:8500
23
24raft:
25  # Cluster mode
26  address: 127.0.0.1:8610
27  # Raft addresses of all PD nodes in the cluster
28  peers-list: 127.0.0.1:8610
29
30store:
31  # Store offline time (seconds). After this time, the store is considered permanently unavailable
32  max-down-time: 172800
33  # Whether to enable store monitoring data storage
34  monitor_data_enabled: true
35  # Monitoring data interval
36  monitor_data_interval: 1 minute
37  # Monitoring data retention time
38  monitor_data_retention: 1 day
39  initial-store-count: 1
40
41partition:
42  # Default number of replicas per partition
43  default-shard-count: 1
44  # Default maximum number of replicas per machine
45  store-max-shard-count: 12

For multi-node deployment, you need to modify the port and address configurations for each node to ensure proper communication between nodes.

5 Start and Stop

5.1 Start PD

In the PD installation directory, execute:

1./bin/start-hugegraph-pd.sh

After successful startup, you can see logs similar to the following in logs/hugegraph-pd-stdout.log:

12024-xx-xx xx:xx:xx [main] [INFO] o.a.h.p.b.HugePDServer - Started HugePDServer in x.xxx seconds (JVM running for x.xxx)

5.2 Stop PD

In the PD installation directory, execute:

1./bin/stop-hugegraph-pd.sh

6 Verification

Confirm that the PD service is running properly:

1curl http://localhost:8620/actuator/health

If it returns {"status":"UP"}, it indicates that the PD service has been successfully started.

Additionally, you can verify the status of the Store node by querying the PD API:

1curl http://localhost:8620/v1/stores

If the Store is configured successfully, the response of the above interface should contain the status information of the current node. The status “Up” indicates that the node is running normally. Only the response of one node configuration is shown here. If all three nodes are configured successfully and are running, the storeId list in the response should contain three IDs, and the Up, numOfService, and numOfNormalService fields in stateCountMap should be 3.

 1{
 2  "message": "OK",
 3  "data": {
 4    "stores": [
 5      {
 6        "storeId": 8319292642220586694,
 7        "address": "127.0.0.1:8500",
 8        "raftAddress": "127.0.0.1:8510",
 9        "version": "",
10        "state": "Up",
11        "deployPath": "/Users/{your_user_name}/hugegraph/apache-hugegraph-incubating-1.5.0/apache-hugegraph-store-incubating-1.5.0/lib/hg-store-node-1.5.0.jar",
12        "dataPath": "./storage",
13        "startTimeStamp": 1754027127969,
14        "registedTimeStamp": 1754027127969,
15        "lastHeartBeat": 1754027909444,
16        "capacity": 494384795648,
17        "available": 346535829504,
18        "partitionCount": 0,
19        "graphSize": 0,
20        "keyCount": 0,
21        "leaderCount": 0,
22        "serviceName": "127.0.0.1:8500-store",
23        "serviceVersion": "",
24        "serviceCreatedTimeStamp": 1754027127000,
25        "partitions": []
26      }
27    ],
28    "stateCountMap": {
29      "Up": 1
30    },
31    "numOfService": 1,
32    "numOfNormalService": 1
33  },
34  "status": 0
35}