Eureka Client подключается к Localhost: 8761 вместо настроенного IP -адреса сервераJAVA

Программисты JAVA общаются здесь
Anonymous
Eureka Client подключается к Localhost: 8761 вместо настроенного IP -адреса сервера

Сообщение Anonymous »

У меня есть сервер Spring Boot Eureka, работающий на удаленной машине с URL: < /p>

Код: Выделить всё

http://192.168.3.177:8761/eureka
У меня также есть клиент Eureka (Spring Boot Service), работающий на другой машине с IP 192.168.1.123.
Проблем http://localhost:8761/eureka and fails with a Connection refused error.
However, if I run the Eureka client on the same machine as the Eureka server, it works correctly.
Eureka Client Configuration:

Here is the configuration in Application.properties клиента Eureka:

Код: Выделить всё

eureka.client.service-url.default-zone=http://192.168.3.177:8761/eureka
eureka Client Основной класс:

Код: Выделить всё

@SpringBootApplication
@EnableFeignClients("com.samsan.currencyconversionservice")
@EnableDiscoveryClient
public class CurrencyConversionServiceApplication {

public static void main(String[] args) {
SpringApplication.run(CurrencyConversionServiceApplication.class, args);
}

}
Feign Client Interface:

Код: Выделить всё

@Component
@FeignClient(name="currency-exchange-service")
@RibbonClient(name="currency-exchange-service")
public interface CurrencyExchangeService {

@GetMapping("/currency-exchange/from/{from}/to/{to}")
public CurrencyConversionBean getExchangeValue(@PathVariable("from") String from, @PathVariable("to") String to);

}
Вопрос:
Почему клиент Eureka игнорирует настроенный IP -адрес сервера и дефолтирование Localhost: 8761/Eureka ?
Как я могу сделать клиент Eureka правильно подключаться к серверу Eureka, работающему на другой машине?>

Подробнее здесь: https://stackoverflow.com/questions/581 ... -server-ip

Вернуться в «JAVA»