可以直接在节点启动时自动注册节点

This commit is contained in:
刘祥超
2020-10-17 11:14:44 +08:00
parent 2068b6bd89
commit 835b6f5e41
6 changed files with 946 additions and 512 deletions

View File

@@ -9,4 +9,6 @@ message NodeCluster {
int64 createdAt = 3;
int64 grantId = 4;
string installDir = 5;
string uniqueId = 6;
string secret = 7;
}

View File

@@ -10,6 +10,9 @@ service NodeService {
// 创建节点
rpc createNode (CreateNodeRequest) returns (CreateNodeResponse);
// 注册集群节点
rpc registerClusterNode (RegisterClusterNodeRequest) returns (RegisterClusterNodeResponse);
// 节点数量
rpc countAllEnabledNodes (CountAllEnabledNodesRequest) returns (CountAllEnabledNodesResponse);
@@ -67,6 +70,17 @@ message CreateNodeResponse {
int64 nodeId = 1;
}
// 注册集群节点
message RegisterClusterNodeRequest {
string name = 1;
}
message RegisterClusterNodeResponse {
string uniqueId = 1;
string secret = 2;
repeated string endpoints = 3;
}
// 节点数量
message CountAllEnabledNodesRequest {

View File

@@ -3,6 +3,7 @@ option go_package = "./pb";
package pb;
import "model_node_cluster.proto";
import "model_api_node.proto";
import "rpc_messages.proto";
service NodeClusterService {
@@ -18,7 +19,10 @@ service NodeClusterService {
// 查找单个集群信息
rpc findEnabledNodeCluster (FindEnabledNodeClusterRequest) returns (FindEnabledNodeClusterResponse);
// 获取所有集群的信息
// 查找集群的API节点信息
rpc findAPINodesWithNodeCluster (FindAPINodesWithNodeClusterRequest) returns (FindAPINodesWithNodeClusterResponse);
// 获取所有可用集群
rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse);
// 获取变更的集群
@@ -86,6 +90,16 @@ message FindEnabledNodeClusterResponse {
NodeCluster cluster = 1;
}
// 查找集群的API节点信息
message FindAPINodesWithNodeClusterRequest {
int64 clusterId = 1;
}
message FindAPINodesWithNodeClusterResponse {
bool useAllAPINodes = 1;
repeated APINode apiNodes = 2;
}
// 计算所有集群数量
message CountAllEnabledNodeClustersRequest {