Go to file
V_Galaxy 8c03d72744 chore: add flatten plugin and fix dependency version
* build: add flatten plugin and fix dependency version

* Update pom.xml

---------

Co-authored-by: imbajin <jin@apache.org>
2023-08-07 14:54:17 +08:00
.mvn/wrapper refact: rearrange code position 2023-04-26 13:00:11 +08:00
conf history merged until 2023.4.23 2023-04-23 10:41:18 +08:00
hg-store-cli chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-client chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-common chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-core chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-dist chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-grpc chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-node chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-rocksdb chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
hg-store-test chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
.gitattributes chore: add .gitattributes file to unify line separator & clean pom 2023-05-05 13:48:09 +08:00
.gitignore chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
LICENSE doc: add LICENSE & NOTICE file in root & dist module 2023-04-26 11:10:22 +08:00
NOTICE doc: add LICENSE & NOTICE file in root & dist module 2023-04-26 11:10:22 +08:00
README-dev.md refact: rearrange code position 2023-04-26 13:00:11 +08:00
README.md refact: rearrange code position 2023-04-26 13:00:11 +08:00
build-change.sh chore: add .gitattributes file to unify line separator & clean pom 2023-05-05 13:48:09 +08:00
build-pre.sh chore: add .gitattributes file to unify line separator & clean pom 2023-05-05 13:48:09 +08:00
build.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
ci.yml refact: rearrange code position 2023-04-26 13:00:11 +08:00
deploy-release.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
deploy-snapshot.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
init.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
local-release.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
lombok.config history merged until 2023.4.23 2023-04-23 10:41:18 +08:00
mvnw history merged until 2023.4.23 2023-04-23 10:41:18 +08:00
mvnw.cmd history merged until 2023.4.23 2023-04-23 10:41:18 +08:00
pom.xml chore: add flatten plugin and fix dependency version 2023-08-07 14:54:17 +08:00
run.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00
settings.xml chore: add .gitattributes file to unify line separator & clean pom 2023-05-05 13:48:09 +08:00
start_server.sh refact: add license header for root files & protobuf files 2023-04-26 11:10:09 +08:00

README.md

HStore存储部署说明

##安装etcd

  • 配置etcd时需要确保其他服务器可以访问注意配置文件中以下修改
  name: etcd-1 #节点名称
  data-dir: default.etcd/ #节点数据存储目录
  listen-client-urls: http://0.0.0.0:2379  #监听etcd客户发送信息的地址
  advertise-client-urls: http://0.0.0.0:2379  #客户与本节点交互信息所用地址

PD配置

  • 配置文件在application.yml
  grpc:
    port: 9000 #内部grpc通信用端口如心跳等使用
    max-inbound-message-size: 100MB #grpc最大入参的大小
  server:
    port : 9001 #restful端口如通过http的get方法获取storeNode信息(/v1/stores)等
  etcd:
    address: http://localhost:2379 #etcd地址
    timeout: 3  #etcd连接超时时间
  store:    
    keepAlive-timeout: 60 #store心跳超时时间超过该时间认为store临时不可用转移Leader到其他副本,单位秒
    down-time: 1800 #store下线时间。超过该时间认为store永久不可用分配副本到其他机器单位秒
  partition:    
    default-total-count: 12 #默认分区总数
    default-shard-count: 3 #默认每个分区副本数

StoreNode配置

  grpc:
    port: 9080    
    host: 127.0.0.1 #grpc的服务地址给HugeServer使用
    netty-server:
      max-inbound-message-size: 100MB #grpc最大入参的大小
  server:
    port : 9090 #restful端口如通过http的get方法获取监控统计信息(/metrics)等
  app:
    rocks:
      config-path: "/hugegraph.properties" #写入Rocksdb的参数配置文件
  raft:
    address: 127.0.0.1:8081 #raft通信地址
    data-path: /test/raft/8081 #raft日志写入目录
    timeout: 10 #raft读写超时时间,单位秒
    metrics: false #统计raft监控统计信息打开可能对性能有影响
  pdserver:
    address: localhost:9000 #PD的grpc地址

