Spring boot 如何在春季启动时在eureka服务器上从Grails注册eureka客户端
我想在spring boot中的eureka服务器上注册Grails2.4.4中的eureka客户端 我已经在同一台eureka服务器上从spring boot注册了另一个eureka服务,它运行良好。 当我运行grails应用程序时,它会给我一个错误:Spring boot 如何在春季启动时在eureka服务器上从Grails注册eureka客户端,spring-boot,grails,netflix-eureka,grails-2.4,Spring Boot,Grails,Netflix Eureka,Grails 2.4,我想在spring boot中的eureka服务器上注册Grails2.4.4中的eureka客户端 我已经在同一台eureka服务器上从spring boot注册了另一个eureka服务,它运行良好。 当我运行grails应用程序时,它会给我一个错误: | Error 2018-02-21 17:29:39,765 [localhost-startStop-1] ERROR aws.ConfigClusterResolver - Cannot resolve to any endpoints
| Error 2018-02-21 17:29:39,765 [localhost-startStop-1] ERROR aws.ConfigClusterResolver - Cannot resolve to any endpoints from provided configuration: {defaultZone=[]}
| Error 2018-02-21 17:29:39,771 [localhost-startStop-1] ERROR transport.EurekaHttpClients - Initial resolution of Eureka server endpoints failed. Check ConfigClusterResolver logs for more info
| Error 2018-02-21 17:29:39,841 [localhost-startStop-1] ERROR discovery.DiscoveryClient - DiscoveryClient_UNKNOWN/pawan - was unable to refresh its cache! status = There is no known eureka server; cluster server list is empty
Message: There is no known eureka server; cluster server list is empty
Line | Method
->> 107 | execute in com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 134 | getApplications in com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator
| 137 | execute . . . . . . . . . . . . in com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6
| 77 | execute in com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient
| 134 | getApplications . . . . . . . . in com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator
| 1051 | getAndStoreFullRegistry in com.netflix.discovery.DiscoveryClient
| 965 | fetchRegistry . . . . . . . . . in ''
| 414 | <init> in ''
| 269 | <init> . . . . . . . . . . . . . in ''
| 265 | <init> in ''
| 257 | <init> . . . . . . . . . . . . . in ''
| 31 | initializeEurekaClient in EurekaConfiguration
| 20 | doCall . . . . . . . . . . . . . in BootStrap$_closure1
| 327 | evaluateEnvironmentSpecificBlock in grails.util.Environment
| 320 | executeForEnvironment . . . . . in ''
| 296 | executeForCurrentEnvironment in ''
| 266 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1149 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 624 | run . . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 748 | run in java.lang.Thread
任何帮助都是值得的
谢谢 不确定这是问题中的输入错误还是真正的错误,但行
eureka.port=1116eureka.name=Grails Service
应该是:
eureka.port = 1116
eureka.name=Grails-Service
以下是我在这个问题上的发现。然而,我在谷歌上做了很多搜索,让它回到正轨 步骤1:创建名为
eureka client.properties的文件
步骤2:现在从应用程序.properties
文件中删除配置代码,并将其粘贴到新创建的文件中
第3步:将您的eureka端口传递到那里,当然还有此文件中的serviceId
配置代码:
app.grails.version=2.4.4
app.name=GrailsMicroservice
app.version=0.1
#app.port=8080
eureka.region = default
eureka.vipAddress = localhost
eureka.port = 1116
eureka.name=Grails-Service
eureka.hostname=localhost
eureka.preferSameZone=true
eureka.shouldUseDns=false
eureka.serviceUrl.default=http://localhost:1116/eureka/
现在保存更改并运行应用程序。它将连接到您的Eureka服务器。刷新您的Eureka主页后,您将在那里找到它 就像属性文件一样。
app.grails.version=2.4.4
app.name=GrailsMicroservice
app.version=0.1
#app.port=8080
eureka.region = default
eureka.vipAddress = localhost
eureka.port = 1116
eureka.name=Grails-Service
eureka.hostname=localhost
eureka.preferSameZone=true
eureka.shouldUseDns=false
eureka.serviceUrl.default=http://localhost:1116/eureka/