1 Star 0 Fork 21

SchuckBate/polaris

forked from PolarisMesh/polaris 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
polaris-server.yaml 13.46 KB
一键复制 编辑 原始数据 按行查看 历史
# Tencent is pleased to support the open source community by making Polaris available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# 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
healthcheck:
rotateOutputPath: log/polaris-healthcheck.log
errorRotateOutputPath: log/polaris-healthcheck-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
xdsv3:
rotateOutputPath: log/polaris-xdsv3.log
errorRotateOutputPath: log/polaris-xdsv3-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
apiserver:
rotateOutputPath: log/polaris-apiserver.log
errorRotateOutputPath: log/polaris-apiserver-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
defaultAuth:
rotateOutputPath: log/polaris-defaultauth.log
errorRotateOutputPath: log/polaris-password-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
discoverEventLocal:
rotateOutputPath: log/polaris-discoverevent.log
errorRotateOutputPath: log/polaris-discoverevent-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
discoverLocal:
rotateOutputPath: log/polaris-discoverstat.log
errorRotateOutputPath: log/polaris-discoverstat-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
token-bucket:
rotateOutputPath: log/polaris-ratelimit.log
errorRotateOutputPath: log/polaris-ratelimit-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
local:
rotateOutputPath: log/polaris-statis.log
errorRotateOutputPath: log/polaris-statis-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
outputLevel: info
# outputPaths:
# - stdout
# errorOutputPaths:
# - stderr
HistoryLogger:
rotateOutputPath: log/polaris-history.log
errorRotateOutputPath: log/polaris-history-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
rotationMaxDurationForHour: 24
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
# apiserver配置
apiservers:
- name: service-eureka
option:
listenIP: "0.0.0.0"
listenPort: 8761
namespace: default
owner: polaris
refreshInterval: 10
deltaExpireInterval: 60
unhealthyExpireInterval: 180
ignoreUpLow: false
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
enableSwagger: true
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
tls:
certFile: ""
keyFile: ""
trustedCAFile: ""
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
dropExpireTask: true
taskLife: 30s
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##
# # ACL user from redis v6.0, remove it if ACL is not available
# kvUser: ##REDIS_USER#
# kvPasswd: ##REDIS_PWD##
# poolSize: 200
# minIdleConns: 30
# idleTimeout: 120s
# connectTimeout: 200ms
# msgTimeout: 200ms
# concurrency: 200
# withTLS: false
# 配置中心模块启动配置
config:
# 是否启动配置模块
open: true
# 缓存配置
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: configFile
option:
#配置文件缓存过期时间,单位s
expireTimeAfterWrite: 3600
# - 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:
# whitelist:
# name: whitelist
# option:
# ip: [127.0.0.1]
history:
name: HistoryLogger
discoverEvent:
name: discoverEventLocal
# option:
# queueSize: 1024
# outputPath: ./discover-event
# rotationMaxSize: 500
# rotationMaxAge: 8
# rotationMaxBackups: 100
discoverStatis:
name: discoverLocal
option:
interval: 60 # 统计间隔,单位为秒
statis:
name: local
option:
interval: 60 # 统计间隔,单位为秒
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/skBate/polaris.git
git@gitee.com:skBate/polaris.git
skBate
polaris
polaris
main

搜索帮助

D67c1975 1850385 1daf7b77 1850385