docker-apollo
docker-apollo copied to clipboard
kubernetes中运行出错
我生成docker镜像后放在kubernetes 集群中, 用kubernetes的DNS服务发现, 三个容器之间可以通信, 但是启动的时候会连接不成功, 能不能帮忙看看?
2017-05-27 06:52:30.545 INFO 1 --- [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_APOLLO-CONFIGSERVICE/apollo-configservice-794372642-tft28:apollo-configservice:8080: registering service...
2017-05-27 06:52:30.546 ERROR 1 --- [DiscoveryClient-InstanceInfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)
at com.sun.jersey.api.client.Client.handle(Client.java:652)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
2017-05-27 06:52:30.546 WARN 1 --- [DiscoveryClient-InstanceInfoReplicator-0] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failure
2017-05-27 06:52:30.546 WARN 1 --- [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_APOLLO-CONFIGSERVICE/apollo-configservice-794372642-tft28:apollo-configservice:8080 - registration failed Cannot execute request on any known server
configservice、adminservice、portal 是容器内互联还是根据映射出的端口注册的? 如果是后者可能是容器内端口和映射端口不一致导致的。
容器内互联
在 2017年5月27日,16:43,Louis Yang [email protected] 写道:
configservice、adminservice、portal 是容器内互联还是根据映射出的端口注册的? 如果是后者可能是容器内端口和映射端口不一致导致的。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kulovecc/docker-apollo/issues/1#issuecomment-304438510, or mute the thread https://github.com/notifications/unsubscribe-auth/AMBW0GkiBv4KSKvyqwI-mi2dByPstaq8ks5r9-IqgaJpZM4NoRDR.
看下 eureka 注册的 apollo-configservice:8080 可不可以正常访问? 我这边试了下容器互联没有出现连接失败的情况。
我也出现了类似的问题。先将configservice根据Dockerfile生成镜像,我注释了application.yml中的
# eureka:
# instance:
# preferIpAddress: true
# ip-address: ${ip}
我想让客户端(adminservice /portal )以link的方式连接到configservice configservice docker run 正常,可以通过8080访问。 adminservice的application.yml也注释了如上的代码,并且修改了bootstrap.yml,修改如下:
serviceUrl:
# defaultZone: http://${eureka.instance.hostname}:8080/eureka/
defaultZone: http://meta:8080/eureka/
adminservice在docker run的时候,添加了参数--link apollo-configservice:meta
最终 adminservice 启动失败,异常如下:
DiscoveryClient_APOLLO-ADMINSERVICE/0a1887c39fed:apollo-adminservice:8090 - registration failed Cannot execute request on any known server
请kulovecc帮忙看下,谢谢
DiscoveryClient_APOLLO-CONFIGSERVICE/apollo-configservice-794372642-tft28:apollo-configservice:8080 - registration failed Cannot execute request on any known server 我刚遇到这个错,配置文件一顿改最终一个接着一个找不到,运行之前一定要把数据库的eureka.service.url 的地址改为configservice所在的服务器,不然你永远也无法注册admin,配置文件里面默认的不生效,其他配置不用改,不需要link参数
我这边在本地运行都OK的, 但是容易push到服务器上再运行就报错 /apollo-configservice/scripts/startup.sh: ./apollo-configservice.jar: /bin/bash: bad interpreter: Text file busy Sun Jun 24 19:21:04 CST 2018 Failed to start apollo-configservice.jar, return code: 126