eureka跨服务_如何在不同主机上的eureka服务器上注册eureka客户端。春季靴

bd96500e110b49cbb3cd949968f18be7.png

I'm running my eureka-server on my localhost. I'm able to register all my other on localhost running services and everthing works like expected.

Now I want to register a service which is running on a linux machine. My properties looks like that:

spring.application.name=myService-service

spring.cloud.config.uri=http://myMachine.domain.lan:8888

server.port=8002

eureka.client.service-url.default-zone=http://myMachine.domain.lan:8761/eureka/

But the service is not able to register on eureka server on localhost. (At the end its the same service which runs on localhost)

I get those exceptions:

java.net.ConnectException: Connection refused

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

But I'm able to get my configuration files from my config-service running on localhost.

Which configurations do I need to register my service to eureka from linux machine(client) to localhost(server)?

This annotations do I use:

Service:

@SpringBootApplication

@EnableDiscoveryClient

@EnableEurekaClient

public class MyServiceApplication {

Eureka-Server:

@SpringBootApplication

@EnableEurekaServer

public class EurekaServiceApplication {

P.S.:Also the opposit way is not working.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值