nacos-docker icon indicating copy to clipboard operation
nacos-docker copied to clipboard

nacos docker exited suddenly

Open RogueJin opened this issue 3 years ago • 0 comments

nacos suddenly exits in minutes after starting successfully and the log looks everything is fine. Is there any way to check the exact reason caused exit?

here is the docker compose

version: "3.8" services: nacos: image: nacos/nacos-server:2.0.3 container_name: dev_nacos environment: - PREFER_HOST_MODE=hostname - MODE=standalone volumes: - ./container-data/nacos-logs/:/home/nacos/logs ports: - "8848:8848" - "9848:9848"

here is the docker log

dev_nacos nacos/nacos-server:2.0.3 EXITED (137)

  • export CUSTOM_SEARCH_NAMES=application,custom

  • CUSTOM_SEARCH_NAMES=application,custom

  • export CUSTOM_SEARCH_LOCATIONS=/home/nacos/init.d/,file:/home/nacos/conf/

  • CUSTOM_SEARCH_LOCATIONS=/home/nacos/init.d/,file:/home/nacos/conf/

  • export MEMBER_LIST=

  • MEMBER_LIST=

  • PLUGINS_DIR=/home/nacos/plugins/peer-finder

  • [[ standalone == \s\t\a\n\d\a\l\o\n\e ]]

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true'

  • [[ all == \c\o\n\f\i\g ]]

  • [[ all == \n\a\m\i\n\g ]]

  • [[ ! -z '' ]]

  • [[ ! -z '' ]]

  • [[ ! -z '' ]]

  • [[ ! -z '' ]]

  • [[ ! -z '' ]]

  • [[ hostname == \h\o\s\t\n\a\m\e ]]

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list='

++ /usr/lib/jvm/java-1.8.0-openjdk/bin/java -version

++ sed -E -n 's/.* version "([0-9]).$/\1/p'

  • JAVA_MAJOR_VERSION=1

  • [[ 1 -ge 9 ]]

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar '

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar --spring.config.additional-location=/home/nacos/init.d/,file:/home/nacos/conf/'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar --spring.config.additional-location=/home/nacos/init.d/,file:/home/nacos/conf/ --spring.config.name=application,custom'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar --spring.config.additional-location=/home/nacos/init.d/,file:/home/nacos/conf/ --spring.config.name=application,custom --logging.config=/home/nacos/conf/nacos-logback.xml'

  • JAVA_OPT=' -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar --spring.config.additional-location=/home/nacos/init.d/,file:/home/nacos/conf/ --spring.config.name=application,custom --logging.config=/home/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288'

  • echo 'Nacos is starting, you can docker logs your container'

  • exec /usr/lib/jvm/java-1.8.0-openjdk/bin/java -Xms1g -Xmx1g -Xmn512m -Dnacos.standalone=true -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk/lib/ext:/home/nacos/plugins/health:/home/nacos/plugins/cmdb:/home/nacos/plugins/mysql -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar --spring.config.additional-location=/home/nacos/init.d/,file:/home/nacos/conf/ --spring.config.name=application,custom --logging.config=/home/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288

Nacos is starting, you can docker logs your container

     ,--.

   ,--.'|

,--,: : | Nacos 2.0.3

,--.'| ' : ,---. Running in stand alone mode, All function modules

| : : | | ' ,'\ .--.--. Port: 8848

: | \ | : ,--.--. ,---. / / | / / ' Pid: 1

| : ' '; | / \ / . ; ,. :| : /`./ Console: http://a3e5d125d26a:8848/nacos/index.html

' ' ;. ;.--. .-. | / / '' | |: :| : ;_

| | | \ | __/: . .. ' / ' | .; : \ \ `. https://nacos.io

' : | ; .' ," .--.; |' ; :__| : | `----. \

| | '--' / / ,. |' | '.'|\ \ / / /--' /

' : | ; : .' \ : : `----' '--'. /

; |.' | , .-./\ \ / `--'---'

'---' -----' `----'

2021-10-20 15:13:31,753 INFO Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@76f10035' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-10-20 15:13:31,765 INFO Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-10-20 15:13:32,412 INFO Tomcat initialized with port(s): 8848 (http)

2021-10-20 15:13:33,249 INFO Root WebApplicationContext: initialization completed in 14677 ms

2021-10-20 15:13:45,896 INFO Initializing ExecutorService 'applicationTaskExecutor'

2021-10-20 15:13:46,236 INFO Adding welcome page: class path resource [static/index.html]

2021-10-20 15:13:47,437 INFO Creating filter chain: Ant [pattern='/**'], []

2021-10-20 15:13:47,519 INFO Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@382c90c2, org.springframework.security.web.context.SecurityContextPersistenceFilter@2af4129d, org.springframework.security.web.header.HeaderWriterFilter@16c587de, org.springframework.security.web.csrf.CsrfFilter@2f66f0d0, org.springframework.security.web.authentication.logout.LogoutFilter@5e1fc2aa, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1640190a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@20de05e5, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@859ea42, org.springframework.security.web.session.SessionManagementFilter@76db540e, org.springframework.security.web.access.ExceptionTranslationFilter@7569ea63]

2021-10-20 15:13:47,816 INFO Initializing ExecutorService 'taskScheduler'

2021-10-20 15:13:47,860 INFO Exposing 16 endpoint(s) beneath base path '/actuator'

2021-10-20 15:13:48,175 INFO Tomcat started on port(s): 8848 (http) with context path '/nacos'

2021-10-20 15:13:48,190 INFO Nacos started successfully in stand alone mode. use embedded storage

RogueJin avatar Oct 20 '21 07:10 RogueJin