apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.

Home Page:https://www.apolloconfig.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

使用 H2 内存数据库,自动初始化快速启动失败,日志并没有错误日志,请问这是什么原因?

wallmamami opened this issue · comments

commented

快速启动失败。

简洁明了地描述一下bug
如下:使用文档中描述的步骤,H2内存快速初始化,但是启动失败!
https://www.apolloconfig.com/#/zh/deployment/quick-start 文档中2-1方式启动。
export SPRING_PROFILES_ACTIVE="github,auth"
unset SPRING_SQL_CONFIG_INIT_MODE
unset SPRING_SQL_PORTAL_INIT_MODE
java -jar apollo-all-in-one.jar

额外的细节和日志

错误日志

  • [root@VM-12-46-tencentos /home/anymatch/apollo/quick-start]# java -jar apollo-all-in-one.jar
    15:17:02,887 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
    15:17:02,887 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
    15:17:02,887 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/classes!/logback.xml]
    15:17:02,889 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
    15:17:02,889 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/apollo-adminservice-1.9.0.jar!/logback.xml]
    15:17:02,889 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/apollo-portal-1.9.0.jar!/logback.xml]
    15:17:02,889 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/apollo-configservice-1.9.0.jar!/logback.xml]
    15:17:02,889 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/classes!/logback.xml]
    15:17:02,921 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2d38eb89 - URL [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/classes!/logback.xml] is not of type file
    15:17:02,977 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
    15:17:02,985 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5fa7e7ff - Adding [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/defaults.xml] to configuration watch list.
    15:17:02,985 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2d38eb89 - URL [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/defaults.xml] is not of type file
    15:17:02,987 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word clr with class [org.springframework.boot.logging.logback.ColorConverter]
    15:17:02,988 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wex with class [org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter]
    15:17:02,988 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wEx with class [org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter]
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.startup.DigesterFactory] to ERROR
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.util.LifecycleBase] to ERROR
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.coyote.http11.Http11NioProtocol] to WARN
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.sshd.common.util.SecurityUtils] to WARN
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.tomcat.util.net.NioSelectorPool] to WARN
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.eclipse.jetty.util.component.AbstractLifeCycle] to ERROR
    15:17:02,993 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate.validator.internal.util.Version] to WARN
    15:17:02,994 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.boot.actuate.endpoint.jmx] to WARN
    15:17:02,994 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5fa7e7ff - Adding [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/file-appender.xml] to configuration watch list.
    15:17:02,994 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2d38eb89 - URL [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/file-appender.xml] is not of type file
    15:17:02,996 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
    15:17:03,003 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
    15:17:03,010 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
    15:17:03,061 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1177096266 - setting totalSizeCap to 0 Bytes
    15:17:03,064 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1177096266 - Archive files will be limited to [10 MB] each.
    15:17:03,067 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1177096266 - Will use gz compression
    15:17:03,068 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1177096266 - Will use the pattern /tmp/apollo-assembly.log.%d{yyyy-MM-dd}.%i for the active file
    15:17:03,070 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - The date pattern is 'yyyy-MM-dd' from file name pattern '/tmp/apollo-assembly.log.%d{yyyy-MM-dd}.%i.gz'.
    15:17:03,070 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Roll-over at midnight.
    15:17:03,072 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Setting initial period to Tue Mar 12 11:38:53 CST 2024
    15:17:03,076 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /tmp/apollo-assembly.log
    15:17:03,076 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/tmp/apollo-assembly.log]
    15:17:03,078 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5fa7e7ff - Adding [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/console-appender.xml] to configuration watch list.
    15:17:03,078 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2d38eb89 - URL [jar:file:/home/anymatch/apollo/quick-start/apollo-all-in-one.jar!/BOOT-INF/lib/spring-boot-2.4.2.jar!/org/springframework/boot/logging/logback/console-appender.xml] is not of type file
    15:17:03,079 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
    15:17:03,081 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
    15:17:03,081 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
    15:17:03,085 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
    15:17:03,239 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
    15:17:03,239 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
    15:17:03,239 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
    15:17:03,240 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@4d76f3f8 - Registering current configuration as safe fallback point


    / \ _ __ ___ | | | ___
    / _ \ | '_ \ / _ | | |/ _
    / ___ | |) | () | | | () |
    /
    / _\ ./ _/|||___/
    |_|

:: Spring Boot :: (v2.4.2)

