Open ityouknow opened 6 years ago
感觉作者有精力的话可以开个consul的专栏,期待
你好,下载了你的例子,但发现在“我们发现页面多了 service-producer 服务,点击进去后页面显示有两个服务提供者:”这块我启动了spring-cloud-consul-producer也启动了consul服务,但是在http://localhost:8500中刷新还是看不到service-producer 服务,有可能是什么原因呢?
我用的spring boot是2.0.4的,先谢谢了
问一下,consul server 和 client 对于 SpringCloud 来说应该接入那个?
说下我理解方式,不知道对不对。
consul server 模式 在服务器内网集群。
consul client 模式(加入consul server集群) 对 SpringCloud 多个微服务
是否这样运作?
请教一下大神,consul部署了集群的情况下,spring boot需要连接集群,其中 spring.cloud.consul.host 如何配置到集群中呢?默认只支持配置一个 agent 的话不是存在单点故障问题吗? 请了解的帮解答下,3k
按你的配置中spring cloud包里面是有引用到RelaxedDataBinder但是在sping-boot 2.0中该类所在的包已经被删除,请问这边怎么处理的哈
consul到底是属于ca呢还是cp呢?
“添加完 ServiceController 之后我们启动项目,访问地址:http://localhost:8505/services,返回:[]”,服务信息返回为空请问是什么原因呢
麻烦改下consul的cap类型,应该是cp,我看到好多人被误导了
@tlxlggg consul到底是属于ca呢还是cp呢?
CP
@tlxlggg consul到底是属于ca呢还是cp呢? cp,c表示一致性,p表示容错性,p是服务发现组件必须要实现的,作者有误。
@hduhans 请教一下大神,consul部署了集群的情况下,spring boot需要连接集群,其中 spring.cloud.consul.host 如何配置到集群中呢?默认只支持配置一个 agent 的话不是存在单点故障问题吗? 请了解的帮解答下,3k
consul集群,spring.cloud.consul.host目前还不能配置集群,所以consul我觉得不是一个好的服务注册中心,并且consul还有个严重的问题,就是不能自动剔除掉已经失效的服务,4年前就有人在讨论这个问题了(https://github.com/hashicorp/consul/issues/1188)。
获取service-producer报空指针异常了,有没有大佬和我一样的?注册中心可以看到已经注册了
Consul是CP不是CA,文中有误
官方文档: https://www.consul.io/intro/vs/serf.html
In CAP terms, Consul uses a CP architecture, favoring consistency over availability.
@wucao Consul是CP不是CA,文中有误
官方文档: https://www.consul.io/intro/vs/serf.html
In CAP terms, Consul uses a CP architecture, favoring consistency over availability.
已经修改,谢谢提醒。
下载了代码启动producer 控制台报:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/util/Assert
at org.springframework.boot.SpringApplication.
这个问题有人遇到过么
@TodayIsSunShine 获取service-producer报空指针异常了,有没有大佬和我一样的?注册中心可以看到已经注册了
直接用博主的源码没问题。 我自个弄的一个项目也遇到跟你一样的问题了...
@TodayIsSunShine 获取service-producer报空指针异常了,有没有大佬和我一样的?注册中心可以看到已经注册了
服务名出现了问题 我把ServiceController中的service-producer改成spring-cloud-consul-producer就好使了
学习了
赞一个
请问作者,前端如果要直接访问消费者,url如何拼写
666
Error: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@2437c6dc] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:659) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:556) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:541) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:599) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:726) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:667) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:635) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:420) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:390) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:511) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:503) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1198) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:889) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:875) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:861) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:810) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at com.neo.consul.ConsulProducerApplication.main(ConsulProducerApplication.java:11) ~[classes/:na] Caused by: java.lang.NoClassDefFoundError: io/micrometer/core/instrument/binder/hystrix/HystrixMetricsBinder at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na] at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3167) ~[na:na] at java.base/java.lang.Class.getDeclaredMethods(Class.java:2310) ~[na:na] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] ... 20 common frames omitted Caused by: java.lang.ClassNotFoundException: io.micrometer.core.instrument.binder.hystrix.HystrixMetricsBinder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na] ... 24 common frames omitted
解决了。。。。依赖包问题。。
http://www.ityouknow.com/springcloud/2018/07/20/spring-cloud-consul.html
Spring Cloud Consul 使用详解