Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS cluster can't work with kubernetes + flannel in coreos #363

Closed
ztao1987 opened this issue Nov 11, 2015 · 12 comments
Closed

HDFS cluster can't work with kubernetes + flannel in coreos #363

ztao1987 opened this issue Nov 11, 2015 · 12 comments

Comments

@ztao1987
Copy link

Hi,

I deployed kubernetes with flanneld.service enabled in coreos. And then I started hdfs namenode and datanode via kubernetes replication-controller. I also created kubernetes service for namenode. The namenode service ip is 10.100.220.223, while the pod ip of namenode is 10.20.96.4. In my case, one namenode and one datanode happens to be on same host. And namenode pod and datanode pod can ping each other successfully.
However I encountered the following two problems when trying to start hdfs datanode:

  1. If I used namenode service ip 10.100.220.223 as fs.defaultFS in core-site.xml for datanode. When datanode tried to register itself to namenode via rpc request, namenode got the wrong ip address for the datanode. Normally it should get the pod ip of the datanode, but in this case docker0 inet address of datanode host is reported to namenode.
  2. in order to workaround this, I used namenode pod ip 10.20.96.4 in core-site.xml for datanode. This time datanode can't be started at all. The error info reports that "k8s_POD-2fdae8b2_namenode-controller-keptk_default_55b8147c-881f-11e5-abad-02d07c9f6649_e41f815f.bridge" is used as namenode host instead of the namenode pod ip.

I tried to search this issue over the network, but nothing helps me. Could you please help me out of this? Thanks.

@eyakubovich
Copy link
Contributor

@ztao1987 I don't know much about HDFS but I think what is happening is this. Because namenode is accessed as a service, the connection goes through kube-proxy, so all connections are actually coming from it (and its connections bind to docker0 interface). I think it would be best to ask Kubernetes community for best practices for working around this problem.

@eyakubovich
Copy link
Contributor

@ztao1987
Copy link
Author

@eyakubovich Thanks for you reply. I already posted this question in Kubernetes community. I checked this google group thread, it seems he workarounds it by using namenode pod ip. But in my case, namenode pod ip is translated into somethings like bridge name, do you happend to known why?

@eyakubovich
Copy link
Contributor

But in my case, namenode pod ip is translated into somethings like bridge name

Not sure what you mean

@ztao1987
Copy link
Author

I mean if I used namenode actual pod ip to start datanode, the datanode regcognize it as "k8s_POD-2fdae8b2_namenode-controller-keptk" and failed to start. I got workaround for this from @luqman in the google group thread you provide. He mentioned that I need DNS to solve this problem.

@ztao1987
Copy link
Author

Is this issue caused by flannel or kubernetes? I mean "if using namenode actual pod ip to start datanode, the datanode regcognize it as "k8s_POD-2fdae8b2_namenode-controller-keptk""

@ztao1987
Copy link
Author

I got the answer from kubernetes community. use the latest kubernetes and pass the params --proxy-mode=iptables to kube-proxy start command, HDFS cluster works now

@philips
Copy link
Contributor

philips commented Nov 13, 2015

@ztao1987 Nice! We plan to make github.com/coreos/coreos-kubernetes default to iptables soon.

@ksr1
Copy link

ksr1 commented Jun 2, 2016

@ztao1987
Hi, I'm trying to setup a HDFS cluster in Kubernetes. Do you have any info you can share on setting up the cluster? Any set of instructions would be appreciated if have them documented. Thanks.

@ztao1987
Copy link
Author

ztao1987 commented Jun 3, 2016

@ksr1 Assumed you already have a namenode/datanode docker image, and then deploy it using ReplicationController/deamonset in k8s. Rember to start kube-proxy using params --proxy-mode=iptables. If you want to do data persistent, you should use volumes to volumeMounts the data whatever you want. No special things for other parts.

@ksr1
Copy link

ksr1 commented Jun 3, 2016

@ztao1987 Thanks for the reply. Will try setting the params in Kubernetes and try the setup.

@tomdee
Copy link
Contributor

tomdee commented Apr 28, 2017

I think this is resolved. Please comment if not and I can reopen.

@tomdee tomdee closed this as completed Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants