Home > Blockchain >  Run elasticsearch 7.17 on Openshift error chroot: cannot change root directory to '/': Ope
Run elasticsearch 7.17 on Openshift error chroot: cannot change root directory to '/': Ope

Time:01-17

When starting the cluster Elasticsearch 7.17 in Openshift . Cluster writes an error chroot: cannot change root directory to '/': Operation not permitted` Kibana started ok.

Code : `apiVersion: apps/v1 kind: StatefulSet metadata: name: elasticsearch namespace: elasticsearch-pp spec: serviceName: elasticsearch replicas: 3

selector: matchLabels: app: elasticsearch template: metadata: labels: app: elasticsearch spec: containers: - name: elasticsearch

    image: NEXUS/elasticsearch:7.17.7
    env:
      - name: cluster.name
        value: k8s-logs
      - name: node.name
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: discovery.seed_hosts
        value: "es-cluster-0.elasticsearch,es-cluster-1.elasticsearch,es-cluster-2.elasticsearch"
      - name: cluster.initial_master_nodes
        value: "es-cluster-0,es-cluster-1,es-cluster-2"
      - name: ES_JAVA_OPTS
        value: "-Xms4012m -Xmx4012m"
    ports:
    - containerPort: 9200
      name: client
    - containerPort: 9300
      name: nodes
    volumeMounts:
    - name: data-cephfs
      mountPath: /usr/share/elasticsearch/data
 
  initContainers:
  - name: fix-permissions
    image: NEXUS/busybox
    command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"]
    volumeMounts:
    - name: data-cephfs
      mountPath: /usr/share/elasticsearch/data

  - name: increase-vm-max-map
    image: NEXUS/busybox
    imagePullPolicy: IfNotPresent
    command: ["/bin/sh"]
    args: ["-c", "sysctl -w vm.max_map_count=262144; echo vm.max_map_count=262144 >> /etc/sysctl.conf ; sysctl -p"]
    
  #   image: NEXUS/busybox
  #   command: ["sysctl", "-w", "vm.max_map_count=262144"]
    
  - name: increase-fd-ulimit
    image: NEXUS/busybox
    command: ["sh", "-c", "ulimit -n 65536"]
    

  serviceAccount: elk-anyuid
  serviceAccountName: elk-anyuid
  restartPolicy: Always
  volumes:
  - name: data-cephfs
    persistentVolumeClaim:
      claimName: data-cephfs          `

I tried changing the cluster settings, disabled initContainers , the error persists

CodePudding user response:

Решение взял из helm chart и получил файл statfulset заполнил values.yaml

helm template . -f values.yaml > app.yaml

https://github.com/elastic/helm-charts

  • Related