StoreNode在启动后如果在PD的日志中打印出其注册信息则代表注册成功Store register, id = **** address = ****

Hugegraph配置

  • 配置文件在properties文件如hugegraph.properties
  backend=hstore #后端分布式存储类型固定为hstore
  serializer=binary #序列化器固定为binary
  pd.peers=localhost:9000 #PD的grpc地址

RESTFUL API

  • pd提供了一些restful API可以获取分区、存储节点等一系列信息

###图相关

获取图的partition、shard信息

Method & Url
GET http://localhost:9001/v1/graphs
Response Status
200
Response Body
{
  "status": 0,
  "graphs": [
    {
      "graphName": "default/hugegraph/g",
      "partitionCount": 60,
      "shardCount": 3
    },
    {
      "graphName": "default/hugegraph/m",
      "partitionCount": 60,
      "shardCount": 3
    },
    {
      "graphName": "default/hugegraph/s",
      "partitionCount": 60,
      "shardCount": 3
    },
    {
      "graphName": "default/system/g",
      "partitionCount": 60,
      "shardCount": 3
    },
    {
      "graphName": "default/system/m",
      "partitionCount": 60,
      "shardCount": 3
    },
    {
      "graphName": "default/system/s",
      "partitionCount": 60,
      "shardCount": 3
    }
  ]
}

获取指定图的partition、shard信息

Method & Url
GET http://localhost:9001/v1/graph/default/hugegraph/g
Response Status
200
Response Body
{
  "status": 0,
  "graph": {
    "graphName": "default/hugegraph/g",
    "partitionCount": 60,
    "shardCount": 3
  }
}

修改指定图的partition、shard信息

Method & Url
POST http://localhost:9001/v1/graph/default/hugegraph/g
Request Body
{
  "partitionCount":90,
  "shardCount": 4,
  "workMode":"Batch_Import"
}
Response Status
200
Response Body
{
  "status": 0,
  "graph": {
    "graphName": "default/hugegraph/g",
    "partitionCount": 60,
    "shardCount": 4,
    "workMode": "Batch_Import"
  }
}

分区相关

获取分区信息

Method & Url
GET http://localhost:9001/v1/partitions
Response Status
200
Response Body
{
  "partitions": [
    { 
      "endKey": 2731,
      "graphName": "DEFAULT/hugegraph18e1/g",
      "id": 0,
      "shards": [
        {
          "address": "10.14.139.56:8500",
          "committedIndex": "7396553",
          "role": "Follower",
          "state": "online",
          "storeId": "6140115507143799097"
        },
        {
          "address": "10.14.139.61:8500",
          "committedIndex": "7399964",
          "role": "Follower",
          "state": "online",
          "storeId": "3661113370728329034"
        },
        {
          "address": "10.14.139.57:8500",
          "committedIndex": "7394615",
          "role": "Leader",
          "state": "online",
          "storeId": "3384290400781292563"
        }
      ],
      "startKey": 0,
      "timestamp": "2022-03-28 17:29:56",
      "version": 23,
      "workMode": "Normal",
      "workState": "State_Normal"
    }
  ],
  "status": 0
}

###存储节点相关

获取存储节点信息

Method & Url
GET http://localhost:9001/v1/stores
Response Status
200
Response Body
{
  "status": 0,
  "stores": [
    {
      "address": "10.14.139.60:8500",
      "dataVersion": 1,
      "id": "1779882393067551022",
      "labels": [
        {
          "key": "rest.port",
          "value": "8520"
        }
      ],
      "lastHeartbeat": "1648459470389",
      "raftAddress": "10.14.139.60:8510",
      "startTimestamp": "1648395903516",
      "state": "Up",
      "stats": {
        "available": "4081010491392",
        "capacity": "7545950388224",
        "graphStats": [
          {
            "approximateKeys": "1933169027",
            "approximateSize": "191628815980",
            "committedIndex": "7301460",
            "graphName": "DEFAULT/hugegraph18e1/g",
            "partitionId": 1,
            "role": "Leader",
            "workMode": "Normal",
            "workState": "State_Normal"
          },
          {
            "approximateKeys": "1919472248",
            "approximateSize": "189192672333",
            "committedIndex": "7301705",
            "graphName": "DEFAULT/hugegraph18e1/g",
            "partitionId": 2,
            "role": "Leader",
            "workMode": "Normal",
            "workState": "State_Normal"
          }
        ],
        "partitionCount": 12,
        "startTime": 1648395902,
        "storeId": "1779882393067551022",
        "usedSize": "4851786575920"
      },
      "version": "3.6.3"
    }
  ]
}

