开发者社区 > 云原生 > 正文

Sentinel nacos数据源不工作

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

展开
收起
白夜行fighting 2023-06-11 10:48:20 168 0
1 条回答
写回答
取消 提交回答
  • 这是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

    2023-06-11 11:34:19
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Sentinel分布式系统下的流量防卫兵 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载