mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 21:50:26 +08:00 
			
		
		
		
	集群增加自动同步时钟选项
This commit is contained in:
		
							
								
								
									
										7128
									
								
								build/rpc.json
									
									
									
									
									
								
							
							
						
						
									
										7128
									
								
								build/rpc.json
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										20
									
								
								pkg/nodeconfigs/clock_config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								pkg/nodeconfigs/clock_config.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package nodeconfigs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func DefaultClockConfig() *ClockConfig {
 | 
				
			||||||
 | 
						return &ClockConfig{
 | 
				
			||||||
 | 
							AutoSync: true,
 | 
				
			||||||
 | 
							Server:   "",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ClockConfig 时钟相关配置
 | 
				
			||||||
 | 
					type ClockConfig struct {
 | 
				
			||||||
 | 
						AutoSync bool   `yaml:"autoSync" json:"autoSync"` // 自动尝试同步时钟
 | 
				
			||||||
 | 
						Server   string `yaml:"server" json:"server"`     // 时钟同步服务器
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (this *ClockConfig) Init() error {
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -63,8 +63,9 @@ type NodeConfig struct {
 | 
				
			|||||||
	TOA                  *TOAConfig                              `yaml:"toa" json:"toa"`
 | 
						TOA                  *TOAConfig                              `yaml:"toa" json:"toa"`
 | 
				
			||||||
	SystemServices       map[string]maps.Map                     `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
 | 
						SystemServices       map[string]maps.Map                     `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
 | 
				
			||||||
	FirewallActions      []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
 | 
						FirewallActions      []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
 | 
				
			||||||
	TimeZone             string                                  `yaml:"timeZone" json:"timeZone"`
 | 
						TimeZone             string                                  `yaml:"timeZone" json:"timeZone"`           // 自动设置时区
 | 
				
			||||||
	AutoOpenPorts        bool                                    `yaml:"autoOpenPorts" json:"autoOpenPorts"`
 | 
						AutoOpenPorts        bool                                    `yaml:"autoOpenPorts" json:"autoOpenPorts"` // 自动开放所需端口
 | 
				
			||||||
 | 
						Clock                *ClockConfig                            `yaml:"clock" json:"clock"`                 // 时钟配置
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 指标
 | 
						// 指标
 | 
				
			||||||
	MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`
 | 
						MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,6 +46,7 @@ type NodeCluster struct {
 | 
				
			|||||||
	NodeMaxThreads       int32  `protobuf:"varint,14,opt,name=nodeMaxThreads,proto3" json:"nodeMaxThreads,omitempty"`
 | 
						NodeMaxThreads       int32  `protobuf:"varint,14,opt,name=nodeMaxThreads,proto3" json:"nodeMaxThreads,omitempty"`
 | 
				
			||||||
	AutoOpenPorts        bool   `protobuf:"varint,16,opt,name=autoOpenPorts,proto3" json:"autoOpenPorts,omitempty"`
 | 
						AutoOpenPorts        bool   `protobuf:"varint,16,opt,name=autoOpenPorts,proto3" json:"autoOpenPorts,omitempty"`
 | 
				
			||||||
	IsPinned             bool   `protobuf:"varint,17,opt,name=isPinned,proto3" json:"isPinned,omitempty"`
 | 
						IsPinned             bool   `protobuf:"varint,17,opt,name=isPinned,proto3" json:"isPinned,omitempty"`
 | 
				
			||||||
 | 
						ClockJSON            []byte `protobuf:"bytes,18,opt,name=clockJSON,proto3" json:"clockJSON,omitempty"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (x *NodeCluster) Reset() {
 | 
					func (x *NodeCluster) Reset() {
 | 
				
			||||||
@@ -192,12 +193,19 @@ func (x *NodeCluster) GetIsPinned() bool {
 | 
				
			|||||||
	return false
 | 
						return false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (x *NodeCluster) GetClockJSON() []byte {
 | 
				
			||||||
 | 
						if x != nil {
 | 
				
			||||||
 | 
							return x.ClockJSON
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var File_models_model_node_cluster_proto protoreflect.FileDescriptor
 | 
					var File_models_model_node_cluster_proto protoreflect.FileDescriptor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var file_models_model_node_cluster_proto_rawDesc = []byte{
 | 
					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,
 | 
						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, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
 | 
				
			||||||
	0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xfd, 0x03, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
 | 
						0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x9b, 0x04, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
 | 
				
			||||||
	0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
 | 
						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,
 | 
						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,
 | 
						0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65,
 | 
				
			||||||
@@ -229,8 +237,10 @@ var file_models_model_node_cluster_proto_rawDesc = []byte{
 | 
				
			|||||||
	0x6f, 0x72, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x6f,
 | 
						0x6f, 0x72, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x6f,
 | 
				
			||||||
	0x4f, 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50,
 | 
						0x4f, 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50,
 | 
				
			||||||
	0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50,
 | 
						0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50,
 | 
				
			||||||
	0x69, 0x6e, 0x6e, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
 | 
						0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x53,
 | 
				
			||||||
	0x72, 0x6f, 0x74, 0x6f, 0x33,
 | 
						0x4f, 0x4e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x4a,
 | 
				
			||||||
 | 
						0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
 | 
				
			||||||
 | 
						0x74, 0x6f, 0x33,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -20,4 +20,5 @@ message NodeCluster {
 | 
				
			|||||||
	int32 nodeMaxThreads = 14;
 | 
						int32 nodeMaxThreads = 14;
 | 
				
			||||||
	bool autoOpenPorts = 16;
 | 
						bool autoOpenPorts = 16;
 | 
				
			||||||
	bool isPinned = 17;
 | 
						bool isPinned = 17;
 | 
				
			||||||
 | 
						bytes clockJSON = 18;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -170,8 +170,8 @@ message UpdateNodeClusterRequest {
 | 
				
			|||||||
	string installDir = 4;
 | 
						string installDir = 4;
 | 
				
			||||||
	string timeZone = 5;
 | 
						string timeZone = 5;
 | 
				
			||||||
	int32 nodeMaxThreads = 6;
 | 
						int32 nodeMaxThreads = 6;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	bool autoOpenPorts = 8;
 | 
						bool autoOpenPorts = 8;
 | 
				
			||||||
 | 
						bytes clockJSON = 9;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 删除集群
 | 
					// 删除集群
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user