删除存储节点

Method & Url
DELETE http://localhost:9001/v1/store/2549332866463202176
Response Status
200
Response Body
OK

服务注册

Method & Url
post http://127.0.0.1:8620/v1/registry
Request Body
{
  "appName":"aaaa",
  "version":"version1",
  "address":"address1",
  "interval":"9223372036854775807",
  "labels": {
    "aaa": "aaaavalue"
  }
}
appName所属服务名
version所属服务版本号
address服务实例地址+端口
interval实例心跳间隔字符串最大9223372036854775807
labels: 自定义标签
Response Status
200
Response Body
{
	"errorType": "OK",
	"message": "",
	"data": null
}
errorType状态码
message状态码为错误时的具体出错信息
data无返回数据

服务实例获取

Method & Url
post http://127.0.0.1:8620/v1/registryInfo
Request Body
{
  "appName":"aaaa",
  "version":"version1",
  "labels": {
    "aaa": "aaaavalue"
  }
}
以下三项可全部为空,则获取所有服务节点的信息
    appName过滤所属服务名的条件
    version过滤所属服务版本号的条件此项有值则appName不能为空
    labels: 过滤自定义标签的条件
Response Status
200
Response Body
{
    "errorType": "OK",
    "message": null,
    "data": [
        {
            "id": null,
            "appName": "aaaa",
            "version": "version1",
            "address": "address1",
            "interval": "9223372036854775807",
            "labels": {
                "aaa": "aaaavalue"
            }
        }
    ]
}
errorType状态码
message状态码为错误时的具体出错信息
data获取的服务节点信息

服务注册

Method & Url
post http://127.0.0.1:8620/v1/registry
Request Body
{
  "appName":"aaaa",
  "version":"version1",
  "address":"address1",
  "interval":"9223372036854775807",
  "labels": {
    "aaa": "aaaavalue"
  }
}
appName所属服务名
version所属服务版本号
address服务实例地址+端口
interval实例心跳间隔字符串最大9223372036854775807
labels: 自定义标签
Response Status
200
Response Body
{
	"errorType": "OK",
	"message": "",
	"data": null
}
errorType状态码
message状态码为错误时的具体出错信息
data无返回数据

获取pd成员

Method & Url
GET http://127.0.0.1:8620/v1/members
Response Status
200
Response Body
{
  "status": 0,
  "graphs": {
    "members": [
      {
        "clusterId": "1",
        "raftUrl": "10.14.139.56:8620",
        "grpcUrl": "10.14.139.56:8686",
        "restUrl": "10.14.139.56:8620",
        "dataPath": "./pd_data",
        "state": "Up"
      },
      {
        "clusterId": "1",
        "raftUrl": "10.14.139.57:8620",
        "grpcUrl": "10.14.139.57:8686",
        "restUrl": "10.14.139.57:8620",
        "dataPath": "./pd_data",
        "state": "Up"
      },
      {
        "clusterId": "1",
        "raftUrl": "10.14.139.58:8620",
        "grpcUrl": "10.14.139.58:8686",
        "restUrl": "10.14.139.58:8620",
        "dataPath": "./pd_data",
        "state": "Up"
      }
    ],
    "leader": {
      "clusterId": "1",
      "raftUrl": "10.14.139.56:8610",
      "grpcUrl": "10.14.139.56:8686",
      "dataPath": "./pd_data",
      "state": "Up"
    }
  }
}
clusterIdpd集群ID
raftUrl、grpcUrl、restUrlpd节点的地址信息
dataPathpd数据存储目录
state: 节点当前状态

Store Mertics 地址

GET http://127.0.0.1:8520/actuator/prometheus