Sentinel nacos数据源不工作:
组件信息
Sentinel, Nacos
描述错误
Sentinel nacos数据源不工作。
请查看以下应用程序,有关运行应用程序的信息,请参阅README.mdhttps://github.com/jinternals/spring-cloud-alibaba
修复了代码中缺少图像的问题。
Data ID: sentinel-nacos-demo Group: DEFAULT_GROUP Configuration : { "resource": "/actuator/health", "limitApp": "default", "count": 2 }
. ____ _ __ _ _ /\ / ' __ _ () __ __ _ \ \
( ( )__ | '_ | '| | ' / ` | \ \
/ )| |)| | | | | || (| | ) ) ) ) ' || .__|| ||| |_, | / / / / =========||==============|/=//// :: Spring Boot :: (v2.1.3.RELEASE)
Tue Feb 19 14:13:56 UTC 2019 org.springframework.boot.loader.LaunchedURLClassLoader@377dca04 JM.Log:INFO Init JM logger with Slf4jLoggerFactory success, org.springframework.boot.loader.LaunchedURLClassLoader@377dca04 Tue Feb 19 14:13:56 UTC 2019 org.springframework.boot.loader.LaunchedURLClassLoader@377dca04 JM.Log:INFO Log root path: /root/logs/ Tue Feb 19 14:13:56 UTC 2019 org.springframework.boot.loader.LaunchedURLClassLoader@377dca04 JM.Log:INFO Set nacos log path: /root/logs/nacos 2019-02-19 14:13:56.245 INFO 1 --- [ main] c.a.n.client.identify.CredentialWatcher : [] [] [] No credential found 2019-02-19 14:13:56.334 INFO 1 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='NACOS', propertySources=[NacosPropertySource {name='sentinel-nacos-demo.properties'}]} 2019-02-19 14:13:56.339 INFO 1 --- [ main] c.j.alibaba.sentinel.Application : No active profile set, falling back to default profiles: default 2019-02-19 14:13:56.857 WARN 1 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'nacos-config' contains invalid characters, please migrate to a valid format. 2019-02-19 14:13:57.035 INFO 1 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=282b6ce5-6419-3a93-9b9c-2d63dda737d6 2019-02-19 14:13:57.275 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.sentinel-org.springframework.cloud.alibaba.sentinel.SentinelProperties' of type [org.springframework.cloud.alibaba.sentinel.SentinelProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO: log base dir is: /root/logs/csp/ INFO: log name use pid is: false 2019-02-19 14:13:57.331 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.alibaba.sentinel.custom.SentinelAutoConfiguration' of type [org.springframework.cloud.alibaba.sentinel.custom.SentinelAutoConfiguration$$EnhancerBySpringCGLIB$$946e614] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-02-19 14:13:57.337 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$67f61cee] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-02-19 14:13:57.681 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-02-19 14:13:57.711 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-02-19 14:13:57.712 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16] 2019-02-19 14:13:57.724 INFO 1 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib] 2019-02-19 14:13:57.796 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-02-19 14:13:57.796 INFO 1 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1442 ms 2019-02-19 14:13:57.910 INFO 1 --- [ main] o.s.c.a.s.SentinelWebAutoConfiguration : [Sentinel Starter] register Sentinel with urlPatterns: [/*]. 2019-02-19 14:13:58.379 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-02-19 14:13:58.734 INFO 1 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 19 endpoint(s) beneath base path '/actuator' 2019-02-19 14:13:58.855 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2019-02-19 14:13:58.857 INFO 1 --- [ main] c.j.alibaba.sentinel.Application : Started Application in 3.435 seconds (JVM running for 3.775)
在启动时更新版本后,它会从nacos加载规则。但是,如果您从sentinel编辑规则,它将不会同步回nacos,这是预期行为吗?
如果你们能给我指明正确的方向(从哪里开始,因为我是开源贡献的新手),我可以做这项工作。
原提问者GitHub用户mradulpandey
这是0.2.1.RELEASE版本中的一个小调试。如果具有该dataId和groupId的nacos中不存在json数据,则数据源不工作。所以我们在SentinelProperties中添加了一个新的配置规则类型,以在下一个版本中解决这个问题(主分支已经更新)。也许您可以使用nacos-open-api在初始化脚本中创建带有dataId和groupId的json数据。
ApplicationStartedEvent在Greenwich和Finchley中似乎不兼容。您可以将spring-cloud降级为Finchley.SR2,将spring-boot降级为2.0.3.RELEASE。
然后删除sentinel-datasource-nacos,因为它包含在spring cloud中的alibaba依赖项bom中(在0.2.1.RELEASE版本中,sentinel-datasource nacos的版本是1.4.0)。
最后,您可以使用nacos-open-api在初始化脚本中创建带有该dataId和groupId的json数据,如上所述,因为这是一个小错误,或者您可以使用UI创建带有dataId和groupId的json数据,然后重新启动sentinel-nacos-demo。
现在不支持将规则从sentinel仪表板同步回nacos。您可以自己改进sentinel仪表板来支持这一点。
这是Sentinel.的一个特点。您可以在中创建新问题https://github.com/alibaba/Sentinel/issues.
原回答者GitHub用户fangjian0423
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。