先讲下我遇到的问题,之前是用zuul和sentinel整合,dashboard可以使用,换到spring gateway后,我的程序就无法注册到dashboard上.
期待能够整合gateway和dashboard。
环境信息:jdk8,maven3.6
日志信息如下:
2019-08-12 11:15:23 App name resolved: geespace-gateway-microservice 2019-08-12 11:15:23 [SentinelConfig] JVM parameter overrides csp.sentinel.charset: UTF-8 -> UTF-8 2019-08-12 11:15:23 [SentinelConfig] JVM parameter overrides csp.sentinel.flow.cold.factor: 3 -> 3 2019-08-12 11:15:23 [SentinelConfig] Application type resolved: 0 2019-08-12 11:15:23 Add child <sentinel_default_context> to node 2019-08-12 11:15:23 Add child to node 2019-08-12 11:15:23 [InitExecutor] Found init func: com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc 2019-08-12 11:15:23 [InitExecutor] Found init func: com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc 2019-08-12 11:15:23 [InitExecutor] Found init func: com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit 2019-08-12 11:15:23 [InitExecutor] Found init func: com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc 2019-08-12 11:15:23 [InitExecutor] Found init func: com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc 2019-08-12 11:15:23 [SpiLoader] Found CommandCenter SPI: com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter with order 2147483647 2019-08-12 11:15:23 [CommandCenterProvider] CommandCenter resolved: com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter 2019-08-12 11:15:23 [CommandCenterInit] Starting command center: com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter 2019-08-12 11:15:23 [InitExecutor] Executing com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc with order -1 2019-08-12 11:15:23 [SimpleHttpHeartbeatSender] Default console address list retrieved: [sentinel-service.dev.yyb.geespace/172.16.1.30:80] 2019-08-12 11:15:23 [SpiLoader] Found HeartbeatSender SPI: com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender with order 2147483647 2019-08-12 11:15:23 [HeartbeatSenderProvider] HeartbeatSender activated: com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender 2019-08-12 11:15:23 [HeartbeatSenderInit] Heartbeat interval not configured in config property or invalid, using sender default: 10000 2019-08-12 11:15:23 [HeartbeatSenderInit] HeartbeatSender started: com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender 2019-08-12 11:15:23 [InitExecutor] Executing com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc with order -1 2019-08-12 11:15:23 [InitExecutor] Executing com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc with order 0 2019-08-12 11:15:23 [InitExecutor] Executing com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit with order 2147483647 2019-08-12 11:15:23 [TokenServiceProvider] Global token service resolved: com.alibaba.csp.sentinel.cluster.flow.DefaultTokenService 2019-08-12 11:15:23 [DefaultClusterServerInitFunc] Default entity codec and processors registered 2019-08-12 11:15:23 [InitExecutor] Executing com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc with order 2147483647 2019-08-12 11:15:23 [SlotChainProvider] Global slot chain builder resolved: com.alibaba.csp.sentinel.slots.HotParamSlotChainBuilder 2019-08-12 11:15:23 Add child to node 2019-08-12 11:15:23 [ParamFlowRuleManager] No parameter flow rules, clearing all parameter metrics 2019-08-12 11:15:23 [ParamFlowRuleManager] Hot spot parameter flow rules received: {} 2019-08-12 11:15:23 [SystemRuleManager] Current system check status: false, highestSystemLoad: 1.797693e+308, highestCpuUsage: 1.797693e+308, maxRt: 9223372036854775807, maxThread: 9223372036854775807, maxQps: 1.797693e+308 2019-08-12 11:15:23 [AuthorityRuleManager] Load authority rules: {} 2019-08-12 11:15:23 [FlowRuleManager] Flow rules loaded: {} 2019-08-12 11:15:23 [MetricWriter] Creating new MetricWriter, singleFileSize=52428800, totalFileCount=6 2019-08-12 11:15:23 [DegradeRuleManager] Degrade rules loaded: {} 2019-08-12 11:15:24 [MetricWriter] Removing metric file: C:\Users\liuty\logs\csp\geespace-gateway-microservice-metrics.log.2019-08-12 2019-08-12 11:15:24 [MetricWriter] Removing metric index file: C:\Users\liuty\logs\csp\geespace-gateway-microservice-metrics.log.2019-08-12.idx 2019-08-12 11:15:24 [MetricWriter] New metric file created: C:\Users\liuty\logs\csp\geespace-gateway-microservice-metrics.log.2019-08-12.6 2019-08-12 11:15:24 [MetricWriter] New metric index file created: C:\Users\liuty\logs\csp\geespace-gateway-microservice-metrics.log.2019-08-12.6.idx 2019-08-12 11:18:42.694 INFO App name resolved: geespace-gateway-microservice 2019-08-12 11:18:42.695 INFO [SentinelConfig] JVM parameter overrides csp.sentinel.charset: UTF-8 -> UTF-8 2019-08-12 11:18:42.699 INFO [SentinelConfig] JVM parameter overrides csp.sentinel.flow.cold.factor: 3 -> 3 2019-08-12 11:18:42.706 INFO [SentinelConfig] Application type resolved: 0 2019-08-12 11:18:42.710 INFO Add child <sentinel_default_context> to node 2019-08-12 11:18:42.713 INFO Add child to node
原提问者GitHub用户qikazhixin
您可能需要添加和配置Spring Cloud Gateway适配器:https://github.com/alibaba/Sentinel/tree/master/sentinel-adapter/sentinel-spring-cloud-gateway-adapter
或者只是使用最新版本的spring-cloud-alibaba-sentinel-gateway。参考:https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel#spring-云网关-支持
原回答者GitHub用户sczyh30
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。