Spring Boot Actuator application won't start on Ubuntu VPS

前端 未结 2 589
萌比男神i
萌比男神i 2020-11-27 15:07

I have a Java backend which uses Spring Boot Actuator but it won\'t start on Digitalocean Ubuntu VPS. The same application runs well on my Mac and on an other Ubuntu PC.

相关标签:
2条回答
  • 2020-11-27 15:43

    The accepted answer didn't work for me. So I found this answer which did:

    Spring-boot application wont boot at startup inside docker

    apt-get install haveged -y
    
    0 讨论(0)
  • 2020-11-27 15:47

    localhost-startStop-1 is trying to create a new instance of SecureRandom and it's stuck trying to read data from an entropy source. This typically occurs because the source has been depleted. The default entropy source is /dev/random. It's known as a blocking source as it will block when an attempt is made to read random data and none is available. Another source on Linux is /dev/urandom. Its main benefit over /dev/random is that it's non-blocking. There's some debate over whether or not using /dev/urandom will make things less secure. This article may be of interest.

    In summary, using /dev/urandom will avoid the problem you're seeing, at the possible cost of decreased security. You can configure Spring Boot's embedded Tomcat instance to use /dev/urandom via a system property:

    -Djava.security.egd=file:/dev/./urandom

    0 讨论(0)
提交回复
热议问题