apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.81k stars 6.52k forks source link

use consul tips No value present #4427

Closed huohuanhuan closed 4 years ago

huohuanhuan commented 4 years ago

2020-02-28 18:01:26,241 - org.apache.skywalking.oap.server.starter.OAPServerStartUp - 55 [main] ERROR [] - No value present java.util.NoSuchElementException: No value present

huohuanhuan commented 4 years ago

use consul have version Requirement?

wu-sheng commented 4 years ago

We have consul doc for cluster manager. This log shows your YAML is not well formated.

huohuanhuan commented 4 years ago

I don't understand. I don't use yaml at all

wu-sheng commented 4 years ago

I am not following. All configs are in the application.yml file, including you want to a new coordinator setting. What do you mean you are not using?

huohuanhuan commented 4 years ago

I configured consumer according to the instructions in the official document, but this error occurred

huohuanhuan commented 4 years ago

“2020-02-28 18:01:26,241 - org.apache.skywalking.oap.server.starter.OAPServerStartUp - 55 [main] ERROR [] - No value present java.util.NoSuchElementException: No value present”

huohuanhuan commented 4 years ago

Using consul to configure a cluster Something went wrong

wu-sheng commented 4 years ago

The document is guiding you to change the YAML, and you changed it to the wrong FORAMT. That is why the oap server can't start up.

huohuanhuan commented 4 years ago

consul: serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}

serviceName: ${SW_SERVICE_NAME:"consul"}

# Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
#hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:172.16.30.101:8500,172.16.30.102:8500,172.16.30.103:8500}
hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:172.16.30.27:8500,172.16.30.26:8500,172.16.30.28:8500}
huohuanhuan commented 4 years ago

It's completely in yaml format. Please help me to see where it's wrong

huohuanhuan commented 4 years ago

2020-03-02 11:02:28,373 - org.apache.skywalking.oap.server.starter.OAPServerStartUp - 55 [main] ERROR [] - No value present java.util.NoSuchElementException: No value present at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_144] at com.orbitz.consul.util.failover.strategy.BlacklistingConsulFailoverStrategy.computeNextStage(BlacklistingConsulFailoverStrategy.java:76) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.util.failover.ConsulFailoverInterceptor.intercept(ConsulFailoverInterceptor.java:56) ~[consul-client-1.2.6.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[okhttp-3.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[okhttp-3.9.0.jar:?] at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) ~[okhttp-3.9.0.jar:?] at okhttp3.RealCall.execute(RealCall.java:77) ~[okhttp-3.9.0.jar:?] at retrofit2.OkHttpCall.execute(OkHttpCall.java:180) ~[retrofit-2.3.0.jar:?] at com.orbitz.consul.util.Http.executeCall(Http.java:48) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.util.Http.handle(Http.java:36) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:212) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:216) ~[consul-client-1.2.6.jar:?] at org.apache.skywalking.oap.server.cluster.plugin.consul.ConsulCoordinator.registerRemote(ConsulCoordinator.java:86) ~[cluster-consul-plugin-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.core.CoreModuleProvider.start(CoreModuleProvider.java:191) ~[server-core-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.BootstrapFlow.start(BootstrapFlow.java:61) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.ModuleManager.init(ModuleManager.java:67) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.starter.OAPServerStartUp.main(OAPServerStartUp.java:43) [server-starter-6.5.0.jar:6.5.0]

huohuanhuan commented 4 years ago

If you write only one address, you will be prompted

huohuanhuan commented 4 years ago

2020-03-02 11:04:34,511 - org.apache.skywalking.oap.server.starter.OAPServerStartUp - 55 [main] ERROR [] - Consul request failed with status [400]: Invalid service address com.orbitz.consul.ConsulException: Consul request failed with status [400]: Invalid service address at com.orbitz.consul.util.Http.ensureResponseSuccessful(Http.java:59) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.util.Http.handle(Http.java:37) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:212) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:216) ~[consul-client-1.2.6.jar:?] at org.apache.skywalking.oap.server.cluster.plugin.consul.ConsulCoordinator.registerRemote(ConsulCoordinator.java:86) ~[cluster-consul-plugin-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.core.CoreModuleProvider.start(CoreModuleProvider.java:191) ~[server-core-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.BootstrapFlow.start(BootstrapFlow.java:61) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.ModuleManager.init(ModuleManager.java:67) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.starter.OAPServerStartUp.main(OAPServerStartUp.java:43) [server-starter-6.5.0.jar:6.5.0]

Lovnx commented 4 years ago

2020-03-02 11:04:34,511 - org.apache.skywalking.oap.server.starter.OAPServerStartUp - 55 [main] ERROR [] - Consul request failed with status [400]: Invalid service address com.orbitz.consul.ConsulException: Consul request failed with status [400]: Invalid service address at com.orbitz.consul.util.Http.ensureResponseSuccessful(Http.java:59) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.util.Http.handle(Http.java:37) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:212) ~[consul-client-1.2.6.jar:?] at com.orbitz.consul.AgentClient.register(AgentClient.java:216) ~[consul-client-1.2.6.jar:?] at org.apache.skywalking.oap.server.cluster.plugin.consul.ConsulCoordinator.registerRemote(ConsulCoordinator.java:86) ~[cluster-consul-plugin-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.core.CoreModuleProvider.start(CoreModuleProvider.java:191) ~[server-core-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.BootstrapFlow.start(BootstrapFlow.java:61) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.library.module.ModuleManager.init(ModuleManager.java:67) ~[library-module-6.5.0.jar:6.5.0] at org.apache.skywalking.oap.server.starter.OAPServerStartUp.main(OAPServerStartUp.java:43) [server-starter-6.5.0.jar:6.5.0]

have you solved this problem?

Lovnx commented 4 years ago

我解决了这个问题,因为Consul需要与客户端做健康检查,所以必须要告诉Consul本机地址与Ip,请看配置:

  consul:
    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
    hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500}
    internalComHost: 172.xxx.xxx #告诉Consul本节点Ip
    internalComPort: 11800  #告诉Consul这个是健康检查的端口
ysq5202121 commented 3 years ago

我解决了这个问题,因为Consul需要与客户端做健康检查,所以必须要告诉Consul本机地址与Ip,请看配置:

  consul:
    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
    hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500}
    internalComHost: 172.xxx.xxx #告诉Consul本节点Ip
    internalComPort: 11800  #告诉Consul这个是健康检查的端口

可以解决这个问题,但是有些不配置也可以,搞不懂!