forked from polarismesh/polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolaris-server.yaml
187 lines (187 loc) · 5.04 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
# server启动引导配置
bootstrap:
# 全局日志
logger:
RotateOutputPath: log/polaris-server.log
RotationMaxSize: 500
RotationMaxAge: 30
RotationMaxBackups: 100
level: debug
# 按顺序启动server
startInOrder:
open: true # 是否开启,默认是关闭
key: sz # 全局锁
# 注册为北极星服务
polaris_service:
# probe_address: ##DB_ADDR##
enable_register: false
isolated: true
services:
- name: polaris-server
namespace: Polaris
protocols:
- grpcserver
- httpserver
- l5pbserver
# apiserver配置
apiservers:
- name: httpserver # 协议名,全局唯一
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]
- name: grpcserver
option:
listenIP: "0.0.0.0"
listenPort: 8091
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
api:
client:
enable: true
include: [discover, register, healthcheck]
- name: l5pbserver
option:
listenIP: 0.0.0.0
listenPort: 7779
clusterName: cl5.discover
# 核心逻辑的配置
naming:
# 鉴权配置
auth:
# 是否开启鉴权
open: false
# 健康检查
healthcheck:
open: true
# kvConnNum: 50
# kvServiceName: polarisHeartbeatCkv
# kvNamespace: Polaris
# kvPasswd: polaris@2021
slotNum: 30
maxIdle: 20
idleTimeout: 120
# 批量控制器
batch:
register:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 32
concurrency: 64
deregister:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 32
concurrency: 64
# 缓存配置
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: l5 # 加载l5数据
# 存储配置
store:
# 单机文件存储插件
name: boltdbStore
option:
path: ./polaris.bolt
# 数据库存储插件
# name: defaultStore
# option:
# master:
# dbType: mysql
# dbUser: ##DB_USER##
# dbPwd: ##DB_PWD##
# dbAddr: ##DB_ADDR##
# dbName: ##DB_NAME##
# maxOpenConns: -1
# maxIdleConns: -1
# connMaxLifetime: 300 # 单位秒
# txIsolationLevel: 2 #LevelReadCommitted
# 插件配置
plugin:
history:
name: HistoryLogger
discoverStatis:
name: discoverLocal
option:
interval: 60 # 统计间隔,单位为秒
outputPath: ./discover-statis
statis:
name: local
option:
interval: 60 # 统计间隔,单位为秒
outputPath: ./statis
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: 2
rate: 2
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
- name: ""