第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

Alibaba Sentinel 配置項總結(jié)

標簽:
Spring Cloud

前面总结了:

这一节来总结Sentinel的所有配置。

TIPS

本文基于Sentinel 1.6.2编写,未来Sentinel发布新版本后,各位看官可按照本文中的“参考文档”,自行查阅新版本的配置项目。

Spring Cloud Alibaba Sentienl相关配置项

TIPS

参考文档:https://github.com/alibaba/spring-cloud-alibaba/blob/master/spring-cloud-alibaba-docs/src/main/asciidoc-zh/sentinel.adoc

配置项 含义 默认值
spring.cloud.sentinel.enabled Sentinel自动化配置是否生效 true
spring.cloud.sentinel.eager 取消Sentinel控制台懒加载 false
spring.cloud.sentinel.transport.port 应用与Sentinel控制台交互的端口,应用本地会起一个该端口占用的HttpServer 8719
spring.cloud.sentinel.transport.dashboard Sentinel 控制台地址
spring.cloud.sentinel.transport.heartbeat-interval-ms 应用与Sentinel控制台的心跳间隔时间
spring.cloud.sentinel.transport.client-ip 客户端IP
spring.cloud.sentinel.filter.order Servlet Filter的加载顺序。Starter内部会构造这个filter Integer.MIN_VALUE
spring.cloud.sentinel.filter.url-patterns 数据类型是数组。表示Servlet Filter的url pattern集合 /*
spring.cloud.sentinel.filter.enabled Enable to instance CommonFilter true
spring.cloud.sentinel.metric.charset metric文件字符集 UTF-8
spring.cloud.sentinel.metric.file-single-size Sentinel metric 单个文件的大小
spring.cloud.sentinel.metric.file-total-count Sentinel metric 总文件数量
spring.cloud.sentinel.log.dir Sentinel 日志文件所在的目录
spring.cloud.sentinel.log.switch-pid Sentinel 日志文件名是否需要带上pid false
spring.cloud.sentinel.servlet.block-page 自定义的跳转 URL,当请求被限流时会自动跳转至设定好的 URL
spring.cloud.sentinel.flow.cold-factor 冷启动因子 3

Alibaba Sentinel启动配置项

TIPS

参考文档:https://github.com/alibaba/Sentinel/wiki/启动配置项

sentinel-core 配置项

名称 含义 类型 默认值 是否必需 备注
project.name 指定程序的名称 String null
csp.sentinel.app.type 指定程序的类型 int 0 (APP_TYPE_COMMON) 1.6.0 引入
csp.sentinel.metric.file.single.size 单个监控文件的大小 long 52428800
csp.sentinel.metric.file.total.count 监控文件的总数上限 int 6
csp.sentinel.log.dir Sentinel 日志文件目录 String ${user.home}/logs/csp/ 1.3.0 引入
csp.sentinel.log.use.pid 日志文件名中是否加入进程号,用于单机部署多个应用的情况 boolean false 1.3.0 引入
csp.sentinel.statistic.max.rt 最大的有效响应时长(ms),超出此值则按照此值记录 int 4900ms 1.4.1 引入

其中 project.name 项用于指定应用名(appName)。若未指定,则默认从 sun.java.command 中解析出对应的类名作为应用名。实际项目使用中建议指定应用名

注意:若需要在单台机器上运行相同服务的多个实例,则需要加入 -Dcsp.sentinel.log.use.pid=true 来保证不同实例日志的独立性。

sentinel-transport-common 配置项

名称 含义 类型 默认值 是否必需
csp.sentinel.dashboard.server 控制台的地址,指定控制台后客户端会自动向该地址发送心跳包。地址格式为:hostIp:port String null
csp.sentinel.heartbeat.interval.ms 心跳包发送周期,单位毫秒 long null 非必需,若不进行配置,则会从相应的 HeartbeatSender中提取默认值
csp.sentinel.api.port 本地启动 HTTP API Server 的端口号 int null 是,且不可冲突

使用说明

所有参数均可通过 JVM -D 参数指定。除 project.name 以及日志的配置项(如 csp.sentinel.log.dir)之外,其余参数还可通过 properties 文件指定,路径为 ${user_home}/logs/csp/${project.name}.properties

优先级顺序:JVM -D 参数的优先级最高,若 properties 和 JVM 参数中有相同项的配置,以 JVM -D 参数配置的为准。

本文首发

································

欢迎关注课程

點擊查看更多內(nèi)容
8人點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消