用 docker run
+mysql
的方式部署,报错如下:
[root@zhums logs]# cat halo.log
2023-03-08T11:43:50.016+08:00 INFO 7 --- [main] run.halo.app.Application : Starting Application v2.3.0 using Java 17.0.6 with PID 7 (/application/BOOT-INF/classes started by root in /application)
2023-03-08T11:43:50.023+08:00 INFO 7 --- [main] run.halo.app.Application : No active profile set, falling back to 1 default profile: "default"
2023-03-08T11:43:52.587+08:00 INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2023-03-08T11:43:52.590+08:00 INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data R2DBC repositories in DEFAULT mode.
2023-03-08T11:43:52.862+08:00 INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 256 ms. Found 1 R2DBC repository interfaces.
2023-03-08T11:43:53.955+08:00 INFO 7 --- [main] c.g.j.r.m.MysqlConnectionFactoryProvider : set jasync.mysql.CLIENT_FOUND_ROWS=true
2023-03-08T11:43:54.024+08:00 INFO 7 --- [main] c.github.jasync.sql.db.util.NettyUtils : jasync available transport - native (epoll)
2023-03-08T11:43:55.430+08:00 INFO 7 --- [main] org.pf4j.DefaultPluginStatusProvider : Enabled plugins: []
2023-03-08T11:43:55.432+08:00 INFO 7 --- [main] org.pf4j.DefaultPluginStatusProvider : Disabled plugins: []
2023-03-08T11:43:55.436+08:00 INFO 7 --- [main] org.pf4j.DefaultPluginManager : PF4J version 3.9.0 in 'deployment' mode
2023-03-08T11:43:58.353+08:00 INFO 7 --- [main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 5 endpoint(s) beneath base path '/actuator'
2023-03-08T11:44:08.752+08:00 WARN 7 --- [main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'r2dbcScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/R2dbcInitializationConfiguration.class]: Failed to execute database script
2023-03-08T11:44:08.755+08:00 INFO 7 --- [main] r.h.a.e.c.DefaultControllerManager : Shutting down 0 controllers...
2023-03-08T11:44:08.756+08:00 INFO 7 --- [main] r.h.a.e.c.DefaultControllerManager : Shutdown 0 controllers.
2023-03-08T11:44:08.759+08:00 INFO 7 --- [main] r.h.a.e.controller.DefaultController : Disposing controller garbage-collector-controller
2023-03-08T11:44:08.759+08:00 INFO 7 --- [main] r.h.a.e.controller.DefaultController : Controller garbage-collector-controller is disposed
2023-03-08T11:44:08.901+08:00 INFO 7 --- [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-03-08T11:44:08.979+08:00 ERROR 7 --- [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'r2dbcScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/R2dbcInitializationConfiguration.class]: Failed to execute database script
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1752) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[spring-context-6.0.5.jar:6.0.5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.5.jar:6.0.5]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:150) ~[spring-boot-3.0.3.jar:3.0.3]
at run.halo.app.Application.main(Application.java:28) ~[classes/:2.3.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[application/:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[application/:na]
Caused by: org.springframework.r2dbc.connection.init.UncategorizedScriptException: Failed to execute database script
at org.springframework.r2dbc.connection.init.DatabasePopulator.lambda$populate$4(DatabasePopulator.java:65) ~[spring-r2dbc-6.0.5.jar:6.0.5]
at reactor.core.publisher.Mono.lambda$onErrorMap$27(Mono.java:3759) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.Mono.lambda$onErrorResume$29(Mono.java:3849) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onError(MonoUsingWhen.java:203) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.Mono.subscribe(Mono.java:4485) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxRetry$RetrySubscriber.onError(FluxRetry.java:95) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:180) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.pool.AbstractPool$Borrower.fail(AbstractPool.java:475) ~[reactor-pool-1.0.0.jar:1.0.0]
at reactor.pool.SimpleDequePool.lambda$drainLoop$9(SimpleDequePool.java:429) ~[reactor-pool-1.0.0.jar:1.0.0]
at reactor.core.publisher.FluxDoOnEach$DoOnEachSubscriber.onError(FluxDoOnEach.java:186) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onError(FluxMapFuseable.java:340) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:114) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:64) ~[reactor-core-3.5.3.jar:3.5.3]
at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[na:na]
at com.github.jasync.sql.db.util.FutureUtilsKt.tryFailure(FutureUtils.kt:21) ~[jasync-pool-2.1.23.jar:na]
at com.github.jasync.sql.db.pool.TimeoutSchedulerImpl$addTimeout$1$scheduledFuture$1.invoke(TimeoutScheduler.kt:63) ~[jasync-common-2.1.23.jar:na]
at com.github.jasync.sql.db.pool.TimeoutSchedulerImpl$addTimeout$1$scheduledFuture$1.invoke(TimeoutScheduler.kt:62) ~[jasync-common-2.1.23.jar:na]
at com.github.jasync.sql.db.pool.TimeoutSchedulerImpl.schedule$lambda-0(TimeoutScheduler.kt:51) ~[jasync-common-2.1.23.jar:na]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:406) ~[netty-transport-classes-epoll-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.89.Final.jar:4.1.89.Final]
at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.Mono.block(Mono.java:1710) ~[reactor-core-3.5.3.jar:3.5.3]
at org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializer.runScripts(R2dbcScriptDatabaseInitializer.java:68) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.runScripts(AbstractScriptDatabaseInitializer.java:146) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:108) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applySchemaScripts(AbstractScriptDatabaseInitializer.java:98) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:76) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:66) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1798) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1748) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[spring-beans-6.0.5.jar:6.0.5]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[spring-context-6.0.5.jar:6.0.5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.5.jar:6.0.5]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.3.jar:3.0.3]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:150) ~[spring-boot-3.0.3.jar:3.0.3]
at run.halo.app.Application.main(Application.java:28) ~[classes/:2.3.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[application/:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[application/:na]
Caused by: org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection
at org.springframework.r2dbc.connection.ConnectionFactoryUtils.lambda$getConnection$0(ConnectionFactoryUtils.java:90) ~[spring-r2dbc-6.0.5.jar:6.0.5]
at reactor.core.publisher.Mono.lambda$onErrorMap$28(Mono.java:3773) ~[reactor-core-3.5.3.jar:3.5.3]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.3.jar:3.5.3]
... 26 common frames omitted
Caused by: java.util.concurrent.TimeoutException: Operation timeout after it took too long to return (PT5S)
... 12 common frames omitted
[root@zhums logs]#
halo 启动命令:docker run \
-it -d \
--name halo \
-p 8090:8090 \
-v /data/halo2:/root/.halo2 \
halohub/halo:2.3.0 \
--halo.external-url=http://xxx:8090/ \
--spring.sql.init.platform=mysql \
--spring.r2dbc.url=r2dbc:pool:mysql://xxx:13306/halo \
--spring.r2dbc.username=halo \
--spring.r2dbc.password=Halo@200235 \
--halo.security.initializer.superadminusername=root \
--halo.security.initializer.superadminpassword=Blog@200235
mysql 监听在0.0.0.0:13306 测试通过halo用户远程访问没问题 请求大佬帮助😫