Я пытаюсь настроить сервер Eureka с настройкой DNS, и у меня возникают проблемы при настройке. Ниже мой конфиг.
eureka:
datacenter: cloud
instance:
nonSecurePort: ${server.port}
client:
fetchRegistry: true
eurekaServerURLContext: eureka
region: us-east-1
eurekaServerPort: 8761
useDnsForFetchingServiceUrls: true
eurekaServerDNSName: dev.domain.com
registerWithEureka: true
server:
renewalPercentThreshold: 0.49
enableSelfPreservation: false
Это записи TXT, которые я настроил
TXT Records
txt.us-east-1.dev.domain.com -> txt.us-east-1b.dev.domain.com; txt.us-east-1d.dev.domain.com
txt.us-east-1b.dev.domain.com -> eureka-us-east-1b.dev.domain.com
txt.us-east-1d.dev.domain.com -> eureka-us-east-1d.dev.domain.com
CNAME:
eureka-us-east-1b.dev.domain.com -> ec2-xx-xxx-xxx-xxx.compute.dev.domain.com
A-запись:
ec2-xx-xxx-xxx-xxx.compute.dev.domain.com -> xx.xxx.xxx.xx
Когда я запускаю приложение, пользовательский интерфейс eureka работает нормально; Тем не менее, я вижу ниже в журналах.
[11/09/18 22:19:49:600 UTC] INFO support.DefaultLifecycleProcessor: Starting beans in phase 0
[11/09/18 22:19:49:602 UTC] INFO serviceregistry.EurekaServiceRegistry: Registering application data-discovery-service with eureka with status UP
[11/09/18 22:19:49:615 UTC] INFO server.EurekaServerBootstrap: Setting the eureka configuration..
[11/09/18 22:19:49:655 UTC] INFO http11.Http11NioProtocol: Starting ProtocolHandler ["http-nio-8761"]
[11/09/18 22:19:49:687 UTC] INFO server.EurekaServerBootstrap: isAws returned true
[11/09/18 22:19:49:699 UTC] INFO net.NioSelectorPool: Using a shared selector for servlet write/read
[11/09/18 22:19:49:775 UTC] ERROR aws.EIPManager: Cannot bind to EIP
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
at java.lang.String.substring(String.java:1967) ~[?:1.8.0_181]
at com.netflix.eureka.aws.EIPManager.getEIPsFromServiceUrls(EIPManager.java:360) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.EIPManager.getEIPsForZoneFromDNS(EIPManager.java:394) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.EIPManager.getCandidateEIPs(EIPManager.java:316) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.EIPManager.isEIPBound(EIPManager.java:165) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.EIPManager.handleEIPBinding(EIPManager.java:141) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.EIPManager.start(EIPManager.java:106) [eureka-core-1.9.2.jar!/:1.9.2]
at com.netflix.eureka.aws.AwsBinderDelegate.start(AwsBinderDelegate.java:43) [eureka-core-1.9.2.jar!/:1.9.2]
at org.springframework.cloud.netflix.eureka.server.EurekaServerBootstrap.initEurekaServerContext(EurekaServerBootstrap.java:147) [spring-cloud-netflix-eureka-server-2.0.0.RELEASE.jar!/:2.0.0.RELEASE]
at org.springframework.cloud.netflix.eureka.server.EurekaServerBootstrap.contextInitialized(EurekaServerBootstrap.java:83) [spring-cloud-netflix-eureka-server-2.0.0.RELEASE.jar!/:2.0.0.RELEASE]
at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1.run(EurekaServerInitializerConfiguration.java:71) [spring-cloud-netflix-eureka-server-2.0.0.RELEASE.jar!/:2.0.0.RELEASE]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Я хотел бы знать, почему Eureka, где конфигурация EIP здесь неправильная? Кроме того, на странице пользовательского интерфейса строка «доступные реплики» пуста, а экземпляр отображается в «недоступных репликах».
Чего мне здесь не хватает?