Same service instance got registered second time at midnight.

27 views
Skip to first unread message

Bill Weng

unread,
Mar 2, 2017, 12:46:57 PM3/2/17
to eureka_netflix
I got a couple of interesting questions regarding Spring Boot Admin Server registration.

1. What triggers (or controls) ApplicationRegistry to register applications at mid night? 
2. When I specified the application, a micro service, using FQDN to register to admin server, admin server console shows this micro service correctly (with fqdn/port). But right after midnight, the same micro service got registered again but with just hostname/port (ld-midsrvcs01:20020). So now admin server shows 2 instances of the same micro service, although only one actual micro service running. If I use hostname (ld-midsrvcs01) for "spring.adminServer.hostname", the second registration instance at midnight comes also, but with it's fqdn, i.e., ld-midsrvcs01.lab.mycompany.net:20020. How can I solve this annoying double registration issue?   

Thanks & Regards

PS.

Here is my micro service appplication.yml --

spring:
application:
name: lookups
profiles: dev
  adminServer:
     hostname: ld-midsrvcs01.lab.mycompany.net 

boot:
admin:
url: http://${spring.adminServer.hostname}:8761
client:
name: LOOKUPS
url: http://${spring.adminServer.hostname}:20020



And this is my admin server main class --

@Configuration
@EnableAutoConfiguration
@EnableAdminServer
@EnableZuulProxy
@SpringBootApplication
public class AdminApplication {

private static final Logger LOGGER = LoggerFactory.getLogger(AdminApplication.class);

public static void main(String[] args) {

LOGGER.info("Spring.Profiles.Active :-> " + System.getProperty("spring.profiles.active"));

SpringApplication.run(AdminApplication.class, args);

LOGGER.info("Started ADMIN Console/Catalog...");
}
}
Reply all
Reply to author
Forward
0 new messages