Skip to content

Commit

Permalink
feat:support rls to push xds client
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed May 31, 2023
1 parent ef420f4 commit d7ab931
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 69 deletions.
1 change: 1 addition & 0 deletions common/log/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func prepZap(options *Options) ([]zapcore.Core, zapcore.Core, zapcore.WriteSynce
MaxSize: options.RotationMaxSize,
MaxBackups: options.RotationMaxBackups,
MaxAge: options.RotationMaxAge,
Compress: options.Compress,
}
rotateSink = zapcore.AddSync(l)
}
Expand Down
1 change: 1 addition & 0 deletions common/log/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type Options struct {
// RotationMaxDurationForHour
RotationMaxDurationForHour int `yaml:"rotationMaxDurationForHour"`

Compress bool `yaml:"compress"`
OutputLevel string `yaml:"outputLevel"`
StackTraceLevel string `yaml:"stackTraceLevel"`
DisableLogCaller bool `yaml:"disableLogCaller"`
Expand Down
22 changes: 16 additions & 6 deletions release/cluster/kubernetes/02-polaris-server-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,23 @@ data:
# listenIP: 0.0.0.0
# listenPort: 7779
# clusterName: cl5.discover
# 核心逻辑的配置
# Core logic configuration
auth:
name: defaultAuth
option:
salt: polarismesh@2021
consoleOpen: true
clientOpen: false
# auth's option has migrated to auth.user and auth.strategy
# it's still available when filling auth.option, but you will receive warning log that auth.option has deprecated.
user:
name: defaultUser
option:
# Token encrypted SALT, you need to rely on this SALT to decrypt the information of the Token when analyzing the Token
# The length of SALT needs to satisfy the following one:len(salt) in [16, 24, 32]
salt: polarismesh@2021
strategy:
name: defaultStrategy
option:
# Console power switch, open default
consoleOpen: true
# Customer inspection ability switch, default close
clientOpen: false
namespace:
autoCreate: true
naming:
Expand Down
124 changes: 61 additions & 63 deletions release/conf/polaris-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,116 +17,85 @@
bootstrap:
# Global log
logger:
# Log scope name
config:
# Log file location
rotateOutputPath: log/runtime/polaris-config.log
# Special records of error log files at ERROR level
errorRotateOutputPath: log/runtime/polaris-config-error.log
# The maximum size of a single log file, 100 default, the unit is MB
rotationMaxSize: 100
# How many log files are saved, default 10
rotationMaxBackups: 10
# The maximum preservation days of a single log file, default 7
rotationMaxAge: 7
# Log output level,debug/info/warn/error
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
# Open the log file compression
# compress: false
auth:
rotateOutputPath: log/runtime/polaris-auth.log
errorRotateOutputPath: log/runtime/polaris-auth-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
store:
rotateOutputPath: log/runtime/polaris-store.log
errorRotateOutputPath: log/runtime/polaris-store-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
cache:
rotateOutputPath: log/runtime/polaris-cache.log
errorRotateOutputPath: log/runtime/polaris-cache-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
naming:
rotateOutputPath: log/runtime/polaris-naming.log
errorRotateOutputPath: log/runtime/polaris-naming-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
healthcheck:
rotateOutputPath: log/runtime/polaris-healthcheck.log
errorRotateOutputPath: log/runtime/polaris-healthcheck-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
xdsv3:
rotateOutputPath: log/runtime/polaris-xdsv3.log
errorRotateOutputPath: log/runtime/polaris-xdsv3-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
apiserver:
rotateOutputPath: log/runtime/polaris-apiserver.log
errorRotateOutputPath: log/runtime/polaris-apiserver-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
token-bucket:
rotateOutputPath: log/runtime/polaris-ratelimit.log
errorRotateOutputPath: log/runtime/polaris-ratelimit-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
default:
rotateOutputPath: log/runtime/polaris-default.log
errorRotateOutputPath: log/runtime/polaris-default-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
discoverEventLocal:
rotateOutputPath: log/event/polaris-discoverevent.log
errorRotateOutputPath: log/event/polaris-discoverevent-error.log
Expand All @@ -135,32 +104,20 @@ bootstrap:
rotationMaxAge: 7
outputLevel: info
onlyContent: true
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
discoverLocal:
rotateOutputPath: log/statis/polaris-discoverstat.log
errorRotateOutputPath: log/statis/polaris-discoverstat-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
local:
rotateOutputPath: log/statis/polaris-statis.log
errorRotateOutputPath: log/statis/polaris-statis-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
HistoryLogger:
rotateOutputPath: log/operation/polaris-history.log
errorRotateOutputPath: log/operation/polaris-history-error.log
Expand All @@ -170,53 +127,67 @@ bootstrap:
rotationMaxDurationForHour: 24
outputLevel: info
onlyContent: true
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
cmdb:
rotateOutputPath: log/runtime/polaris-cmdb.log
errorRotateOutputPath: log/runtime/polaris-cmdb-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
# Start the server in order
startInOrder:
open: true # Whether to open, the default is closed
key: sz # Global lock
# Start the Polaris-Server in order, mainly to avoid data synchronization logic when the server starts the DB to pull the DB out of high load
open: true
# The name of the start lock
key: sz
# Register as Arctic Star Service
polaris_service:
# Obtain the IP of the VM or POD where Polaris is located by making a TCP connection with the probe_adreess address
# probe_address: ##DB_ADDR##
# Whether to open the server to register
enable_register: true
# Registered North Star Server Examples isolation status
isolated: false
# Service information that needs to be registered
services:
# service name
- name: polaris.checker
# Set the port protocol information that requires registration
protocols:
- service-grpc
# apiserver Configuration
apiservers:
# apiserver plugin name
- name: service-eureka
# apiserver additional configuration
option:
# tcp server listen ip
listenIP: "0.0.0.0"
# tcp server listen port
listenPort: 8761
# set the polaris namingspace of the EUREKA service default
namespace: default
owner: polaris
# pull data from the cache of the polaris, refresh the data cache in the Eureka protocol
refreshInterval: 10
# eureka incremental instance changes time cache expiration cycle
deltaExpireInterval: 60
# unhealthy instance expiration cycle
unhealthyExpireInterval: 180
# whether to enable an instance ID of polaris to generate logic
generateUniqueInstId: false
# TCP connection number limit
connLimit:
# Whether to turn on the TCP connection limit function, default FALSE
openConnLimit: false
# The number of connections with the most IP
maxConnPerHost: 1024
# Current Listener's maximum number of connections
maxConnLimit: 10240
# Whitening list ip list, English comma separation
whiteList: 127.0.0.1
# Cleaning the cycle of link behavior
purgeCounterInterval: 10s
# How long does the unpretentious link clean up
purgeCounterExpired: 5s
- name: api-http
option:
Expand All @@ -233,18 +204,25 @@ apiservers:
whiteList: 127.0.0.1
purgeCounterInterval: 10s
purgeCounterExpired: 5s
# Set the type of open API interface
api:
# admin OpenAPI interface
admin:
enable: true
# Console OpenAPI interface
console:
enable: true
# OpenAPI group that needs to be exposed
include: [default]
# client OpenAPI interface
client:
enable: true
include: [discover, register, healthcheck]
# configuration center OpenAPI interface
config:
enable: true
include: [default]
# Polaris is a client communication protocol layer based on the gRPC protocol, which is used for registration discovery and service governance rule delivery
- name: service-grpc
option:
listenIP: "0.0.0.0"
Expand All @@ -253,11 +231,17 @@ apiservers:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
# Open the protobuf parsing cache, cache the protobuf serialization results of the same content, and improve the processing of service discovery QPS
enableCacheProto: true
# Cache default size
sizeCacheProto: 128
# tls setting
tls:
# set cert file path
certFile: ""
# set key file path
keyFile: ""
# set trusted ca file path
trustedCAFile: ""
api:
client:
Expand Down Expand Up @@ -312,11 +296,17 @@ naming:
batch:
register:
open: true
# Task queue cache
queueSize: 10240
# The maximum waiting time for the number of mission is not full, and the time is directly forced to launch the BATCH operation
waitTime: 32ms
# Number of BATCH
maxBatchCount: 128
# Number of workers in the batch task
concurrency: 128
# Whether to turn on the discarding expiration task is only used for the batch controller of the register type
dropExpireTask: true
# The maximum validity period of the task is that the task is not executed when the validity period exceeds the validity period.
taskLife: 30s
deregister:
open: true
Expand All @@ -338,11 +328,17 @@ naming:
concurrency: 64
# Configuration of health check
healthcheck:
# Whether to open the health check function module
open: true
# The service of the instance of the health inspection task
service: polaris.checker
# Time wheel parameters
slotNum: 30
# It is used to adjust the next execution time of instance health check tasks in the time wheel, limit the minimum inspection cycle
minCheckInterval: 1s
# It is used to adjust the next execution time of instance health inspection tasks in the time wheel, limit the maximum inspection cycle
maxCheckInterval: 30s
# Used to adjust the next execution time of SDK reporting instance health checking tasks in the time wheel
clientReportInterval: 120s
batch:
heartbeat:
Expand All @@ -351,6 +347,8 @@ healthcheck:
waitTime: 32ms
maxBatchCount: 32
concurrency: 64
# Health check plugin list, currently supports heartBeatMemory/heartBeatredis/heartBeatLeader.
# since the three belong to the same type of health check plugin, only one can be enabled to use one
checkers:
- name: heartbeatMemory
# - name: heartbeatLeader # Heartbeat examination plugin based on the Leader-Follower mechanism
Expand Down

0 comments on commit d7ab931

Please sign in to comment.