forked from polarismesh/polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polaris-server.yaml
363 lines (363 loc) · 9.79 KB
/
polaris-server.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# server启动引导配置
bootstrap:
# 全局日志
logger:
config:
rotateOutputPath: log/polaris-config.log
errorRotateOutputPath: log/polaris-config-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
auth:
rotateOutputPath: log/polaris-auth.log
errorRotateOutputPath: log/polaris-auth-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
store:
rotateOutputPath: log/polaris-store.log
errorRotateOutputPath: log/polaris-store-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
cache:
rotateOutputPath: log/polaris-cache.log
errorRotateOutputPath: log/polaris-cache-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
naming:
rotateOutputPath: log/polaris-naming.log
errorRotateOutputPath: log/polaris-naming-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
default:
rotateOutputPath: log/polaris-default.log
errorRotateOutputPath: log/polaris-default-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
outputPaths:
- stdout
errorOutputPaths:
- stderr
# 按顺序启动server
startInOrder:
open: true # 是否开启,默认是关闭
key: sz # 全局锁
# 注册为北极星服务
polaris_service:
# probe_address: ##DB_ADDR##
enable_register: true
isolated: false
services:
- name: polaris.checker
protocols:
- service-grpc
- name: polaris.config
protocols:
- config-grpc
# apiserver配置
apiservers:
- name: service-eureka
option:
listenIP: "0.0.0.0"
listenPort: 8761
namespace: default
owner: polaris
refreshInterval: 10
deltaExpireInterval: 60
unhealthyExpireInterval: 180
connLimit:
openConnLimit: false
maxConnPerHost: 1024
maxConnLimit: 10240
whiteList: 127.0.0.1
purgeCounterInterval: 10s
purgeCounterExpired: 5s
- name: api-http # 协议名,全局唯一
option:
listenIP: "0.0.0.0"
listenPort: 8090
enablePprof: true # debug pprof
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
whiteList: 127.0.0.1
purgeCounterInterval: 10s
purgeCounterExpired: 5s
api:
admin:
enable: true
console:
enable: true
include: [default]
client:
enable: true
include: [discover, register, healthcheck]
config:
enable: true
include: [default]
- name: service-grpc
option:
listenIP: "0.0.0.0"
listenPort: 8091
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
enableCacheProto: true
sizeCacheProto: 128
api:
client:
enable: true
include: [discover, register, healthcheck]
- name: config-grpc
option:
listenIP: "0.0.0.0"
listenPort: 8093
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
api:
client:
enable: true
- name: xds-v3
option:
listenIP: "0.0.0.0"
listenPort: 15010
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 10240
- name: prometheus-sd
option:
listenIP: "0.0.0.0"
listenPort: 9000
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 10240
# - name: service-l5
# option:
# listenIP: 0.0.0.0
# listenPort: 7779
# clusterName: cl5.discover
# 核心逻辑的配置
auth:
# 鉴权插件
name: defaultAuth
option:
# token 加密的 salt,鉴权解析 token 时需要依靠这个 salt 去解密 token 的信息
# salt 的长度需要满足以下任意一个:len(salt) in [16, 24, 32]
salt: polarismesh@2021
# 控制台鉴权能力开关,默认开启
consoleOpen: true
# 客户端鉴权能力开关, 默认关闭
clientOpen: false
namespace:
# 是否允许自动创建命名空间
autoCreate: true
naming:
auth:
open: false
# 批量控制器
batch:
register:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 128
concurrency: 128
deregister:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 128
concurrency: 128
clientRegister:
open: true
queueSize: 10240
waitTime: 32s
maxBatchCount: 1024
concurrency: 64
clientDeregister:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 32
concurrency: 64
# 健康检查的配置
healthcheck:
open: true
service: polaris.checker
slotNum: 30
minCheckInterval: 1s
maxCheckInterval: 30s
clientReportInterval: 120s
batch:
heartbeat:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 32
concurrency: 64
checkers:
- name: heartbeatMemory
# - name: heartbeatRedis
# option:
# kvAddr: ##REDIS_ADDR##
# kvUser: ##REDIS_USER#
# kvPasswd: ##REDIS_PWD##
# poolSize: 200
# minIdleConns: 30
# idleTimeout: 120s
# connectTimeout: 200ms
# msgTimeout: 200ms
# concurrency: 200
# withTLS: false
# 配置中心模块启动配置
config:
# 是否启动配置模块
open: true
cache:
#配置文件缓存过期时间,单位s
expireTimeAfterWrite: 3600
# 缓存配置
cache:
open: true
resources:
- name: service # 加载服务数据
option:
disableBusiness: false # 不加载业务服务
needMeta: true # 加载服务元数据
- name: instance # 加载实例数据
option:
disableBusiness: false # 不加载业务服务实例
needMeta: true # 加载实例元数据
- name: routingConfig # 加载路由数据
- name: rateLimitConfig # 加载限流数据
- name: circuitBreakerConfig # 加载熔断数据
- name: users # 加载用户、用户组数据
- name: strategyRule # 加载鉴权规则数据
- name: namespace # 加载命名空间数据
- name: client # 加载 SDK 数据
# - name: l5 # 加载l5数据
# 存储配置
store:
# 单机文件存储插件
name: boltdbStore
option:
path: ./polaris.bolt
## 数据库存储插件
# name: defaultStore
# option:
# master:
# dbType: mysql
# dbName: polaris_server
# dbUser: ##DB_USER##
# dbPwd: ##DB_PWD##
# dbAddr: ##DB_ADDR##
# maxOpenConns: 300
# maxIdleConns: 50
# connMaxLifetime: 300 # 单位秒
# txIsolationLevel: 2 #LevelReadCommitted
# 插件配置
plugin:
history:
name: HistoryLogger
discoverEvent:
name: discoverEventLocal
# option:
# queueSize: 1024
# outputPath: ./discover-event
# rotationMaxSize: 500
# rotationMaxAge: 8
# rotationMaxBackups: 100
discoverStatis:
name: discoverLocal
option:
interval: 60 # 统计间隔,单位为秒
outputPath: ./discover-statis
statis:
name: local
option:
interval: 60 # 统计间隔,单位为秒
outputPath: ./statis
# api 调用指标数据计算上报到 prometheus
# name: prometheus
# option:
# interval: 60 # 统计间隔,单位为秒
auth:
name: defaultAuth
ratelimit:
name: token-bucket
option:
remote-conf: false # 是否使用远程配置
ip-limit: # ip级限流,全局
open: true # 系统是否开启ip级限流
global:
open: true
bucket: 300 # 最高峰值
rate: 200 # 平均一个IP每秒的请求数
resource-cache-amount: 1024 # 最大缓存的IP个数
white-list: [127.0.0.1]
instance-limit:
open: true
global:
bucket: 200
rate: 100
resource-cache-amount: 1024
api-limit: # 接口级限流
open: false # 是否开启接口限流,全局开关,只有为true,才代表系统的限流开启。默认关闭
rules:
- name: store-read
limit:
open: true # 接口的全局配置,如果在api子项中,不配置,则该接口依据global来做限制
bucket: 2000 # 令牌桶最大值
rate: 1000 # 每秒产生的令牌数
- name: store-write
limit:
open: true
bucket: 1000
rate: 500
apis:
- name: "POST:/v1/naming/services"
rule: store-write
- name: "PUT:/v1/naming/services"
rule: store-write
- name: "POST:/v1/naming/services/delete"
rule: store-write
- name: "GET:/v1/naming/services"
rule: store-read
- name: "GET:/v1/naming/services/count"
rule: store-read