apache-spark-on-k8s / kubernetes-HDFS

Repository holding configuration files for running an HDFS cluster in Kubernetes
Apache License 2.0
397 stars 185 forks source link

zookeeper pod is pending #51

Open frouzbeh opened 6 years ago

frouzbeh commented 6 years ago

Hi, First of all I'm new in this area and very eager to deploy hdfs on kubernetes cluster. I have a kubernetes cluster with one master node and two workers on Ubuntu virtual machines (virtualBox) and the cluster works fine. Now, I'm trying to deploy hdfs on the cluster based on the instruction in this repository, but I'm having difficulties to launch the zookeeper. After launching zookeeper via helm the pod remains in pending status. Anybody can help to fix the problem? Thanks,

frouzbeh commented 6 years ago

When I use the following command to launch zookeeper here I get: The command: helm install zookeeper \ --name my-zk \ --version 0.6.3 \ --repo https://kubernetes-charts-incubator.storage.googleapis.com/

`NAME: my-zk LAST DEPLOYED: Sun Jun 17 11:28:48 2018 NAMESPACE: default STATUS: DEPLOYED

RESOURCES: ==> v1beta1/StatefulSet NAME DESIRED CURRENT AGE my-zk-zookeeper 3 1 0s

==> v1beta1/PodDisruptionBudget NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE my-zk-zookeeper 2 N/A 0 0s

==> v1/Pod(related) NAME READY STATUS RESTARTS AGE my-zk-zookeeper-0 0/1 Pending 0 0s

==> v1/Service NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE my-zk-zookeeper ClusterIP 10.102.110.93 2181/TCP 0s my-zk-zookeeper-headless ClusterIP None 2888/TCP,3888/TCP 0s

NOTES: Thank you for installing ZooKeeper on your Kubernetes cluster. More information about ZooKeeper can be found at https://zookeeper.apache.org/doc/current/

  1. ZooKeeper will be accessible outside of the Kubernetes cluster only if appropriate annotations and service type were provided. Its purpose is to provide coordination for distributed systems running inside the cluster. As ZooKeeper uses a TCP based protocol with an internal wire format, you will probably want to use an existing client library for communication with the ensemble.

  2. The officially maintained clients are written in C and Java, and these can be obtained with ZooKeeper release from http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.9/. A list of language specific bindings and higher level libraries is available here https://cwiki.apache.org/confluence/display/ZOOKEEPER/ZKClientBindings.

  3. Most ZooKeeper clients require a connection string when instantiating an instance of the client library, or when first connecting the client to the ensemble. The connection string takes the form

    :,:,... . If your ensemble has greater than 1 server, you should provide multiple servers in the connection string to allow for the client to continue to function in the presence of individual server failures. It is important that you do not use IP addresses and instead use the DNS entries for the domain established by the StatefulSet's HeadlessService. Your connection string should look like my-zk-zookeeper-headless-0:,my-zk-zookeeper-headless-1:,... You can also use the client Service my-zk-zookeeper: to connect to an available ZooKeeper server. `

As you can see the pod is in pending status.

shashank855 commented 5 years ago

Hi frouzbeh, I faced the same issue, in my case pvc for the zookeeper was in unbound state. I am using OpenEBS cstor for my hdfs volumes. You can OpenEBS storageclass for your hdfs deployment (ref: https://docs.openebs.io/docs/next/installation.html).
After deploying OpenEBS delete zookeeper pvc and apply this:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    app: zookeeper
    component: server
    release: my-hdfs
  name: data-my-hdfs-zookeeper-0
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: openebs-cstor-sparse