2024-03-13 15:17:04.039 INFO 30701 --- [ main] c.c.f.apollo.assembly.ApolloApplication : Starting ApolloApplication v1.9.0 using Java 1.8.0_322 on VM-12-46-tencentos with PID 30701 (/home/anymatch/apollo/quick-start/apollo-all-in-one.jar started by root in /home/anymatch/apollo/quick-start)
2024-03-13 15:17:04.042 INFO 30701 --- [ main] c.c.f.apollo.assembly.ApolloApplication : The following profiles are active: github,auth
2024-03-13 15:17:05.162 INFO 30701 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=e4e7a962-7e6a-32f7-a9a2-73b8244230aa
2024-03-13 15:17:05.477 INFO 30701 --- [ main] o.s.l.c.support.AbstractContextSource : Property 'userDn' not set - anonymous context will be used for read-write operations
2024-03-13 15:17:05.842 INFO 30701 --- [ main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses Jersey
2024-03-13 15:17:05.932 WARN 30701 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2024-03-13 15:17:05.960 INFO 30701 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2024-03-13 15:17:05.985 INFO 30701 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2024-03-13 15:17:05.986 INFO 30701 --- [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2024-03-13 15:17:06.080 INFO 30701 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1710314225992 with initial instances count: 0
2024-03-13 15:17:06.085 INFO 30701 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application UNKNOWN with eureka with status UP
2024-03-13 15:17:06.102 INFO 30701 --- [ main] c.c.f.apollo.assembly.ApolloApplication : Started ApolloApplication in 2.697 seconds (JVM running for 3.477)
2024-03-13 15:17:06.105 INFO 30701 --- [ main] c.c.f.apollo.assembly.ApolloApplication : application isActive: true
2024-03-13 15:17:06.106 INFO 30701 --- [extShutdownHook] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application UNKNOWN with eureka with status DOWN
2024-03-13 15:17:06.110 INFO 30701 --- [extShutdownHook] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2024-03-13 15:17:06.140 INFO 30701 --- [extShutdownHook] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient

  • 平台和操作系统
  • centos 7

你好,@wallmamami!我是Dosu,一个可以帮助你解决问题、回答问题并成为贡献者的机器人。我在这里帮助你,同时等待人类维护者的回复。现在我将开始查看你的问题,并将很快提供完整的回答。

commented

这三个版本试了都是同样的问题
apollo-quick-start-1.9.0
apollo-quick-start-2.1.0
apollo-quick-start-2.2.0

Based on the information you've provided and the context from the Apollo repository, it seems like you've followed the correct steps to initialize the H2 memory database for Apollo Quick Start versions 1.9.0, 2.1.0, and 2.2.0.

However, there was a similar issue reported in the Apollo repository titled Column "Cluster" not found error when running apollo quick start with h2. This issue was resolved by a pull request: rename the init.h2.sql to avoid loading wrong files in quick start mode. Although the specific changes made in this pull request are not detailed in the repository, it suggests that there might have been a problem with the initialization files used in quick start mode.

There could be several reasons for Apollo Quick Start failure with the H2 memory database. Some common reasons include SQL syntax compatibility issues, character set and collation settings, data type compatibility, timestamp default values, index prefix lengths, stored procedures and functions, lack of H2-specific optimizations, and configuration and version mismatches.

Unfortunately, without specific error messages or logs, it's difficult to pinpoint the exact cause of the failure you're experiencing. If possible, could you provide more detailed logs or error messages? This would help in identifying the root cause of the issue.

In the meantime, you might want to check the compatibility of your H2 database with the SQL script used by Apollo, especially if it includes platform-specific features or syntax. You could also try to ensure that your H2 database version and configuration match the expectations of the Apollo Quick Start setup.

I hope this information is helpful. Please let me know if you have any other questions or need further clarification.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

commented

2024-03-13 15:08:31.471 INFO 31577 --- [main] c.c.f.apollo.assembly.ApolloApplication : Starting ApolloApplication v1.9.0 using Java 1.8.0_322 on VM-12-46-tencentos with PID 31577 (/home/anymatch/apollo/quick-start/apollo-all-in-one.jar started by root in /home/anymat
ch/apollo/quick-start)
2024-03-13 15:08:31.474 INFO 31577 --- [main] c.c.f.apollo.assembly.ApolloApplication : The following profiles are active: github,auth
2024-03-13 15:08:32.606 INFO 31577 --- [main] o.s.cloud.context.scope.GenericScope : BeanFactory id=e4e7a962-7e6a-32f7-a9a2-73b8244230aa
2024-03-13 15:08:32.920 INFO 31577 --- [main] o.s.l.c.support.AbstractContextSource : Property 'userDn' not set - anonymous context will be used for read-write operations
2024-03-13 15:08:33.291 INFO 31577 --- [main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses Jersey
2024-03-13 15:08:33.378 WARN 31577 --- [main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheMana
ger to the classpath.
2024-03-13 15:08:33.406 INFO 31577 --- [main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2024-03-13 15:08:33.431 INFO 31577 --- [main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2024-03-13 15:08:33.433 INFO 31577 --- [main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2024-03-13 15:08:33.537 INFO 31577 --- [main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1710313713438 with initial instances count: 0
2024-03-13 15:08:33.542 INFO 31577 --- [main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application UNKNOWN with eureka with status UP
2024-03-13 15:08:33.561 INFO 31577 --- [main] c.c.f.apollo.assembly.ApolloApplication : Started ApolloApplication in 2.713 seconds (JVM running for 3.487)
2024-03-13 15:08:33.564 INFO 31577 --- [main] c.c.f.apollo.assembly.ApolloApplication : application isActive: true
2024-03-13 15:08:33.565 INFO 31577 --- [SpringContextShutdownHook] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application UNKNOWN with eureka with status DOWN
2024-03-13 15:08:33.570 INFO 31577 --- [SpringContextShutdownHook] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2024-03-13 15:08:33.601 INFO 31577 --- [SpringContextShutdownHook] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient

It may be related to spring-cloud/spring-cloud-netflix#3570
I tests the master branch. It works well.

@wallmamami The apollo-all-in-one.jar was not updated to the latest version. You may try it now.