github.com/polarismesh/polaris@v1.17.8/test/data/service_test_sqldb.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: debug
    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: debug
    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: debug
    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: debug
    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: debug
    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: debug
    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: debug
    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: debug
   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: debug
   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: debug
   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: debug
   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: debug
   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: debug
   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: debug
   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: debug
   184        # outputPaths:
   185        #   - stdout
   186        # errorOutputPaths:
   187        #   - stderr
   188  #  - name: l5pbserver
   189  #    option:
   190  #      listenIP: 0.0.0.0
   191  #      listenPort: 7779
   192  #      clusterName: cl5.discover
   193  # 核心逻辑的配置
   194  auth:
   195    # auth的option现已迁移至user及strategy
   196    # 在auth.option配置依然有效,但是会收到警告,提醒您尽快迁移配置至user及strategy级别下
   197    user:
   198      name: defaultUser
   199      option:
   200        # token 加密的 salt,鉴权解析 token 时需要依靠这个 salt 去解密 token 的信息
   201        # salt 的长度需要满足以下任意一个:len(salt) in [16, 24, 32]
   202        salt: polarismesh@2021
   203    strategy:
   204      name: defaultStrategy
   205      option:
   206        # 控制台鉴权能力开关,默认开启
   207        consoleOpen: true
   208        # 客户端鉴权能力开关, 默认关闭
   209        clientOpen: false
   210  namespace:
   211    # 是否允许自动创建命名空间
   212    autoCreate: true
   213  naming:
   214    # 批量控制器
   215    batch:
   216      register:
   217        open: true
   218        queueSize: 10240
   219        waitTime: 32ms
   220        maxBatchCount: 32
   221        concurrency: 64
   222      deregister:
   223        open: true
   224        queueSize: 10240
   225        waitTime: 32ms
   226        maxBatchCount: 32
   227        concurrency: 64
   228      clientRegister:
   229        open: true
   230        queueSize: 10240
   231        waitTime: 32ms
   232        maxBatchCount: 1024
   233        concurrency: 64
   234      clientDeregister:
   235        open: true
   236        queueSize: 10240
   237        waitTime: 32ms
   238        maxBatchCount: 32
   239        concurrency: 64
   240  # 配置中心模块启动配置
   241  config:
   242    # 是否启动配置模块
   243    open: true
   244  # 健康检查的配置
   245  healthcheck:
   246    open: true
   247    service: polaris.checker
   248    slotNum: 30
   249    minCheckInterval: 1s
   250    maxCheckInterval: 30s
   251    clientCheckInterval: 1s
   252    clientCheckTtl: 2s
   253    batch:
   254      heartbeat:
   255        open: true
   256        queueSize: 10240
   257        waitTime: 32ms
   258        maxBatchCount: 32
   259        concurrency: 64
   260    checkers:
   261      # - name: heartbeatLeader
   262      # - name: heartbeatMemory
   263      - name: heartbeatRedis
   264        option:
   265          kvAddr: ${REDIS_ADDR} ##REDIS_ADDR##
   266          kvUser: ##REDIS_USER#
   267          kvPasswd: ${REDIS_PWD} ##REDIS_PWD##
   268          poolSize: 32
   269          minIdleConns: 30
   270          idleTimeout: 120s
   271          connectTimeout: 200ms
   272          msgTimeout: 200ms
   273          concurrency: 64
   274          withTLS: false
   275  # 缓存配置
   276  cache:
   277    open: true
   278    resources:
   279      - name: service # 加载服务数据
   280        option:
   281          disableBusiness: false # 不加载业务服务
   282          needMeta: true # 加载服务元数据
   283      - name: instance # 加载实例数据
   284        option:
   285          disableBusiness: false # 不加载业务服务实例
   286          needMeta: true # 加载实例元数据
   287      - name: routingConfig # 加载路由数据
   288      - name: rateLimitConfig # 加载限流数据
   289      - name: circuitBreakerConfig # 加载熔断数据
   290      - name: users # 加载用户、用户组数据
   291      - name: strategyRule # 加载鉴权规则数据
   292      - name: namespace # 加载命名空间数据
   293      - name: client # 加载命名空间数据
   294      - name: configFile # 配置文件发布缓存
   295      - name: configGroup # 加载配置分组缓存
   296      - name: faultDetectRule
   297  # 存储配置
   298  store:
   299    # 单机文件存储插件
   300    # name: boltdbStore
   301    # option:
   302    #   path: ./polaris.bolt
   303    ## 数据库存储插件
   304    name: defaultStore
   305    option:
   306      master:
   307        dbType: mysql
   308        dbName: polaris_server
   309        dbUser: ${MYSQL_DB_USER} ##DB_USER##
   310        dbPwd: ${MYSQL_DB_PWD} ##DB_PWD##
   311        dbAddr: "127.0.0.1:3306" ##DB_ADDR##
   312        maxOpenConns: -1
   313        maxIdleConns: -1
   314        connMaxLifetime: 300 # 单位秒
   315        txIsolationLevel: 2 #LevelReadCommitted
   316  # 插件配置
   317  plugin:
   318    crypto:
   319      entries:
   320        - name: AES
   321    history:
   322      entries:
   323        - name: HistoryLogger
   324    discoverEvent:
   325      entries:
   326        - name: discoverEventLocal
   327    discoverStatis:
   328      name: discoverLocal
   329      option:
   330        interval: 60 # 统计间隔,单位为秒
   331        outputPath: ./discover-statis
   332    statis:
   333      name: local
   334      option:
   335        interval: 60 # 统计间隔,单位为秒
   336        outputPath: ./statis
   337      # api 调用指标数据计算上报到 prometheus
   338      # name: prometheus
   339      # option:
   340      #   interval: 60 # 统计间隔,单位为秒
   341    ratelimit:
   342      name: token-bucket
   343      option:
   344        remote-conf: false # 是否使用远程配置
   345        ip-limit: # ip级限流,全局
   346          open: false # 系统是否开启ip级限流
   347          global:
   348            open: false
   349            bucket: 300 # 最高峰值
   350            rate: 200 # 平均一个IP每秒的请求数
   351          resource-cache-amount: 1024 # 最大缓存的IP个数
   352          white-list: [127.0.0.1]
   353        instance-limit:
   354          open: false
   355          global:
   356            bucket: 200
   357            rate: 100
   358          resource-cache-amount: 1024
   359        api-limit: # 接口级限流
   360          open: false # 是否开启接口限流,全局开关,只有为true,才代表系统的限流开启。默认关闭
   361          rules:
   362            - name: store-read
   363              limit:
   364                open: false # 接口的全局配置,如果在api子项中,不配置,则该接口依据global来做限制
   365                bucket: 2000 # 令牌桶最大值
   366                rate: 1000 # 每秒产生的令牌数
   367            - name: store-write
   368              limit:
   369                open: false
   370                bucket: 1000
   371                rate: 500
   372          apis:
   373            - name: "POST:/v1/naming/services"
   374              rule: store-write
   375            - name: "PUT:/v1/naming/services"
   376              rule: store-write
   377            - name: "POST:/v1/naming/services/delete"
   378              rule: store-write
   379            - name: "GET:/v1/naming/services"
   380              rule: store-read
   381            - name: "GET:/v1/naming/services/count"
   382              rule: store-read