☀️ Nepxion Discovery is a solution for Spring Cloud with blue green, gray, route, limitation, circuit breaker, degrade, isolation, tracing, dye, failover, active 蓝绿灰度发布、路由、限流、熔断、降级、隔离、追踪、流量染色、故障转移、多活
提醒:版本号右边, ↑
表示>=该版本号, ↓
表示<=该版本号
版本 | 状态 | SC | SB | SCA |
---|---|---|---|---|
9.0.0 (商业版) | 2022.x.x | 3.0.x | 2022.x.x.x | |
8.0.0 (商业版) | 2021.x.x | 2.7.x 2.6.x |
2021.x.x.x | |
7.0.0 (商业版) | 2020.x.x | 2.5.x 2.4.1 ↑ |
2021.x | |
6.21.0 | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.7.RELEASE ↑ | |
6.12.11 ↓ | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.6.RELEASE ↓ 2.1.x 2.0.x |
|
G | 2.1.x | 2.1.x | ||
F | 2.0.x | 2.0.x | ||
3.38.0 | E | 1.5.x | 1.5.x | |
D | 1.x.x | 1.5.x | ||
C | 1.x.x | 1.5.x |
表示维护中 | 表示不维护,但可用,强烈建议升级 | 表示不维护,不可用,已废弃
① 6.x.x
② 7.x.x
③ 8.x.x
④ 9.x.x
⑤ Discovery Automation
根据组名和服务类型,查询注册中心所属组下所有服务的名称列表
描述
根据组名和服务类型,查询注册中心所属组下所有服务的名称列表
请求URL
http://localhost:6001/service/service-list/{group}
请求类型
POST
请求参数
名称 | 类型 | 参数 | 是否必须 | 描述 |
---|---|---|---|---|
group | String | PathVariable | 是 | 组名 |
serviceTypes | List<String> |
RequestBody | 是 | 服务类型列表。取值:service gateway 如果查询全部,则输入包含两者的列表 |
返回参数
参数类型 | 描述 |
---|---|
List<String> |
服务名列表 |
优化UuidUtil,并增加单元测试
把Spring Boot Admin的依赖提升到Example的顶级Parent
删除.travis.yml
无
发布1.1.0版本
发布1.1.0版本
发布1.1.0版本
发布1.1.0版本
无
无
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryAgent/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryDesktop/releases
获取最新版本
见 Nepxion Discovery 6.21.0发布
提醒:版本号右边, ↑
表示>=该版本号, ↓
表示<=该版本号
版本 | 状态 | SC | SB | SCA |
---|---|---|---|---|
9.0.0 (商业版) | 2022.x.x | 3.0.x | 2022.x.x.x | |
8.0.0 (商业版) | 2021.x.x | 2.7.x 2.6.x |
2021.x.x.x | |
7.0.0 (商业版) | 2020.x.x | 2.5.x 2.4.1 ↑ |
2021.x | |
6.20.0 | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.7.RELEASE ↑ | |
6.12.10 ↓ | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.6.RELEASE ↓ 2.1.x 2.0.x |
|
G | 2.1.x | 2.1.x | ||
F | 2.0.x | 2.0.x | ||
3.37.0 | E | 1.5.x | 1.5.x | |
D | 1.x.x | 1.5.x | ||
C | 1.x.x | 1.5.x |
表示维护中 | 表示不维护,但可用,强烈建议升级 | 表示不维护,不可用,已废弃
① 6.x.x
② 7.x.x
③ 8.x.x
④ 9.x.x
① CVE-2022-1471 : Remote Code Execution via SnakeYAML Deserialization Gadgets
解决方案 : 通过com.nepxion.discovery.common.yaml.YamlSafeConstructor构造SnakeYAML对象
② CVE-2022-23463 : Remote Code Execution Vulnerability via SpEL Injection
解决方案 : 使用Spring StandardEvaluationContext类,StandardEvaluationContext支持全部的Spel语法且功能齐全,但GitHub Security报告其存在一定的注入风险,推荐使用SimpleEvaluationContext,而SimpleEvaluationContext并不能满足当前框架的需求。如果未使用验证SPEL表达式方法,可以通过下面开关关闭在方法在策略端点上的暴露,规避风险
spring.application.admin.strategy.endpoint.validate-expression.enabled=true
spring.application.console.strategy.endpoint.validate-expression.enabled=true
静态版本,指服务实例的版本号采用非时间戳或者非数字递增的方式(例如,旧版本的版本号为basic
,新版本的版本号为gray
),导致链路智能编排的时候,无法确认旧的稳定版本。
在Nepxion Discovery 6.20.0版本中,使用者只需要在规则策略上加入版本号排序类型sort: time
,即可支持不可排序版本的链路智能编排
service:
- discovery-guide-service-a
- discovery-guide-service-b
blueGreen:
- expression: "#H['xyz'] == '1'"
route: green
- expression: "#H['xyz'] == '2'"
route: blue
gray:
- expression: "#H['xyz'] == '3'"
weight:
- 90
- 10
- expression: "#H['xyz'] == '4'"
weight:
- 70
- 30
- weight:
- 100
- 0
sort: time
版本号排序类型(sort
),可选值为version
和time
,缺省为version
(不需要配置sort: version
)
version
时,适用于版本号采用时间戳或者数字递增的方式。处理逻辑为将排序后版本号列表的第一个值作为旧的稳定版本time
时,不限于版本号的格式。处理逻辑为将根据服务实例全局唯一ID的时间戳前缀进行排序,把上线时间最早的服务实例的版本号作为旧的稳定版本https://github.com/Nepxion/DiscoveryTool/tree/automation
云上测试包含如下主要功能
testcase-id
testcase-id
的日志testcase-id
获取和显示属于指定Web界面终端的日志适用于测试环境或者开发环境
具体用法,请参考
https://github.com/Nepxion/Discovery/wiki/全链路自动化模拟流程测试
https://gitee.com/nepxion/Discovery/wikis/pages?sort_id=6481457&doc_id=1124387
适用于生产环境
具体用法,请参考
https://github.com/Nepxion/Discovery/wiki/全链路自动化流量侦测测试
https://gitee.com/nepxion/Discovery/wikis/pages?sort_id=6481458&doc_id=1124387
当使用者采用上线时间作为版本排序依据的时候,需要把版本号排序类型设置为time
。该方案同时适用于业务服务,Spring Cloud Gateway和Zuul网关
# 版本号排序类型。缺失则默认为version
# 版本故障转移或者版本偏好启动时,需要寻址旧的稳定版本
# 1. 当排序类型为version时,适用于版本号采用时间戳或者数字递增的方式。处理逻辑为将排序后版本号列表的第一个值作为旧的稳定版本
# 2. 当排序类型为time时,不限于版本号的格式。处理逻辑为将根据服务实例全局唯一ID的时间戳前缀进行排序,把上线时间最早的服务实例的版本号作为旧的稳定版本
# spring.application.strategy.version.sort.type=version
spring.application.strategy.version.sort.type=time
以Nacos注册中心的版本号元数据为例,装载元数据的优先级顺序由高到底为
public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
if (EnvironmentUtil.isStandardEnvironment(environment)) {
PluginMetaDataPreInstallation.getMetadata().put("abc", "123");
}
}
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
}
}
在src/main/resources/META-INF/spring.factories加上
org.springframework.boot.env.EnvironmentPostProcessor=\
com.xxx.yyy.zzz.MyEnvironmentPostProcessor
服务端点增加新的开关配置
# 启动和关闭服务相关操作端点。缺失则默认为true
spring.application.admin.service.endpoint.enabled=true
# 启动和关闭配置相关操作端点。缺失则默认为true
spring.application.admin.config.endpoint.enabled=true
# 启动和关闭版本相关操作端点。缺失则默认为true
spring.application.admin.version.endpoint.enabled=true
# 启动和关闭侦测相关操作端点。缺失则默认为true
spring.application.admin.inspector.endpoint.enabled=true
# 启动和关闭路由相关操作端点。缺失则默认为true
spring.application.admin.router.endpoint.enabled=true
# 启动和关闭策略相关操作端点。缺失则默认为true
spring.application.admin.strategy.endpoint.enabled=true
# 启动和关闭Sentinel相关操作端点。缺失则默认为true
spring.application.admin.sentinel.endpoint.enabled=true
# 启动和关闭Git相关操作端点。缺失则默认为true
spring.application.admin.git.endpoint.enabled=true
# 启动和关闭Spring Cloud Gateway相关操作端点。缺失则默认为true
spring.application.admin.gateway.endpoint.enabled=true
# 启动和关闭Zuul相关操作端点。缺失则默认为true
spring.application.admin.zuul.endpoint.enabled=true
# 启动和关闭策略操作端点的验证SPEL表达式方法。缺失则默认为true
# 该端点方法使用Spring StandardEvaluationContext类,StandardEvaluationContext支持全部的Spel语法且功能齐全,但GitHub Security报告其存在一定的注入风险,推荐使用SimpleEvaluationContext,而SimpleEvaluationContext并不能满足当前框架的需求
# 如果未使用验证SPEL表达式方法,可以通过下面开关关闭在方法在策略端点上的暴露,规避风险
spring.application.admin.strategy.endpoint.validate-expression.enabled=true
控制台端点增加新的开关配置
# 启动和关闭服务相关操作端点。缺失则默认为true
spring.application.console.service.endpoint.enabled=true
# 启动和关闭配置相关操作端点。缺失则默认为true
spring.application.console.config.endpoint.enabled=true
# 启动和关闭版本相关操作端点。缺失则默认为true
spring.application.console.version.endpoint.enabled=true
# 启动和关闭侦测相关操作端点。缺失则默认为true
spring.application.console.inspector.endpoint.enabled=true
# 启动和关闭网关路由相关操作端点。缺失则默认为true
spring.application.console.route.endpoint.enabled=true
# 启动和关闭策略相关操作端点。缺失则默认为true
spring.application.console.strategy.endpoint.enabled=true
# 启动和关闭Sentinel相关操作端点。缺失则默认为true
spring.application.console.sentinel.endpoint.enabled=true
# 启动和关闭无损下线黑名单相关操作端点。缺失则默认为true
spring.application.console.blacklist.endpoint.enabled=true
# 启动和关闭故障转移相关操作端点。缺失则默认为true
spring.application.console.failover.endpoint.enabled=true
# 启动和关闭认证相关操作端点。缺失则默认为true
spring.application.console.authentication.endpoint.enabled=true
# 启动和关闭策略操作端点的验证SPEL表达式方法。缺失则默认为true
# 该端点方法使用Spring StandardEvaluationContext类,StandardEvaluationContext支持全部的Spel语法且功能齐全,但GitHub Security报告其存在一定的注入风险,推荐使用SimpleEvaluationContext,而SimpleEvaluationContext并不能满足当前框架的需求
# 如果未使用验证SPEL表达式方法,可以通过下面开关关闭在方法在策略端点上的暴露,规避风险
spring.application.console.strategy.endpoint.validate-expression.enabled=true
自定义注入Header,实现StrategyHeadersInjector,允许同时注入多个,每个类里允许多个Header
public class MyStrategyHeadersInjector implements StrategyHeadersInjector {
@Override
public List<HeadersInjectorEntity> getHeadersInjectorEntityList() {
return Arrays.asList(
new HeadersInjectorEntity(HeadersInjectorType.TRANSMISSION, Arrays.asList("test1")),
new HeadersInjectorEntity(HeadersInjectorType.TRACER, Arrays.asList("test2")),
new HeadersInjectorEntity(HeadersInjectorType.ALL, Arrays.asList("test3")));
}
}
参数含义
自定义注入扫描目录,实现StrategyPackagesInjector,允许同时注入多个,每个类里允许多个扫描目录
public class MyStrategyPackagesInjector implements StrategyPackagesInjector {
@Override
public List<PackagesInjectorEntity> getPackagesInjectorEntityList() {
return Arrays.asList(
new PackagesInjectorEntity(PackagesInjectorType.RPC, Arrays.asList("com.nepxion.discovery.guide.test.test1")),
new PackagesInjectorEntity(PackagesInjectorType.PROVIDER_ISOLATION, Arrays.asList("com.nepxion.discovery.guide.test.test2")),
new PackagesInjectorEntity(PackagesInjectorType.TRACER, Arrays.asList("com.nepxion.discovery.guide.test.test3")),
new PackagesInjectorEntity(PackagesInjectorType.ALL, Arrays.asList("com.nepxion.discovery.guide.test.test4"))
);
}
}
参数含义
自定义方法输出到调用链,通过在带有@RestController或者@ServiceStrategy注解的类的方法头部上增加如下注解,即忽略该方法埋点输出、日志输出、告警输出
@ServiceMonitorIgnore
支持配置式Header和注入式Header的输出
忽略Header传值的时候,有值才忽略,无值不做处理
优化策略拦截器的构造方式,并抽象出获取自定义Header的StrategyHeaderContext
优化调试模式下,Header以及相关上下文输出,由System.out.println改成LOG.info
DefaultDiscoveryEnabledAdapter
的strategyEnabledFilterList
从private修改为protectedDefaultServiceStrategyMonitor
的serviceStrategyMonitorAdapterList
从private修改为protected@PostConstruct
注解的方法从private修改为protecteddiscovery-plugin-test-starter-automation
去除不必要的依赖spring-boot-starter-web
https://logback.qos.ch/manual/layouts.html#coloring
# 启动和关闭DiscoveryAgent安装校验,一旦启动,如果未安装DiscoveryAgent,则抛错退出应用,该配置只适用于Spring Cloud 202x版。缺失则默认为true
spring.application.strategy.agent.validation.enabled=true
修复在AbstractServiceStrategyRouteFilter中webClientCoreHeaderTransmissionEnabled开关丢失的缺陷
修复非bootstrap场景下,系统参数设置的缺陷
修复Spring Cloud LoadBalancer的旗标文件目录过长,会导致无法读取的缺陷
发布1.0.0版本
发布1.0.0版本
发布1.0.0版本
发布1.0.0版本
无
无
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryAgent/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryDesktop/releases
获取最新版本
见 Nepxion Discovery 6.20.0发布
提醒:版本号右边, ↑
表示>=该版本号, ↓
表示<=该版本号
版本 | 状态 | SC | SB | SCA |
---|---|---|---|---|
8.0.0 (商业版) | 2021.x.x | 2.7.x 2.6.x |
2021.x.x.x | |
7.0.0 (商业版) | 2020.x.x | 2.5.x 2.4.1 ↑ |
2021.x | |
6.19.0 | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.7.RELEASE ↑ | |
6.12.9 ↓ | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.6.RELEASE ↓ 2.1.x 2.0.x |
|
G | 2.1.x | 2.1.x | ||
F | 2.0.x | 2.0.x | ||
3.36.0 | E | 1.5.x | 1.5.x | |
D | 1.x.x | 1.5.x | ||
C | 1.x.x | 1.5.x |
表示维护中 | 表示不维护,但可用,强烈建议升级 | 表示不维护,不可用,已废弃
① 6.x.x
② 7.x.x
③ 8.x.x
6.18.0之前版本的管理中心默认集成Swagger组件,有些公司业务服务自身使用的Swagger版本过高或者过低,引入管理中心会引起不兼容的问题。从6.18.0版本提供两种方式的管理中心
<dependency>
<groupId>com.nepxion</groupId>
<!-- 不集成Swagger组件的管理中心 -->
<artifactId>discovery-plugin-admin-center-starter</artifactId>
<!-- 集成Swagger组件的管理中心 -->
<artifactId>discovery-plugin-admin-center-starter-swagger</artifactId>
</dependency>
新增过滤器中外置Header转换和植入,该用法通过把域名前缀转化成蓝绿灰度条件表达式中的驱动参数
,进而实现基于域名前缀的全链路蓝绿灰度发布。该功能只支持网关侧,不支持服务侧
基于域名前缀的全链路蓝绿灰度发布逻辑
当外界请求的域名为a.nepxion.com,执行新版本路由
当外界请求的域名为b.nepxion.com,执行旧版本路由
当外界请求的域名为a.nepxion.com,执行新旧版本路由的某一种百分比
当外界请求的域名为b.nepxion.com,执行新旧版本路由的另一种百分比
示例如下
public class MyGatewayStrategyRouteFilter extends DefaultGatewayStrategyRouteFilter {
@Autowired
private GatewayStrategyContextHolder gatewayStrategyContextHolder;
// 把域名前缀转化成蓝绿灰度条件表达式中的驱动参数
@Override
public Map<String, String> getExternalHeaderMap() {
String host = gatewayStrategyContextHolder.getURI().getHost();
String domain = host.substring(0, host.indexOf("."));
Map<String, String> externalHeaderMap = new HashMap<String, String>();
externalHeaderMap.put("domain", domain);
return externalHeaderMap;
}
}
使用者根据具体情况,也可以解析域名中间部分当作驱动参数,甚至直接把全域名当作驱动参数,那么策略规则的驱动参数则对应为domain
Yaml
格式
service:
- discovery-guide-service-a
- discovery-guide-service-b
blueGreen:
- expression: "#H['xyz'] == '1'"
route: green
- expression: "#H['xyz'] == '2'"
route: blue
gray:
- expression: "#H['xyz'] == '3'"
weight:
- 90
- 10
- expression: "#H['xyz'] == '4'"
weight:
- 70
- 30
- weight:
- 100
- 0
header:
xyz: 1
Json
格式
{
"service": ["discovery-guide-service-a", "discovery-guide-service-b"],
"blueGreen": [
{
"expression": "#H['xyz'] == '1'",
"route": "green"
},
{
"expression": "#H['xyz'] == '2'",
"route": "blue"
}
],
"gray": [
{
"expression": "#H['xyz'] == '3'",
"weight": [90, 10]
},
{
"expression": "#H['xyz'] == '4'",
"weight": [70, 30]
},
{
"weight": [100, 0]
}
],
"header": {"xyz": "1"}
}
上述两种方式等效
① 第一次蓝绿灰度发布
通过创建版本蓝绿灰度发布
,手工输入条件表达式,后端链路智能编排。Open API支持Yaml和Json格式两种,任选一个
http://localhost:6001/strategy/create-version-release-yaml/{group}/{serviceId}
http://localhost:6001/strategy/create-version-release-json/{group}/{serviceId}
接口传输内容示例
service:
- service-a
- service-b
blueGreen:
- expression: "#H['xyz'] == '1'"
route: green
- expression: "#H['xyz'] == '2'"
route: blue
gray:
- expression: "#H['xyz'] == '3'"
weight:
- 90
- 10
- expression: "#H['xyz'] == '4'"
weight:
- 70
- 30
② 第二次以及未来N次蓝绿灰度发布
通过重新创建版本蓝绿灰度发布
,把需要重新执行蓝绿灰度发布的服务列表加入,重用上次的保留条件表达式,进行蓝绿灰度发布。Open API支持Yaml和Json格式两种,任选一个
http://localhost:6001/strategy/recreate-version-release-yaml/{group}/{serviceId}
http://localhost:6001/strategy/recreate-version-release-json/{group}/{serviceId}
接口传输内容示例
service:
- service-a
- service-b
condition: true
③ 停止蓝绿灰度发布
通过重置蓝绿灰度发布
,保留条件表达式,清除链路路由,以便下一次蓝绿灰度发布不再输入条件表达式。Open API如下
http://localhost:6001/strategy/reset-release/{group}/{serviceId}
④ 定时更新灰度发布
DevOps运维平台每隔一段时间,调整灰度权重比例(减少旧版本流量,增加新版本流量),平稳达到流量从旧版本到新版本的迁移
适用于测试环境或者开发环境
具体用法,请参考
https://github.com/Nepxion/Discovery/wiki/全链路自动化模拟流程测试
https://gitee.com/nepxion/Discovery/wikis/pages?sort_id=6481457&doc_id=1124387
适用于生产环境
具体用法,请参考
https://github.com/Nepxion/Discovery/wiki/全链路自动化流量侦测测试
https://gitee.com/nepxion/Discovery/wikis/pages?sort_id=6481458&doc_id=1124387
下面列出的是策略Open API上完整的接口
public interface StrategyResource {
// 全局订阅方式,获取Json格式的蓝绿灰度发布
ConditionStrategy getVersionRelease(String group);
// 全局订阅方式,根据Yaml格式,创建版本蓝绿灰度发布
String createVersionRelease(String group, String conditionStrategyYaml);
// 全局订阅方式,根据Json格式,创建版本蓝绿灰度发布
String createVersionRelease(String group, ConditionStrategy conditionStrategy);
// 全局订阅方式,根据Yaml格式,重新创建版本蓝绿灰度发布(创建链路智能编排,不创建条件表达式)
String recreateVersionRelease(String group, String conditionRouteStrategyYaml);
// 全局订阅方式,根据Json格式,重新创建版本蓝绿灰度发布(创建链路智能编排,不创建条件表达式)
String recreateVersionRelease(String group, ConditionRouteStrategy conditionRouteStrategy);
// 全局订阅方式,重置蓝绿灰度发布(清除链路智能编排,不清除条件表达式)
String resetRelease(String group);
// 全局订阅方式,清除蓝绿灰度发布
String clearRelease(String group);
// 局部订阅方式,获取Json格式的蓝绿灰度发布
ConditionStrategy getVersionRelease(String group, String serviceId);
// 局部订阅方式,根据Yaml格式,创建版本蓝绿灰度发布
String createVersionRelease(String group, String serviceId, String conditionStrategyYaml);
// 局部订阅方式,根据Json格式,创建版本蓝绿灰度发布
String createVersionRelease(String group, String serviceId, ConditionStrategy conditionStrategy);
// 局部订阅方式,根据Yaml格式,重新创建版本蓝绿灰度发布(创建链路智能编排,不创建条件表达式)
String recreateVersionRelease(String group, String serviceId, String conditionRouteStrategyYaml);
// 局部订阅方式,根据Json格式,重新创建版本蓝绿灰度发布(创建链路智能编排,不创建条件表达式)
String recreateVersionRelease(String group, String serviceId, ConditionRouteStrategy conditionRouteStrategy);
// 局部订阅方式,重置蓝绿灰度发布(清除链路智能编排,不清除条件表达式)
String resetRelease(String group, String serviceId);
// 局部订阅方式,清除蓝绿灰度发布
String clearRelease(String group, String serviceId);
// 根据Yaml格式,解析版本蓝绿灰度发布策略为Xml格式
String parseVersionRelease(String conditionStrategyYaml);
// 根据Json格式,解析版本蓝绿灰度发布策略为Xml格式
String parseVersionRelease(ConditionStrategy conditionStrategy);
// 根据Xml格式,反解析版本蓝绿灰度发布策略为Json格式
ConditionStrategy deparseVersionReleaseXml(String ruleXml);
// 根据Yaml格式,反解析版本蓝绿灰度发布策略为Json格式
ConditionStrategy deparseVersionReleaseYaml(String conditionStrategyYaml);
// 校验策略的条件表达式
boolean validateExpression(String expression, String validation);
}
具体用法,请参考
https://github.com/Nepxion/Discovery/wiki/如何使用DevOps运维平台对接的公共接口
https://gitee.com/nepxion/Discovery/wikis/pages?sort_id=6428158
List<Map<String, String>>
对象的返回结果List<String> filter
的过滤条件,例如,用户只想看到服务名和版本信息,就只返回带有这两个信息的侦测结果public interface InspectorResource {
String inspect(String protocol, String portal, String path, List<String> service, Map<String, String> header, List<String> filter);
List<Map<String, String>> inspectToList(String protocol, String portal, String path, List<String> service, Map<String, String> header, List<String> filter);
}
n-d-service-version
,n-d-service-region
,n-d-service-env
和n-d-service-zone
四个值,在未配置元数据的情况下,默认全链路Header传递default
值,并且如果加入了监控中间件和日志,也会默认输出default
值的埋点优化后全链路蓝绿灰度传输的Header容量为270个字节,可以减少传递80个字节Header传输量,如果接入了监控中间件,同样也能减少埋点数据量
移植并优化了Nacos内置的随机权重算法
现有内置两种随机权重算法,通过如下配置可切换到不同的算法上
# 默认随机权重算法
spring.application.weight.random.type=MapWeightRandom
# Nacos内置随机权重算法
spring.application.weight.random.type=ArrayWeightRandom
7.x.x和8.x.x版本下,当服务启动时发现DiscoveryAgent未安装,则服务启动失败,避免使用者忘记加DiscoveryAgent而导致功能有损
抽象增加fromYaml
和toYaml
两个通用方法
支持侦测结果的简化和序列化成对象
支持判断ConfigurableEnvironment
是否为StandardEnvironment
修复环境故障转移开关失效的缺陷
发布1.0.0版本
发布1.0.0版本
发布1.0.0版本
无
无
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryTool/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryAgent/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryDesktop/releases
获取最新版本
见 Nepxion Discovery 6.19.0发布
提醒:版本号右边, ↑
表示>=该版本号, ↓
表示<=该版本号
版本 | 状态 | SC | SB | SCA |
---|---|---|---|---|
8.0.0 (商业版) | 2021.x.x | 2.7.x 2.6.x |
2021.x.x.x | |
7.0.0 (商业版) | 2020.x.x | 2.5.x 2.4.1 ↑ |
2021.x | |
6.17.0 | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.7.RELEASE ↑ | |
6.12.7 ↓ | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.6.RELEASE ↓ 2.1.x 2.0.x |
|
G | 2.1.x | 2.1.x | ||
F | 2.0.x | 2.0.x | ||
3.34.0 | E | 1.5.x | 1.5.x | |
D | 1.x.x | 1.5.x | ||
C | 1.x.x | 1.5.x |
表示维护中 | 表示不维护,但可用,强烈建议升级 | 表示不维护,不可用,已废弃
无
基于简化版的Json格式,实现蓝绿灰度发布
① 新增创建版本蓝绿灰度发布接口
String createVersionRelease(String group, ConditionStrategy conditionStrategy);
String createVersionRelease(String group, String serviceId, ConditionStrategy conditionStrategy);
Json格式如下:
{
"service": ["discovery-guide-service-a", "discovery-guide-service-b"]
}
{
"service": ["discovery-guide-service-a", "discovery-guide-service-b"],
"blueGreen": [
{
"expression": "#H['a'] == '1'",
"route": "green"
},
{
"expression": "#H['a'] == '2'",
"route": "blue"
}
]
}
{
"service": ["discovery-guide-service-a", "discovery-guide-service-b"],
"gray": [
{
"weight": [0, 100]
}
]
}
② 新增解析版本蓝绿灰度发布接口
String parseVersionRelease(ConditionStrategy conditionStrategy);
③ 新增清除蓝绿灰度发布接口
String clearRelease(String group);
String clearRelease(String group, String serviceId);
更多详情,请参考https://github.com/Nepxion/Discovery/wiki/
的如何对接DevOps运维平台实施蓝绿灰度发布最佳企业级实践
① 新增创建故障转移接口
String createFailover(FailoverType failoverType, String group, String failoverValue);
String createFailover(FailoverType failoverType, String group, String serviceId, String failoverValue);
② 新增清除故障转移接口
String clearFailover(String group, FailoverType failoverType);
String clearFailover(String group, String serviceId, FailoverType failoverType);
① 新增屏蔽黑名单接口。除了IP地址和端口外,增加直接添加serviceUUId
的接口
该两个接口不仅可以支持单个UUId,也可以支持UUId的通配。例如:
20220920-113301-033-4289-533-056
,实例2的UUId为20220920-113259-190-5762-550-884
,代表它们同一天2022年09月20日
上线20220920*
通配符的方式,表示屏蔽2022年09月20日
上线的指定服务的所有实例,如果希望更精确,20220920-11*
,表示屏蔽2022年09月20日11点
上线的指定服务的所有实例String addBlacklist(String group, String targetServiceId, String targetServiceUUId);
String addBlacklist(String group, String serviceId, String targetServiceId, String targetServiceUUId);
② 新增清除黑名单接口
boolean clearBlacklist(String group);
boolean clearBlacklist(String group, String serviceId);
boolean updateRemoteRoute(GatewayType gatewayType, String group, String serviceId, String route);
boolean clearRemoteRoute(GatewayType gatewayType, String group, String serviceId);
String getRemoteRoute(GatewayType gatewayType, String group, String serviceId);
boolean updateRemoteSentinel(SentinelRuleType ruleType, String group, String serviceId, String rule);
boolean clearRemoteSentinel(SentinelRuleType ruleType, String group, String serviceId);
String getRemoteSentinel(SentinelRuleType ruleType, String group, String serviceId);
boolean updateRemoteRuleEntity(String group, String serviceId, RuleEntity ruleEntity) throws Exception;
RuleEntity getRemoteRuleEntity(String group, String serviceId) throws Exception;
String inspect(String protocol, String portalId, String contextPath, String services);
gateway
-> [ID=discovery-guide-service-a][UID=20220920-113259-190-5762-550-884][AID=11798][T=service][P=Nacos][H=192.168.31.237:3002][V=1.1][R=qa][E=common][Z=zone2][G=discovery-guide-group][A=true][TID=6f6addfd51494ff6][SID=403c9410afcfae78]
-> [ID=discovery-guide-service-b][UID=20220920-113300-733-9197-181-332][AID=11799][T=service][P=Nacos][H=192.168.31.237:4002][V=1.1][R=dev][E=common][Z=zone2][G=discovery-guide-group][A=false][TID=6f6addfd51494ff6][SID=517d61bdbb2013b1]
AppId是Apollo配置中心独有的,如果使用的不是Apollo配置中心,将不会显示这个属性
增加新的开关配置
# 启动和关闭服务相关操作端点。缺失则默认为true
spring.application.admin.service.endpoint.enabled=true
# 启动和关闭配置相关操作端点。缺失则默认为true
spring.application.admin.config.endpoint.enabled=true
# 启动和关闭版本相关操作端点。缺失则默认为true
spring.application.admin.version.endpoint.enabled=true
# 启动和关闭侦测相关操作端点。缺失则默认为true
spring.application.admin.inspector.endpoint.enabled=true
# 启动和关闭路由相关操作端点。缺失则默认为true
spring.application.admin.router.endpoint.enabled=true
# 启动和关闭策略相关操作端点。缺失则默认为true
spring.application.admin.strategy.endpoint.enabled=true
# 启动和关闭Sentinel相关操作端点。缺失则默认为true
spring.application.admin.sentinel.endpoint.enabled=true
# 启动和关闭Git相关操作端点。缺失则默认为true
spring.application.admin.git.endpoint.enabled=true
# 启动和关闭Spring Cloud Gateway相关操作端点。缺失则默认为true
spring.application.admin.gateway.endpoint.enabled=true
# 启动和关闭Zuul相关操作端点。缺失则默认为true
spring.application.admin.zuul.endpoint.enabled=true
去除旧的无意义的开关配置
# 开启和关闭服务注册层面的控制。一旦关闭,服务注册的黑/白名单过滤功能将失效,最大注册数的限制过滤功能将失效。缺失则默认为true
spring.application.register.control.enabled=true
# 开启和关闭服务发现层面的控制。一旦关闭,服务多版本调用的控制功能将失效,动态屏蔽指定IP地址的服务实例被发现的功能将失效。缺失则默认为true
spring.application.discovery.control.enabled=true
# 开启和关闭通过Rest方式对规则配置的控制和推送。一旦关闭,只能通过远程配置中心来控制和推送。缺失则默认为true
spring.application.config.rest.control.enabled=true
去除开关配置
# 负载均衡下,消费端尝试获取对应提供端初始服务实例列表为空的时候,进行重试。缺失则默认为false
spring.application.no.servers.retry.enabled=false
# 负载均衡下,消费端尝试获取对应提供端初始服务实例列表为空的时候,进行重试的次数。缺失则默认为5
spring.application.no.servers.retry.times=5
# 负载均衡下,消费端尝试获取对应提供端初始服务实例列表为空的时候,进行重试的时间间隔。缺失则默认为2000
spring.application.no.servers.retry.await.time=2000
除了提供基本的Swagger功能之外,内置模块还对使用者提供扩展
自定义Swagger接口利用内置的SwaggerConfiguration来初始化,这样使用者可以不需要定义自己的SwaggerConfiguration。通过如下配置实现
# 启动和关闭Swagger。缺失则默认为true
swagger.enabled=true
# 业务服务Swagger Docket组名
swagger.service.group=Your group
# 业务服务Swagger扫描目录
swagger.service.packages=your-package1;your-package2
# 业务服务Swagger描述
swagger.service.description=Your service Restful APIs
# 业务服务Swagger版本
swagger.service.version=1.0.0
# 业务服务Swagger License名称
swagger.service.license.name=Apache License 2.0
# 业务服务Swagger License链接
swagger.service.license.url=http://www.apache.org/licenses/LICENSE-2.0
# 业务服务Swagger联系人名称
swagger.service.contact.name=Nepxion
# 业务服务Swagger联系人网址
swagger.service.contact.url=https://github.com/Nepxion/Discovery
# 业务服务Swagger联系人邮件
[email protected]
# 业务服务Swagger服务条件网址
swagger.service.termsOfService.url=http://nepxion.com/discovery
无
无
无
访问https://github.com/Nepxion/DiscoveryAgent/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryDesktop/releases
获取最新版本
见 Nepxion Discovery 6.17.0发布
提醒:版本号右边, ↑
表示>=该版本号, ↓
表示<=该版本号
版本 | 状态 | SC | SB | SCA |
---|---|---|---|---|
8.0.0 (商业版) | 2021.x.x | 2.7.x 2.6.x |
2021.x.x.x | |
7.0.0 (商业版) | 2020.x.x | 2.5.x 2.4.1 ↑ |
2021.x | |
6.16.2 | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.7.RELEASE ↑ | |
6.12.6 ↓ | H.SR5 ↑ H G F |
2.3.x 2.2.x 2.1.x 2.0.x |
2.2.6.RELEASE ↓ 2.1.x 2.0.x |
|
G | 2.1.x | 2.1.x | ||
F | 2.0.x | 2.0.x | ||
3.33.2 | E | 1.5.x | 1.5.x | |
D | 1.x.x | 1.5.x | ||
C | 1.x.x | 1.5.x |
表示维护中 | 表示不维护,但可用,强烈建议升级 | 表示不维护,不可用,已废弃
另:
8.0.0商业版版本变更
除了IP地址和端口外,增加直接添加serviceUUId
的接口
该两个接口不仅可以支持单个UUId,也可以支持UUId的通配。例如:
① A服务有两个实例,实例1的UUId为20220920-113301-033-4289-533-056
,实例2的UUId为20220920-113259-190-5762-550-884
,代表它们同一天2022年09月20日
上线
② 通过20220920*
通配符的方式,表示屏蔽2022年09月20日
上线的指定服务的所有实例,如果希望更精确,20220920-11*
,表示屏蔽2022年09月20日11点
上线的指定服务的所有实例
String addBlacklist(String group, String serviceId, String serviceUUId);
String addBlacklist(String group, String gatewayId, String serviceId, String serviceUUId);
gateway
-> [ID=discovery-guide-service-a][UID=20220920-113259-190-5762-550-884][AID=11798][T=service][P=Nacos][H=192.168.31.237:3002][V=1.1][R=qa][E=common][Z=zone2][G=discovery-guide-group][A=true][TID=6f6addfd51494ff6][SID=403c9410afcfae78]
-> [ID=discovery-guide-service-b][UID=20220920-113300-733-9197-181-332][AID=11799][T=service][P=Nacos][H=192.168.31.237:4002][V=1.1][R=dev][E=common][Z=zone2][G=discovery-guide-group][A=false][TID=6f6addfd51494ff6][SID=517d61bdbb2013b1]
AppId是Apollo配置中心独有的,如果使用的不是Apollo配置中心,将不会显示这个属性
无
无
无
无
访问https://github.com/Nepxion/DiscoveryAgent/releases
获取最新版本
访问https://github.com/Nepxion/DiscoveryUI/releases
获取最新版本
见 Nepxion Discovery 6.16.2发布