eureka server running for a while ,it auto shutdown


2019-06-19 19:48:59.724 [Thread-15] INFO org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry -Unregistering application UNKNOWN with eureka with status DOWN 2019-06-19 19:48:59.727 [Thread-15] INFO com.netflix.eureka.DefaultEurekaServerContext -Shutting down ... 2019-06-19 19:48:59.745 [Thread-15] INFO com.netflix.eureka.DefaultEurekaServerContext -Shut down 2019-06-19 19:48:59.760 [Thread-15] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor -Shutting down ExecutorService 'applicationTaskExecutor' 2019-06-19 19:48:59.795 [Thread-15] INFO com.netflix.discovery.DiscoveryClient -Shutting down DiscoveryClient ... 2019-06-19 19:48:59.796 [Thread-15] INFO com.netflix.discovery.DiscoveryClient -Completed shut down of DiscoveryClient

maven


org.springframework.cloud spring-cloud-netflix-eureka-server 2.0.2.RELEASE

application.yml ———————— eureka: server: enable-self-preservation: false client: registerWithEureka: false fetchRegistry: false service-url: defaultZone: http://localhost:${server.port}/eureka

Comment From: spencergibb

There's not much to go on here. Does this happen on the server or client? Can you provide a sample that reproduces the problem?

Comment From: spencergibb

Besides the info log statement is something going wrong?

Comment From: liuqunqi

There's not much to go on here. Does this happen on the server or client? Can you provide a sample that reproduces the problem?

i send sample for you email

Comment From: liuqunqi

Besides the info log statement is something going wrong?

i had sent the sample project to you email, the sample run for hours,it auto shutdown,thanks for your reply

Comment From: ryanjbaxter

Is it possible to post the sample here?

Comment From: liuqunqi

pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.test</groupId>
<artifactId>eureka-server-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>eureka-server-test</name>
<description>eureka project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <logstash-logback.version>5.3</logstash-logback.version>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Finchley.SR2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.logstash.logback</groupId>
        <artifactId>logstash-logback-encoder</artifactId>
        <version>${logstash-logback.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

application.yml

eureka: server: enable-self-preservation: false client: # Dont register itself with eureka registerWithEureka: false fetchRegistry: false service-url: defaultZone: http://localhost:${server.port}/eureka

main

@SpringBootApplication @EnableEurekaServer public class EurekaApplication {

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

}

Comment From: ryanjbaxter

Please put the code in a git repo and attach it as a zip

Comment From: liuqunqi

Please put the code in a git repo and attach it as a zip

eureka-server-demo

thanks

Comment From: spencergibb

If you find this is still an issue with Hoxton.SR3 and Spring Boot 2.2.6 let us know and we can reopen to investigate.

Comment From: iamakashk

Hi @spencergibb

I am still facing this issue.

I am using following pom.xml for my eureka server. I have couple of micro services which are registered with eureka server.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.5.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.etp</groupId>
    <artifactId>eureka-server</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>eureka-server</name>
    <description>Spring Boot eureka-server</description>

    <properties>
        <!-- <java.version>1.8</java.version> -->
        <!--Build-Date -->
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>dd-MMM-yyyy</maven.build.timestamp.format>
        <!--Build-Date -->
        <spring-cloud.version>Hoxton.SR9</spring-cloud.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

All services gets registered approximately and then they automatically shuts down themselves either with docker status code 0 or 137. I tried to check logs for both and found following stack for both status code services

log="24-09-2021 09:45:33.965 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient.register - DiscoveryClient_MYMICROSERVICE/mymicroservice:56e852b73630a712fbdf9defedaa6cef: registering service..."
log="24-09-2021 09:45:33.910 [SpringContextShutdownHook] ERROR com.netflix.discovery.DiscoveryClient.notify - Saw local status change event StatusChangeEvent [timestamp=1632476733910, current=DOWN, previous=UP]"
log="24-09-2021 09:45:33.889 [SpringContextShutdownHook] INFO org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.deregister - Unregistering application MYMICROSERVICE with eureka with status DOWN"
log="24-09-2021 09:45:34.598 [SpringContextShutdownHook] INFO com.netflix.discovery.DiscoveryClient.shutdown - Shutting down DiscoveryClient ..."
container_name=/mymicroservice source=stdout log="24-09-2021 09:45:34.524 [SpringContextShutdownHook] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.shutdown - Shutting down ExecutorService 'applicationTaskExecutor'" container_id=5b50472ae3437072dfe79c664a71dc305513d928b7173839c904dfe1abd7081e
container_name=/mymicroservice source=stdout log="24-09-2021 09:45:34.034 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient.register - DiscoveryClient_MYMICROSERVICE/mymicroservice:56e852b73630a712fbdf9defedaa6cef - registration status: 204" container_id=5b50472ae3437072dfe79c664a71dc305513d928b7173839c904dfe1abd7081e
log="24-09-2021 09:45:37.629 [SpringContextShutdownHook] INFO com.netflix.discovery.DiscoveryClient.unregister - Unregistering ..."
log="24-09-2021 09:45:42.755 [SpringContextShutdownHook] INFO com.netflix.discovery.DiscoveryClient.unregister -DiscoveryClient_MYMICROSERVICE/mymicroservice:56e852b73630a712fbdf9defedaa6cef - deregister status: 200"
log="24-09-2021 09:45:43.030 [SpringContextShutdownHook] INFO com.netflix.discovery.DiscoveryClient.shutdown - Completed shut down of DiscoveryClient"

I have referred link1 and link2 but none of them resolved the issue. Can anyone help me out in this?