Custom PersistentVolumes produce errors OrientDB Kubernetes

11/9/2018

I am setting up OrientDB cluster with Kubernetes. I defined PVC in the StatefulSet. When I do not define persistent volumes and they are dynamically provisioned the configs and data defined properly. However, when I define my own persistent volumes, some weird errors occur, like this one:

INFO  System is started under an effective user : `root` [OEngineLocalPaginated]Error during server execution
com.orientechnologies.orient.core.exception.ODatabaseException: Invalid configuration settings. Can not set maximum size of WAL segment

What could be the cause of it? Here is how my persistent volumes look like. There are 6 of them, so there are 3 pairs of this kind of volumes the difference is in the name and path name:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: "pv-db-1"
  labels:
    service: orientdb
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: "40Gi"
  accessModes: [ "ReadWriteOnce" ]
  hostPath:
    path: /orientdb/databases/databases-1
  persistentVolumeReclaimPolicy: Retain
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: "pv-backup-1"
  labels:
    service: orientdb
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: "20Gi"
  accessModes: [ "ReadWriteOnce" ]
  hostPath:
    path: /orientdb/backup/backup-1
  persistentVolumeReclaimPolicy: Retain

StatefulSet looks like this:

kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: orientdbservice
spec:
  serviceName: orientdbservice
  replicas: 3
  selector:
    matchLabels:
      service: orientdb
      type: container-deployment
  template:
    metadata:
      labels:
        service: orientdb
        type: container-deployment
    spec:
      containers:
      - name: orientdbservice
        image: orientdb:3.0.10
        command: ["/bin/sh","-c", " cp /configs/* /orientdb/config/ ; cp /orientdb/bin/data/plugin/* /orientdb/lib ; 
         /orientdb/bin/server.sh -Ddistributed=true"
        ]
        env:
        - name: ORIENTDB_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: orientdb-password
              key: password.txt
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        ports:
        - containerPort: 2424
          name: port-binary
        - containerPort: 2480
          name: port-http
        - containerPort: 5701
          name: hazelcast
        volumeMounts:
        - name: config
          mountPath: /orientdb/config
        - name: orientdb-config-plugin
          mountPath: /configs/pom.xml
          subPath: pom.xml
        - name: orientdb-config-build
          mountPath: /configs/build.sbt
          subPath: build.sbt
        - name: orientdb-config-hazelcast
          mountPath: /configs/hazelcast.xml
          subPath: hazelcast.xml
        - name: orientdb-config-server
          mountPath: /configs/orientdb-server-config.xml
          subPath: orientdb-server-config.xml
        - name: orientdb-config-backups
          mountPath: /configs/backups.json
          subPath: backups.json
        - name: orientdb-config-events
          mountPath: /configs/events.json
          subPath: events.json
        - name: orientdb-config-distributed
          mountPath: /configs/default-distributed-db-config.json
          subPath: default-distributed-db-config.json
        - name: orientdb-config-client-logs
          mountPath: /configs/orientdb-client-log.properties
          subPath: orientdb-client-log.properties
        - name: orientdb-config-server-logs
          mountPath: /configs/orientdb-server-log.properties
          subPath: orientdb-server-log.properties
        - name: orientdb-databases
          mountPath: /orientdb/databases
        - name: orientdb-backup
          mountPath: /orientdb/backup
        - name: orientdb-data
          mountPath: /orientdb/bin/data
      volumes:
      - name: config
        emptyDir: {}
      - name: orientdb-config-plugin
        configMap:
          name: orientdb-configmap-plugin
      - name: orientdb-config-build
        configMap:
          name: orientdb-configmap-build
      - name: orientdb-config-hazelcast
        configMap:
          name: orientdb-configmap-hazelcast
      - name: orientdb-config-server
        configMap:
          name: orientdb-configmap-server
      - name: orientdb-config-backups
        configMap:
          name: orientdb-configmap-backups
      - name: orientdb-config-events
        configMap:
          name: orientdb-configmap-events
      - name: orientdb-config-distributed
        configMap:
          name: orientdb-configmap-distributed
      - name: orientdb-config-client-logs
        configMap:
          name: orientdb-configmap-client-logs
      - name: orientdb-config-server-logs
        configMap:
          name: orientdb-configmap-server-logs
      - name: orientdb-data
        hostPath:
          path: /import_data
          type: Directory
  volumeClaimTemplates:
  - metadata:
      name: orientdb-databases
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 40Gi
  - metadata:
      name: orientdb-backup
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 20Gi
-- Cassie
kubernetes
orientdb
volume

0 Answers