Open Shift 上的 Apache Ignite 部署

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

在 Open Shift 上部署 Ignite Cluster 时,我们观察到以下问题

我们已经创建了各自的 PV 和 PVC YAML 文件。

更重要的一点是它始终指向 /ignite/work,无论安装路径如何。

POD 的错误详细信息:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
class org.apache.ignite.IgniteException: Work directory does not exist and cannot be created: /ignite/work
    at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1135)
    at org.apache.ignite.Ignition.start(Ignition.java:356)
    at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:365)
Caused by: class org.apache.ignite.IgniteCheckedException: Work directory does not exist and cannot be created: /ignite/work
    at org.apache.ignite.internal.util.IgniteUtils.workDirectory(IgniteUtils.java:9900)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.initializeConfiguration(IgnitionEx.java:1891)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1715)
    at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1160)
    at org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1054)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:940)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:839)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:709)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:678)
    at org.apache.ignite.Ignition.start(Ignition.java:353)
    ... 1 more
Failed to start grid: Work directory does not exist and cannot be created: /ignite/work


***************************************************
YAML Content 
***************************************************

apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    field.cattle.io/creatorId: user-zqf4l
  creationTimestamp: "2021-01-12T06:48:02Z"
  finalizers:
  - kubernetes.io/pv-protection
  labels:
    cattle.io/creator: norman
  name: ignite-storage-work-vol
  resourceVersion: "18595579"
  selfLink: /api/v1/persistentvolumes/newsto
  uid: ee81855d-6497-4465-abdd-8244883e383b
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
  ##when you create folder ensure you give proper permission to folder Assing Owner 
  ##chown rootadmin:rootadmin grafana 
  ##give full writes chmod 777 grafana/ 
    path: /opt/work ## Change the location before deploying
    type: ""
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Filesystem

.....
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ignite-storage-work-vol-claim
spec:
  volumeName: ignite-storage-work-vol
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

......

# An example of a Kubernetes configuration for pod deployment.
apiVersion: apps/v1
kind: StatefulSet
metadata:
  # Cluster name.
  name: ignite-cluster
  namespace: or
spec:
  # The initial number of Ignite pods.
  replicas: 2
  serviceName: ignite-service
  selector:
    matchLabels:
      app: ignite
  template:
    metadata:
      labels:
        app: ignite
    spec:
      serviceAccountName: ignite
      # terminationGracePeriodSeconds: 60000 (use in production for graceful restarts and shutdowns)
      containers:
        # Custom pod name.
        - name: ignite-node
          image: apacheignite/ignite:2.13.0
          imagePullPolicy: IfNotPresent
          env:
            - name: OPTION_LIBS
              value: ignite-kubernetes,ignite-rest-http
            - name: CONFIG_URI
              value: file:///ignite/config/ignite-node-cfg.xml
            - name: JVM_OPTS
              value: "-DIGNITE_WAL_MMAP=false"
              # consider this property for production -DIGNITE_WAIT_FOR_BACKUPS_ON_SHUTDOWN=true
              
          ports:
            # Ports you might need to open.
            - containerPort: 47100 # communication SPI port
            - containerPort: 47500 # discovery SPI port
            - containerPort: 49112 # JMX port
            - containerPort: 10800 # thin clients/JDBC driver port
            - containerPort: 8080 # REST API
          volumeMounts:
            - mountPath: /ignite/config
              name: config-vol
            - name: work-vol
              mountPath: /tmp/work
              readOnly: false
            - name: storage-vol
              mountPath: /tmp/storage
              readOnly: false
            - name: wal-vol 
              mountPath: /tmp/wal
              readOnly: false
            - name: walarchive-vol     
              mountPath: /tmp/walarchive
              readOnly: false
            

      volumes:
        - name: config-vol
          configMap:
            name: ignite-cfg-persistent
        - name: work-vol
          persistentVolumeClaim:
            claimName: ignite-storage-work-vol-claim
        - name: storage-vol
          persistentVolumeClaim:
            claimName: ignite-storage-storage-vol-claim
        - name: wal-vol
          persistentVolumeClaim:
            claimName: ignite-storage-wal-vol-claim
        - name: walarchive-vol
          persistentVolumeClaim:
            claimName: ignite-storage-walarchive-vol-claim
kubernetes openshift ignite
1个回答
2
投票

它期望能够写入

/ignite/work
,但那里没有持久卷。您似乎正在将它们安装在
/tmp
中。建议更改:

- name: work-vol
  mountPath: /tmp/work
  readOnly: false

致:

- name: work-vol
  mountPath: /ignite/work
  readOnly: false

其他 PV 也是如此。

© www.soinside.com 2019 - 2024. All rights reserved.