spring cloud接入consul报错

ERROR – o.s.scheduling.support.TaskUtils$LoggingErrorHandler – 95 – – Unexpected error occurred in scheduled task.
com.ecwid.consul.v1.OperationException: OperationException(statusCode=405, statusMessage=’Method Not Allowed’, statusContent=’method GET not allowed’)
at com.ecwid.consul.v1.agent.AgentConsulClient.agentCheckPass(AgentConsulClient.java:190)
at com.ecwid.consul.v1.agent.AgentConsulClient.agentCheckPass(AgentConsulClient.java:179)
at com.ecwid.consul.v1.ConsulClient.agentCheckPass(ConsulClient.java:242)
at org.springframework.cloud.consul.discovery.TtlScheduler$ConsulHeartbeatTask.run(TtlScheduler.java:91)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

可能原因是consul版本太高,换一个低版本的consul,如0.8.5

 

Leave a Reply

Your email address will not be published. Required fields are marked *