Kubernetes上已安装卷的写访问错误

问题描述 投票:1回答:1

当我们在azure kubernetes服务(aks)中部署active-mq时,其中active-mq数据文件夹作为持久卷声明安装在azure托管磁盘上。以下是用于部署的yaml。使用的ActiveMQ映像:rmohr / activemqKubernetes版本:v1.15.7

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: activemqcontainer
spec:
  replicas: 1
  selector:
    matchLabels:
        app: activemqcontainer
  template:
    metadata:
      labels:
        app: activemqcontainer
    spec:
      securityContext:
        runAsUser: 1000
        fsGroup: 2000
        runAsNonRoot: false
      containers:
      - name: web
        image: azureregistry.azurecr.io/rmohractivemq
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 61616
        volumeMounts:
        -  mountPath: /opt/activemq/data
            subPath: data
            name: volume
        - mountPath: /opt/apache-activemq-5.15.6/conf/activemq.xml
          name: config-xml
          subPath: activemq.xml
      imagePullSecrets:
      - name: secret
      volumes:
      - name: config-xml
        configMap:
            name: active-mq-xml
      - name: volume
        persistentVolumeClaim:
            claimName: azure-managed-disk
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azure-managed-disk
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: managed-premium
  resources:
    requests:
      storage: 100Gi

得到以下错误。

WARN | Failed startup of context o.e.j.w.WebAppContext@517566b{/admin,file:/opt/apache-activemq-5.15.6/webapps/admin/,null}
java.lang.IllegalStateException: Parent for temp dir not configured correctly: writeable=false
        at org.eclipse.jetty.webapp.WebInfConfiguration.makeTempDirectory(WebInfConfiguration.java:336)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.webapp.WebInfConfiguration.resolveTempDirectory(WebInfConfiguration.java:304)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:69)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:468)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:504)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)[jetty-all-9.2.25.v20180606.jar:9.2.25.v20180606]
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)[jetty-all-9.2.25.v20180606.jar:9.2.2
azure kubernetes activemq azure-kubernetes
1个回答
0
投票

这是来自activemq Web管理控制台的警告。托管Web控制台的Jetty无法创建临时目录。

WARN | Failed startup of context o.e.j.w.WebAppContext@517566b{/admin,file:/opt/apache-activemq-5.15.6/webapps/admin/,null}
java.lang.IllegalStateException: Parent for temp dir not configured correctly: writeable=false

您可以通过在容器规范中如下设置环境变量ACTIVEMQ_TMP来覆盖默认的临时目录

 env:
    - name: ACTIVEMQ_TMP
      value : "/tmp"
© www.soinside.com 2019 - 2024. All rights reserved.