我们组织中的云铸造厂没有安装Spring服务。我已经创建了一个尤里卡服务器,并将它部署到云中铸造厂,并且能够看到尤里卡主页
我已经创建了一个用户提供服务并使用这里提供的步骤(https://github.com/making/cf-eureka-server)绑定了应用程序!
由于没有Spring,所以我给出了以下依赖项
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-service-registry</artifactId>
<version>1.5.0.RELEASE</version>
</dependency>和
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>但是,我在CF日志中得到了以下错误
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173) ~[jersey-apache-client4-1.19.1.jar!/:1.19.1]
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] ... 30 common frames omitted
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] 2017-Nov-13 09:09:05.237 WARN [DiscoveryClient-HeartbeatExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient - Request execution failed with message: java.net.ConnectException: Connection refused (Connection refused)
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] 2017-Nov-13 09:09:05.237 WARN [DiscoveryClient-CacheRefreshExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient - Request execution failed with message: java.net.ConnectException: Connection refused (Connection refused)
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] 2017-Nov-13 09:09:05.237 ERROR [DiscoveryClient-HeartbeatExecutor-0] c.n.d.DiscoveryClient - DiscoveryClient_C2M-LAUNCH-SERVICE/app-launch-service.apps.np.sdppcf.com:d2c76a2f-f2c4-45f9-7e3b-f807 - was unable to send heartbeat!
2017-11-13T14:39:05.238+05:30 [APP/PROC/WEB/0] [OUT] com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server应用程序是Spring引导应用程序,我已经使用@EnableDiscoveryClient启用了发现。由于这个错误,我无法在Eureka中看到服务。
如果没有安装在云铸造厂的Spring服务,是否可以创建一个Eureka服务,并使用伪客户端等?任何方向都会有帮助。
发布于 2017-11-14 04:24:47
开发spring-cloud-services-starter-*客户端库是为了与Services部署和保护像Eureka这样的Spring应用程序的方式相匹配。这些Services库不太可能使用您自己编写的Eureka服务,除非您实现了与SCS相同的安全性和其他配置。
不要使用io.pivotal.spring.cloud:spring-cloud-services-starter-service-registry,您应该使用org.springframework.cloud:spring-cloud-starter-eureka并使用application.properties或application.yml中的属性配置尤里卡。可以将适当的属性设置为从用户提供的服务实例中解析的值,如从Github回购中做例子所示:
eureka.client.service-url.defaultZone=${vcap.services.eureka-service.credentials.uri:http://localhost:8761}/eureka/
https://stackoverflow.com/questions/47260628
复制相似问题