Rameish
Rameish

Reputation: 21

Apache Ignite Deployment on Open Shift

We have observed following issue when we deploy Ignite Cluster on Open Shift

We have created respective PV and PVC YAML files.

One more important point is always it points to /ignite/work irrespective of Mount Path.

Error details at 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

Upvotes: 0

Views: 635

Answers (1)

Stephen Darlington
Stephen Darlington

Reputation: 52575

It's expecting to be able to write to /ignite/work but there's no persistent volume there. You appear to be mounting them in /tmp. Suggest changing:

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

To:

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

And the same for the other PVs.

Upvotes: 2

Related Questions