Мы пытаемся зарегистрировать spring-cloud-consul приложение с consul в вычислительный движок GCP, где он может зарегистрировать приложение в консуле, но с приложением мы сталкиваемся с двумя проблемами. Ниже приведены bootstrap.yaml
и server.yaml для приложения,
application.yaml
server:
port: 10003
spring:
application:
name: hello-service
cloud:
consul:
enabled: true
inetutils:
useOnlySiteLocalInterfaces: true
endpoints:
actuator:
sensitive: false
bootstrap.yaml
spring:
cloud:
consul:
enabled: true
host: 10.160.0.18
port: 8500
discovery:
prefer-ip-address: true
- Consul не может вызвать проверку работоспособности на вычислительном движке, возможно, потому, что он зарегистрирован на внутреннем доменном имени экземпляра.
сервис с консулом: NewService{id='hello-service-10003', name='hello-service', tags=[secure=false], address='consul-app-test.c.name-of-project.internal ', meta=null, port=10003, enableTagOverride=null, check=Check{script='null', interval='10s', ttl='null', http='http://consul-app-test.c.name-of-project.internal:10003/actuator/health', method='null', header={}, tcp='null', timeout='null', deregisterCriticalServiceAfter='null', tlsSkipVerify=null, status='null'}, checks= нулевой}
- Заявление о снятии с учета с консула. Мы остановили приложение, но оно все еще отображается в пользовательском интерфейсе консула.