集群设置增加自动硬盘TRIM选项

This commit is contained in:
GoEdgeLab
2024-04-04 17:05:09 +08:00
parent 0a903f2247
commit ba4213d0db
6 changed files with 920 additions and 884 deletions

View File

@@ -90,6 +90,7 @@ type NodeConfig struct {
Clock *ClockConfig `yaml:"clock" json:"clock"` // 时钟配置
AutoInstallNftables bool `yaml:"autoInstallNftables" json:"autoInstallNftables"` // 自动安装nftables
AutoSystemTuning bool `yaml:"autoSystemTuning" json:"autoSystemTuning"` // 自动调整系统参数
AutoTrimDisks bool `yaml:"autoTrimDisks" json:"autoTrimDisks"` // 自动执行TRIM
// 指标
MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`

View File

@@ -47,6 +47,7 @@ type NodeCluster struct {
AutoInstallNftables bool `protobuf:"varint,20,opt,name=autoInstallNftables,proto3" json:"autoInstallNftables,omitempty"`
SshParamsJSON []byte `protobuf:"bytes,21,opt,name=sshParamsJSON,proto3" json:"sshParamsJSON,omitempty"`
AutoSystemTuning bool `protobuf:"varint,23,opt,name=autoSystemTuning,proto3" json:"autoSystemTuning,omitempty"` // 是否自动调节系统参数
AutoTrimDisks bool `protobuf:"varint,24,opt,name=autoTrimDisks,proto3" json:"autoTrimDisks,omitempty"` // 是否自动TRIM硬盘
}
func (x *NodeCluster) Reset() {
@@ -235,12 +236,19 @@ func (x *NodeCluster) GetAutoSystemTuning() bool {
return false
}
func (x *NodeCluster) GetAutoTrimDisks() bool {
if x != nil {
return x.AutoTrimDisks
}
return false
}
var File_models_model_node_cluster_proto protoreflect.FileDescriptor
var file_models_model_node_cluster_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xf3, 0x05, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x99, 0x06, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65,
@@ -287,8 +295,11 @@ var file_models_model_node_cluster_proto_rawDesc = []byte{
0x52, 0x0d, 0x73, 0x73, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12,
0x2a, 0x0a, 0x10, 0x61, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x75, 0x6e,
0x69, 0x6e, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x75, 0x74, 0x6f, 0x53,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x61,
0x75, 0x74, 0x6f, 0x54, 0x72, 0x69, 0x6d, 0x44, 0x69, 0x73, 0x6b, 0x73, 0x18, 0x18, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x54, 0x72, 0x69, 0x6d, 0x44, 0x69, 0x73, 0x6b,
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

File diff suppressed because it is too large Load Diff

View File

@@ -26,4 +26,5 @@ message NodeCluster {
bool autoInstallNftables = 20;
bytes sshParamsJSON = 21;
bool autoSystemTuning = 23; // 是否自动调节系统参数
bool autoTrimDisks = 24; // 是否自动TRIM硬盘
}

View File

@@ -189,6 +189,7 @@ message CreateNodeClusterRequest {
bytes globalServerConfigJSON = 10; // 服务全局设置
bool autoInstallNftables = 11; // 自动安装nftables
bool autoSystemTuning = 12; // 是否自动调节系统参数
bool autoTrimDisks = 13; // 是否自动TRIM硬盘
}
message CreateNodeClusterResponse {
@@ -209,6 +210,7 @@ message UpdateNodeClusterRequest {
bool autoInstallNftables = 11;
bytes sshParamsJSON = 12;
bool autoSystemTuning = 13; // 是否自动调节系统参数
bool autoTrimDisks = 14; // 是否自动TRIM硬盘
}
// 删除集群