如何在Kubernetes上部署Zookeeper- Liveness探测失败“已启用的四个字母单词命令的列表为:[[服务商]]”

unhi4e5o  于 2022-12-16  发布在  Apache
关注(0)|答案(1)|浏览(178)

Hello I try to deploy Zookeeper in Kubernetes with this yaml file:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: zookeeper-cluster-import-deployment
  namespace: mynamespace
  labels:
    name : zookeeper-cluster-import
    app : zookeeper-cluster-import
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: zookeeper-cluster-import
  template:
    metadata:
      labels:
        app: zookeeper-cluster-import
    spec:
      restartPolicy: Always
      containers:
      - name: zookeeper
        image: dockerbase_zookeeper:v01
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 2181
          name: zookeeper
        env:
          - name: ALLOW_ANONYMOUS_LOGIN
            value: "yes"
          - name: ZOO_4LW_COMMANDS_WHITELIST
            value: "ruok"
        livenessProbe:
             exec:
                command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 localhost 2181 | grep imok']
             initialDelaySeconds: 60
             periodSeconds: 10
             timeoutSeconds: 5
             failureThreshold: 6
             successThreshold: 1
        readinessProbe:
             exec:
                command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 localhost 2181 | grep imok']
             initialDelaySeconds: 120
             periodSeconds: 10
             timeoutSeconds: 5
             failureThreshold: 6
             successThreshold: 1
        resources:
          requests:
            cpu: 400m
            memory: 2Gi
          limits:
            cpu: 500m
            memory: 2Gi
        securityContext:
          allowPrivilegeEscalation: false
          privileged: false
          runAsGroup: 1000
          runAsUser: 1000
      imagePullSecrets:
      - name: secret-repos
      volumes:
      - name: pv-01
        persistentVolumeClaim:
          claimName: pv-claim-01

But when I apply this yaml I have "Liveness probe failed" and in the pod logs I see at the end of the logs : The list of enabled four letter word commands is : srvr
I don't understand because in env I did :

- name: ZOO_4LW_COMMANDS_WHITELIST
        value: "ruok"

It is like the command is not recognized.

s4chpxco

s4chpxco1#

Apache ZooKeeper is a distributed, open-source coordination service for distributed applications. ZooKeeper allows you to read, write, and observe updates to data. Data are organized in a file system like hierarchy and replicated to all ZooKeeper servers in the ensemble (a set of ZooKeeper servers). All operations on data are atomic and sequentially consistent. ZooKeeper ensures this by using the Zab consensus protocol to replicate a state machine across all servers in the ensemble. Follow this document for installation steps of zookeeper on kubernetes
There is a similar issue discussed here please check.

相关问题