- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Eureka 服务器无法在 Docker compose 上运行
这是 Eureka 服务器和配置服务器的 docker-compose
version: '3'
services:
fetebird-eurekaservice:
container_name: FeteBird-EurekaService
build:
context: ../../Eureka-Service-Registry/
dockerfile: Dockerfile
image: fetebird/eurekaservice
ports:
- "8761:8761"
networks:
- spring-cloud-network
volumes:
- ./fetebird-eurekaservice/data:/data
logging:
driver: json-file
fetebird-configserver:
container_name: FeteBird-ConfigServer
build:
context: ../../FeteBird-ConfigServer
dockerfile: Dockerfile
image: fetebird/configserver
ports:
- "8085:8085"
networks:
- spring-cloud-network
volumes:
- ./fetebird-configserver/data:/data
logging:
driver: json-file
networks:
spring-cloud-network:
driver: bridge
我也尝试过 expose 命令,但没有成功
FROM openjdk:14
WORKDIR /fetebird-eurekaservice/service
ADD build/libs/fete-bird-eureka-service-registry-0.0.1-SNAPSHOT.jar fete-bird-eureka-service-registry-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java", "-jar", "fete-bird-eureka-service-registry-0.0.1-SNAPSHOT.jar"]
FROM openjdk:14
WORKDIR /fetebird-eurekaservice/service
ADD build/libs/fete-bird-configuration-server-0.0.1-SNAPSHOT.jar fete-bird-configuration-server-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java", "-jar", "fete-bird-configuration-server-0.0.1-SNAPSHOT.jar"]
@SpringBootApplication
@EnableEurekaServer
public class FeteBirdEurekaServiceRegistryApplication {
public static void main(String[] args) {
SpringApplication.run(FeteBirdEurekaServiceRegistryApplication.class, args);
}
}
server:
port: 8761
eureka:
client:
register-with-eureka: false
fetch-registry: false
spring:
profiles:
active: dev
spring:
application:
name: CONFIG-SERVER
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/config
服务器:端口:8085
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
hostname: localhost
错误
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
FeteBird-ConfigServer | at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:857) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:121) ~[eureka-client-1.9.21.jar!/:1.9.21]
FeteBird-ConfigServer | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
FeteBird-ConfigServer | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
FeteBird-ConfigServer | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
FeteBird-ConfigServer | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
FeteBird-ConfigServer | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
FeteBird-ConfigServer | at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]
FeteBird-ConfigServer |
FeteBird-ConfigServer | 2020-07-20 14:30:19.268 WARN 1 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator : There was a problem with the instance info replicator
最佳答案
问题是这样的
eureka:
client:
serviceUrl:
defaultZone: http://localhost:1111/eureka
它指向本地主机,Eureka 不再在本地主机上运行,在这种情况下,本地主机是各个容器。容器链接在一起,因此您可以将其更改为
eureka:
client:
serviceUrl:
defaultZone: http://fetebird-eurekaservice:8761/eureka/
instance:
hostname: fetebird-eurekaservice
每个docker文件
ENTRYPOINT ["java", "-jar", "fete-bird-configuration-server-0.0.1-SNAPSHOT.jar"] fetebird-eurekaservice
Docker compose 文件(添加链接和依赖)
fetebird-configserver:
container_name: FeteBird-ConfigServer
build:
context: ../../FeteBird-ConfigServer
dockerfile: Dockerfile
image: fetebird/configserver
ports:
- "8085:8085"
links:
- fetebird-eurekaservice
depends_on:
- fetebird-eurekaservice
networks:
- spring-cloud-network
volumes:
- ./fetebird-configserver/data:/data
logging:
driver: json-file
引用 - https://github.com/spring-cloud/spring-cloud-netflix/issues/2442
关于java - EurekaServer com.netflix.discovery.shared.transport.TransportException : Cannot execute request on any known server on Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62997711/
我正在安装 Laravel 4 并运行“composer install”命令。它能够成功安装 13 个软件包,但是当需要安装 symfony/translation 时,它 100% 下载了它,然后
我们将Elasticsearch集群从2.1.1升级到2.2。我们通过2.2.1之前版本运行的bulkload处理器进行的批量加载过程现在引发以下异常。如果我想念什么,请告诉我。我是这个新手。 [ma
当客户端尝试查询 cosmos 时,会看到大量对象引用未设置到对象实例异常。 深入检查后,异常消息包含如下详细信息: { "CPU Load History":{ "CPU Hist
我正在使用 JGit 从我的 git 存储库中 checkout 分支并修改文件。提交更改后,我尝试推送它,但遇到了 TransportException: Caused by: org.eclips
当客户端尝试查询 cosmos 时,会看到大量对象引用未设置到对象实例异常。 深入检查后,异常消息包含如下详细信息: { "CPU Load History":{ "CPU Hist
大家好,我已经遇到这个问题好几天了,当我尝试使用 composer 为我的 php 项目下载依赖项时出现此错误 c:\wamp64\www\Test>composer global require "
安装 composer 后,我用这个命令检查它: composer diagnose 一切正常。当我为最新版本的 Laravel 运行此命令时: composer global require "la
当我尝试使用此命令创建 ScalaTest 示例时: sbt new scala/scalatest-example.g8 fails on TransportException 我得到以下信息: [
我正在尝试使用 SSHJ 登录其他机器。下面的 PFA 代码(不包括 try/catch/finally block )。 Security.addProvider(new org.bouncycas
这是我的Eureka Server 应用程序。property # set port server.port=8761 # no need to register the server with th
我是微服务的新手,正在尝试从链接运行代码:https://dzone.com/articles/advanced-microservices-security-with-spring-and-oa .
我正在尝试更新项目中的 Zend Framework 2 库并遇到异常: use@machine:/path/to/project# php composer.phar self-update [Co
Eureka 服务器无法在 Docker compose 上运行 这是 Eureka 服务器和配置服务器的 docker-compose version: '3' services: fete
我是微服务新手。我正在尝试创建一个用于学习目的的小型应用程序。这是我的代码:EurekaServer - application.yml spring: application:
我是一名优秀的程序员,十分优秀!