github.com/polarismesh/polaris@v1.17.8/test/data/polaris-server.yaml (about)

     1  # Tencent is pleased to support the open source community by making Polaris available.
     2  #
     3  # Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
     4  #
     5  # Licensed under the BSD 3-Clause License (the "License");
     6  # you may not use this file except in compliance with the License.
     7  # You may obtain a copy of the License at
     8  #
     9  # https://opensource.org/licenses/BSD-3-Clause
    10  #
    11  # Unless required by applicable law or agreed to in writing, software distributed
    12  # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
    13  # CONDITIONS OF ANY KIND, either express or implied. See the License for the
    14  # specific language governing permissions and limitations under the License.
    15  
    16  # server启动引导配置
    17  bootstrap:
    18    # 全局日志
    19    logger:
    20      config:
    21        rotateOutputPath: log/runtime/polaris-config.log
    22        errorRotateOutputPath: log/runtime/polaris-config-error.log
    23        rotationMaxSize: 100
    24        rotationMaxBackups: 10
    25        rotationMaxAge: 7
    26        outputLevel: info
    27        # outputPaths:
    28        # - stdout
    29        # errorOutputPaths:
    30        # - stderr
    31      auth:
    32        rotateOutputPath: log/runtime/polaris-auth.log
    33        errorRotateOutputPath: log/runtime/polaris-auth-error.log
    34        rotationMaxSize: 100
    35        rotationMaxBackups: 10
    36        rotationMaxAge: 7
    37        outputLevel: info
    38        # outputPaths:
    39        #   - stdout
    40        # errorOutputPaths:
    41        #   - stderr
    42      store:
    43        rotateOutputPath: log/runtime/polaris-store.log
    44        errorRotateOutputPath: log/runtime/polaris-store-error.log
    45        rotationMaxSize: 100
    46        rotationMaxBackups: 10
    47        rotationMaxAge: 7
    48        outputLevel: info
    49        # outputPaths:
    50        #   - stdout
    51        # errorOutputPaths:
    52        #   - stderr
    53      cache:
    54        rotateOutputPath: log/runtime/polaris-cache.log
    55        errorRotateOutputPath: log/runtime/polaris-cache-error.log
    56        rotationMaxSize: 100
    57        rotationMaxBackups: 10
    58        rotationMaxAge: 7
    59        outputLevel: info
    60        # outputPaths:
    61        #   - stdout
    62        # errorOutputPaths:
    63        #   - stderr
    64      naming:
    65        rotateOutputPath: log/runtime/polaris-naming.log
    66        errorRotateOutputPath: log/runtime/polaris-naming-error.log
    67        rotationMaxSize: 100
    68        rotationMaxBackups: 10
    69        rotationMaxAge: 7
    70        outputLevel: info
    71        # outputPaths:
    72        #   - stdout
    73        # errorOutputPaths:
    74        #   - stderr
    75      healthcheck:
    76        rotateOutputPath: log/runtime/polaris-healthcheck.log
    77        errorRotateOutputPath: log/runtime/polaris-healthcheck-error.log
    78        rotationMaxSize: 100
    79        rotationMaxBackups: 10
    80        rotationMaxAge: 7
    81        outputLevel: info
    82        # outputPaths:
    83        #   - stdout
    84        # errorOutputPaths:
    85        #   - stderr
    86      xdsv3:
    87        rotateOutputPath: log/runtime/polaris-xdsv3.log
    88        errorRotateOutputPath: log/polaris-xdsv3-error.log
    89        rotationMaxSize: 100
    90        rotationMaxBackups: 10
    91        rotationMaxAge: 7
    92        outputLevel: info
    93        # outputPaths:
    94        #   - stdout
    95        # errorOutputPaths:
    96        #   - stderr
    97      apiserver:
    98        rotateOutputPath: log/runtime/polaris-apiserver.log
    99        errorRotateOutputPath: log/runtime/polaris-apiserver-error.log
   100        rotationMaxSize: 100
   101        rotationMaxBackups: 10
   102        rotationMaxAge: 7
   103        outputLevel: info
   104        # outputPaths:
   105        #   - stdout
   106        # errorOutputPaths:
   107        #   - stderr
   108      token-bucket:
   109        rotateOutputPath: log/runtime/polaris-ratelimit.log
   110        errorRotateOutputPath: log/runtime/polaris-ratelimit-error.log
   111        rotationMaxSize: 100
   112        rotationMaxBackups: 10
   113        rotationMaxAge: 7
   114        outputLevel: info
   115        # outputPaths:
   116        #   - stdout
   117        # errorOutputPaths:
   118        #   - stderr
   119      default:
   120        rotateOutputPath: log/runtime/polaris-default.log
   121        errorRotateOutputPath: log/runtime/polaris-default-error.log
   122        rotationMaxSize: 100
   123        rotationMaxBackups: 10
   124        rotationMaxAge: 7
   125        outputLevel: info
   126        # outputPaths:
   127        #   - stdout
   128        # errorOutputPaths:
   129        #   - stderr
   130      discoverEventLocal:
   131        rotateOutputPath: log/event/polaris-discoverevent.log
   132        errorRotateOutputPath: log/event/polaris-discoverevent-error.log
   133        rotationMaxSize: 100
   134        rotationMaxBackups: 10
   135        rotationMaxAge: 7
   136        outputLevel: info
   137        onlyContent: true
   138        # outputPaths:
   139        #   - stdout
   140        # errorOutputPaths:
   141        #   - stderr
   142      discoverLocal:
   143        rotateOutputPath: log/statis/polaris-discoverstat.log
   144        errorRotateOutputPath: log/statis/polaris-discoverstat-error.log
   145        rotationMaxSize: 100
   146        rotationMaxBackups: 10
   147        rotationMaxAge: 7
   148        outputLevel: info
   149        # outputPaths:
   150        #   - stdout
   151        # errorOutputPaths:
   152        #   - stderr
   153      local:
   154        rotateOutputPath: log/statis/polaris-statis.log
   155        errorRotateOutputPath: log/statis/polaris-statis-error.log
   156        rotationMaxSize: 100
   157        rotationMaxBackups: 10
   158        rotationMaxAge: 7
   159        outputLevel: info
   160        # outputPaths:
   161        #   - stdout
   162        # errorOutputPaths:
   163        #   - stderr
   164      HistoryLogger:
   165        rotateOutputPath: log/operation/polaris-history.log
   166        errorRotateOutputPath: log/operation/polaris-history-error.log
   167        rotationMaxSize: 100
   168        rotationMaxBackups: 10
   169        rotationMaxAge: 7
   170        rotationMaxDurationForHour: 24
   171        outputLevel: info
   172        onlyContent: true
   173        # outputPaths:
   174        #   - stdout
   175        # errorOutputPaths:
   176        #   - stderr
   177      cmdb:
   178        rotateOutputPath: log/runtime/polaris-cmdb.log
   179        errorRotateOutputPath: log/runtime/polaris-cmdb-error.log
   180        rotationMaxSize: 100
   181        rotationMaxBackups: 10
   182        rotationMaxAge: 7
   183        outputLevel: info
   184        # outputPaths:
   185        #   - stdout
   186        # errorOutputPaths:
   187        #   - stderr
   188    # 按顺序启动server
   189    startInOrder:
   190      open: true # 是否开启,默认是关闭
   191      key: sz # 全局锁
   192    # 注册为北极星服务
   193    polaris_service:
   194      # probe_address: ##DB_ADDR##
   195      enable_register: true
   196      isolated: false
   197      services:
   198        - name: polaris.checker
   199          protocols:
   200            - service-grpc
   201  # apiserver配置
   202  apiservers:
   203    - name: service-eureka
   204      option:
   205        listenIP: "0.0.0.0"
   206        listenPort: 8761
   207        namespace: default
   208        owner: polaris
   209        refreshInterval: 10
   210        deltaExpireInterval: 60
   211        unhealthyExpireInterval: 180
   212        connLimit:
   213          openConnLimit: false
   214          maxConnPerHost: 1024
   215          maxConnLimit: 10240
   216          whiteList: 127.0.0.1
   217          purgeCounterInterval: 10s
   218          purgeCounterExpired: 5s
   219    - name: api-http # 协议名,全局唯一
   220      option:
   221        listenIP: "0.0.0.0"
   222        listenPort: 8090
   223        enablePprof: true # debug pprof
   224        enableSwagger: true
   225        connLimit:
   226          openConnLimit: false
   227          maxConnPerHost: 128
   228          maxConnLimit: 5120
   229          whiteList: 127.0.0.1
   230          purgeCounterInterval: 10s
   231          purgeCounterExpired: 5s
   232      api:
   233        admin:
   234          enable: true
   235        console:
   236          enable: true
   237          include: [default]
   238        client:
   239          enable: true
   240          include: [discover, register, healthcheck]
   241        config:
   242          enable: true
   243          include: [default]
   244    - name: service-grpc
   245      option:
   246        listenIP: "0.0.0.0"
   247        listenPort: 8091
   248        connLimit:
   249          openConnLimit: false
   250          maxConnPerHost: 128
   251          maxConnLimit: 5120
   252        enableCacheProto: true
   253        sizeCacheProto: 128
   254        tls:
   255          certFile: ""
   256          keyFile: ""
   257          trustedCAFile: ""
   258      api:
   259        client:
   260          enable: true
   261          include: [discover, register, healthcheck]
   262    - name: config-grpc
   263      option:
   264        listenIP: "0.0.0.0"
   265        listenPort: 8093
   266        connLimit:
   267          openConnLimit: false
   268          maxConnPerHost: 128
   269          maxConnLimit: 5120
   270      api:
   271        client:
   272          enable: true
   273    - name: xds-v3
   274      option:
   275        listenIP: "0.0.0.0"
   276        listenPort: 15010
   277        connLimit:
   278          openConnLimit: false
   279          maxConnPerHost: 128
   280          maxConnLimit: 10240
   281    # - name: service-l5
   282    #   option:
   283    #     listenIP: 0.0.0.0
   284    #     listenPort: 7779
   285    #     clusterName: cl5.discover
   286  # 核心逻辑的配置
   287  auth:
   288    # auth的option现已迁移至user及strategy
   289    # 在auth.option配置依然有效,但是会收到警告,提醒您尽快迁移配置至user及strategy级别下
   290    user:
   291      name: defaultUser
   292      option:
   293        # token 加密的 salt,鉴权解析 token 时需要依靠这个 salt 去解密 token 的信息
   294        # salt 的长度需要满足以下任意一个:len(salt) in [16, 24, 32]
   295        salt: polarismesh@2021
   296    strategy:
   297      name: defaultStrategy
   298      option:
   299        # 控制台鉴权能力开关,默认开启
   300        consoleOpen: true
   301        # 客户端鉴权能力开关, 默认关闭
   302        clientOpen: false
   303  namespace:
   304    # 是否允许自动创建命名空间
   305    autoCreate: true
   306  naming:
   307    auth:
   308      open: false
   309    # 批量控制器
   310    batch:
   311      register:
   312        open: true
   313        queueSize: 10240
   314        waitTime: 32ms
   315        maxBatchCount: 128
   316        concurrency: 128
   317        dropExpireTask: true
   318        taskLife: 30s
   319      deregister:
   320        open: true
   321        queueSize: 10240
   322        waitTime: 32ms
   323        maxBatchCount: 128
   324        concurrency: 128
   325      clientRegister:
   326        open: true
   327        queueSize: 10240
   328        waitTime: 32s
   329        maxBatchCount: 1024
   330        concurrency: 64
   331      clientDeregister:
   332        open: true
   333        queueSize: 10240
   334        waitTime: 32ms
   335        maxBatchCount: 32
   336        concurrency: 64
   337  # 健康检查的配置
   338  healthcheck:
   339    open: true
   340    service: polaris.checker
   341    slotNum: 30
   342    minCheckInterval: 1s
   343    maxCheckInterval: 30s
   344    clientReportInterval: 120s
   345    # 忽略复制过来的实例,不对其进行健康状态的转换
   346    omitReplicated: false
   347    batch:
   348      heartbeat:
   349        open: true
   350        queueSize: 10240
   351        waitTime: 32ms
   352        maxBatchCount: 32
   353        concurrency: 64
   354    checkers:
   355      - name: heartbeatRedis
   356        option:
   357          kvAddr: 127.0.0.1:6379
   358           # ACL user from redis v6.0, remove it if ACL is not available
   359          kvUser: ##REDIS_USER#
   360          kvPasswd: ##REDIS_PWD##
   361          poolSize: 200
   362          minIdleConns: 30
   363          idleTimeout: 120s
   364          connectTimeout: 200ms
   365          msgTimeout: 200ms
   366          concurrency: 200
   367          withTLS: false
   368  # 配置中心模块启动配置
   369  config:
   370    # 是否启动配置模块
   371    open: true
   372  # 缓存配置
   373  cache:
   374    open: true
   375    resources:
   376      - name: service # 加载服务数据
   377        option:
   378          disableBusiness: false # 不加载业务服务
   379          needMeta: true # 加载服务元数据
   380      - name: instance # 加载实例数据
   381        option:
   382          disableBusiness: false # 不加载业务服务实例
   383          needMeta: true # 加载实例元数据
   384      - name: routingConfig # 加载路由数据
   385      - name: rateLimitConfig # 加载限流数据
   386      - name: circuitBreakerConfig # 加载熔断数据
   387      - name: users # 加载用户、用户组数据
   388      - name: strategyRule # 加载鉴权规则数据
   389      - name: namespace # 加载命名空间数据
   390      - name: client # 加载命名空间数据
   391      - name: configFile
   392        option:
   393          #配置文件缓存过期时间,单位s
   394          expireTimeAfterWrite: 3600
   395      - name: faultDetectRule
   396  #    - name: l5 # 加载l5数据
   397  # 存储配置
   398  store:
   399    # 单机文件存储插件
   400    # name: boltdbStore
   401    # option:
   402    #   path: ./polaris.bolt
   403    # ## 数据库存储插件
   404    name: defaultStore
   405    option:
   406      master:
   407        dbType: mysql
   408        dbName: polaris_server
   409        dbUser: ${MYSQL_DB_USER} ##DB_USER##
   410        dbPwd: ${MYSQL_DB_PWD} ##DB_PWD##
   411        dbAddr: "127.0.0.1:3306" ##DB_ADDR##
   412        maxOpenConns: -1
   413        maxIdleConns: -1
   414        connMaxLifetime: 300 # 单位秒
   415        txIsolationLevel: 2 #LevelReadCommitted
   416  # 插件配置
   417  plugin:
   418    # whitelist:
   419    #   name: whitelist
   420    #   option:
   421    #     ip: [127.0.0.1]
   422    cmdb:
   423      name: memory
   424      option:
   425        url: ""
   426        interval: 60s
   427    history:
   428      entries:
   429        - name: HistoryLogger
   430    discoverEvent:
   431      entries:
   432        - name: discoverEventLocal
   433    discoverStatis:
   434      name: discoverLocal
   435      option:
   436        interval: 60 # 统计间隔,单位为秒
   437    statis:
   438      name: local
   439      option:
   440        interval: 60 # 统计间隔,单位为秒
   441    ratelimit:
   442      name: token-bucket
   443      option:
   444        remote-conf: false # 是否使用远程配置
   445        ip-limit: # ip级限流,全局
   446          open: true # 系统是否开启ip级限流
   447          global:
   448            open: true
   449            bucket: 300 # 最高峰值
   450            rate: 200 # 平均一个IP每秒的请求数
   451          resource-cache-amount: 1024 # 最大缓存的IP个数
   452          white-list: [127.0.0.1]
   453        instance-limit:
   454          open: true
   455          global:
   456            bucket: 200
   457            rate: 100
   458          resource-cache-amount: 1024
   459        api-limit: # 接口级限流
   460          open: false # 是否开启接口限流,全局开关,只有为true,才代表系统的限流开启。默认关闭
   461          rules:
   462            - name: store-read
   463              limit:
   464                open: true # 接口的全局配置,如果在api子项中,不配置,则该接口依据global来做限制
   465                bucket: 2000 # 令牌桶最大值
   466                rate: 1000 # 每秒产生的令牌数
   467            - name: store-write
   468              limit:
   469                open: true
   470                bucket: 1000
   471                rate: 500
   472          apis:
   473            - name: "POST:/v1/naming/services"
   474              rule: store-write
   475            - name: "PUT:/v1/naming/services"
   476              rule: store-write
   477            - name: "POST:/v1/naming/services/delete"
   478              rule: store-write
   479            - name: "GET:/v1/naming/services"
   480              rule: store-read
   481            - name: "GET:/v1/naming/services/count"
   482              rule: store-read