apiVersion: apps/v1
kind: Deployment
metadata:
name: halo
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: halo
template:
metadata:
labels:
app: halo
spec:
containers:
- name: halo
image: 192.168.72.138/library/halo-app:2.18
ports:
- containerPort: 8090
volumeMounts:
- name: config-volume
mountPath: /root/.halo2/application.yaml
subPath: application.yaml
- name: halo-data
mountPath: /root/.halo2
volumes:
- name: config-volume
configMap:
name: halo-config
- name: halo-data
persistentVolumeClaim:
claimName: halo-pvc
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
以上是deploy资源
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-08-26T06:52:16.701Z ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneSearchEngine' defined in class path resource [run/halo/app/config/HaloConfiguration.class]: org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /root/.halo2/indices/halo/write.lock
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962) ~[spring-context-6.1.10.jar!/:6.1.10]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.10.jar!/:6.1.10]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-3.3.1.jar!/:3.3.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.1.jar!/:3.3.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.1.jar!/:3.3.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.1.jar!/:3.3.1]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149) ~[spring-boot-3.3.1.jar!/:3.3.1]
at run.halo.app.Application.main(Application.java:28) ~[!/:2.18.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[halo.jar:2.18.0]
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[halo.jar:2.18.0]
at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[halo.jar:2.18.0]
Caused by: java.lang.RuntimeException: org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /root/.halo2/indices/halo/write.lock
at run.halo.app.search.lucene.LuceneSearchEngine.afterPropertiesSet(LuceneSearchEngine.java:249) ~[!/:2.18.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835) ~[spring-beans-6.1.10.jar!/:6.1.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-6.1.10.jar!/:6.1.10]
... 22 common frames omitted
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /root/.halo2/indices/halo/write.lock
at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:117) ~[lucene-core-9.11.1.jar!/:9.11.1 0c087dfdd10e0f6f3f6faecc6af4415e671a9e69 - 2024-06-23 12:31:02]
at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:43) ~[lucene-core-9.11.1.jar!/:9.11.1 0c087dfdd10e0f6f3f6faecc6af4415e671a9e69 - 2024-06-23 12:31:02]
at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:44) ~[lucene-core-9.11.1.jar!/:9.11.1 0c087dfdd10e0f6f3f6faecc6af4415e671a9e69 - 2024-06-23 12:31:02]
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:955) ~[lucene-core-9.11.1.jar!/:9.11.1 0c087dfdd10e0f6f3f6faecc6af4415e671a9e69 - 2024-06-23 12:31:02]
at run.halo.app.search.lucene.LuceneSearchEngine.afterPropertiesSet(LuceneSearchEngine.java:245) ~[!/:2.18.0]
... 24 common frames omitted
以上是日志
问下是小弟哪一步没做对吗?