我正在尝试在guide here之后的本地点阵设置中部署SpringCloud Config + Netflix Eureka服务器。不幸的是,Eureka同行不能互相引用,因为我的莱迪思安装的主机IP无法在单元上解析。
我将在我们的AWS Lattice设置上尝试它,但我真的想让它在本地工作以进行开发/测试。
有什么建议吗?
FWIW 应用程序本身旋转,我在日志中看到了很多这样的内容:
22 May 13:29 [APP|0] 2015-05-22 19:29:08.849 INFO 4 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8888 (http)
22 May 13:29 [APP|0] 2015-05-22 19:29:08.855 INFO 4 --- [ main] com.example.config.ConfigServer : Started ConfigServer in 18.594 seconds (JVM running for 19.859)
22 May 13:29 [APP|0] 2015-05-22 19:29:08.859 INFO 4 --- [ Thread-4] c.n.eureka.PeerAwareInstanceRegistry : Updating the replica nodes as they seem to have changed from [] to [http://eureka2.192.168.11.11.xip.io/eureka/]
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [APP|0] 2015-05-22 19:29:11.397 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - Re-registering apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:11.397 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io: registering service...
22 May 13:29 [APP|0] 2015-05-22 19:29:11.429 WARN 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Action: Register => returned status of 404 from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:11.431 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Can't get a response from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] Can't contact any eureka nodes - possibly a security group issue?
.22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [APP|0] 2015-05-22 19:29:11.431 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - registration failedBad status: 404
22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [APP|0] 2015-05-22 19:29:13.687 WARN 4 --- [cTaskExecutor-1] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused
22 May 13:29 [APP|0] 2015-05-22 19:29:13.687 INFO 4 --- [cTaskExecutor-1] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [APP|0] 2015-05-22 19:29:14.435 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - Re-registering apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:14.435 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io: registering service...
.22 May 13:29 [APP|0] 2015-05-22 19:29:14.447 WARN 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Action: Register => returned status of 404 from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:14.451 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Can't get a response from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] Can't contact any eureka nodes - possibly a security group issue?
22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [APP|0] 2015-05-22 19:29:14.451 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - registration failedBad status: 404
22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [APP|0] 2015-05-22 19:29:17.456 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - Re-registering apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:17.456 INFO 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io: registering service...
.22 May 13:29 [APP|0] 2015-05-22 19:29:17.472 WARN 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Action: Register => returned status of 404 from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] 2015-05-22 19:29:17.474 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : Can't get a response from http://eureka2.192.168.11.11.xip.io/eureka/apps/DEMO-CONFIG-SERVICE
22 May 13:29 [APP|0] Can't contact any eureka nodes - possibly a security group issue?
22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [APP|0] 2015-05-22 19:29:17.482 ERROR 4 --- [pool-8-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DEMO-CONFIG-SERVICE/192.168.11.11.xip.io - registration failedBad status: 404
22 May 13:29 [APP|0] java.lang.RuntimeException: Bad status: 404
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1155)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1060)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:606)
22 May 13:29 [APP|0] at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1596)
22 May 13:29 [APP|0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22 May 13:29 [APP|0] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
22 May 13:29 [APP|0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
22 May 13:29 [APP|0] at java.lang.Thread.run(Thread.java:745)
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
.22 May 13:29 [HEALTH|0] healthcheck failed
22 May 13:29 [HEALTH|0] Exit status 1
答案 0 :(得分:1)
如果url返回404,那么这是一个更好的标志,因为它可能只是路由表尚未更新。如果你可以在receptor.192.168.11.11.xip.io
的容器内点击受体网址,那么点击尤里卡服务器应该没有什么不同吗?
答案 1 :(得分:1)
The solution is actually pretty forward when deployed, because they will be able to resolve the IP of the brain. You just explicitly specify your hostname in your [bootstrap|application].yml
configuration & ltc create
command.
eureka:
instance:
hostname: ${INSTANCE_HOST:localhost}
APPNAME="eureka1"
TARGET=`ltc target | grep Target | cut -d':' -f2 | sed -e 's/[^0-9a-zA-Z\.]//g'`
LATTICE_CLI_TIMEOUT=180 ltc create $APPNAME distributedspring/config-server --memory-mb=0 -e \
EUREKA_PEER=http://eureka2.$TARGET/eureka/ \
-e RABBIT_HOST=rabbit-5672.$TARGET \
-e INSTANCE_HOST=$APPNAME.$TARGET \
-e INSTANCE_ID=$APPNAME \
-e PREFER_IP=false \
--no-monitor
APPNAME=eureka2
TARGET=`ltc target | grep Target | cut -d':' -f2 | sed -e 's/[^0-9a-zA-Z\.]//g'`
LATTICE_CLI_TIMEOUT=180 ltc create $APPNAME distributedspring/config-server --memory-mb=0 \
-e EUREKA_PEER=http://eureka1.$TARGET/eureka/ \
-e RABBIT_HOST=rabbit-5672.$TARGET \
-e INSTANCE_HOST=$APPNAME.$TARGET \
-e INSTANCE_ID=$APPNAME \
-e PREFER_IP=false \
--no-monitor