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.