搭建文档参考
https://segmentfault.com/a/1190000019094867
api功能测试
参考文档 https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0
第 3.2.1 节 获取App的环境,集群信息
下载 sentinel 1.6 源码,拷贝test 目录下的 apollo到工程的rule目录下
解决 user(dataChangeLastModifiedBy) not exists 报错问题需要 设置 FlowRuleApolloPublisher
openItemDTO.setDataChangeCreatedBy("apollo");
Caused by: com.ctrip.framework.apollo.openapi.client.exception.ApolloOpenApiException: Request to apollo open api failed, status code: 400, reason: , message: {"exception":"com.ctrip.framework.apollo.common.exception.BadRequestException","message":"user(dataChangeLastModifiedBy) not exists","status":400,"timestamp":"2019-05-26T23:03:31.2"}
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.checkHttpResponseStatus(AbstractOpenApiService.java:99) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:80) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:74) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.put(AbstractOpenApiService.java:54) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.ItemOpenApiService.createOrUpdateItem(ItemOpenApiService.java:120) ~[apollo-openapi-1.2.0.jar:1.2.0]
... 65 common frames omitted
解决 user(releaseBy) not exists 报错问题需要 设置 FlowRuleApolloPublisher
namespaceReleaseDTO.setReleasedBy("apollo");
Caused by: com.ctrip.framework.apollo.openapi.client.exception.ApolloOpenApiException: Request to apollo open api failed, status code: 400, reason: , message: {"exception":"com.ctrip.framework.apollo.common.exception.BadRequestException","message":"user(releaseBy) not exists","status":400,"timestamp":"2019-05-26T23:17:51.724"}
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.checkHttpResponseStatus(AbstractOpenApiService.java:99) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:80) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:74) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.post(AbstractOpenApiService.java:48) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.ReleaseOpenApiService.publishNamespace(ReleaseOpenApiService.java:35) ~[apollo-openapi-1.2.0.jar:1.2.0]
... 65 common frames omitted
[root@hadoop daxing]# /home/daxing/apollo-configservice-1.3.0-github/scripts/startup.sh
[root@hadoop daxing]# /home/daxing/apollo-adminservice-1.3.0-github/scripts/startup.sh
[root@hadoop daxing]# /home/daxing/apollo-portal-1.3.0-github/scripts/startup.sh
附整合好的代码
https://gitee.com/jxlgzwh/sentinel-1.6.0
对接 apollo v1.3.0 测试成功
参考:
https://segmentfault.com/a/1190000019094867
https://segmentfault.com/a/1190000018867350
https://segmentfault.com/a/1190000018723850
https://segmentfault.com/a/1190000018608117
动态规则扩展
https://github.com/alibaba/Sentinel/wiki/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%99%E6%89%A9%E5%B1%95
apollo 数据源样例
https://github.com/alibaba/Sentinel/tree/master/sentinel-demo
控制台接入
https://github.com/alibaba/Sentinel/wiki/%E6%8E%A7%E5%88%B6%E5%8F%B0