HDFS Clustering in Docker SWARM

In normal docker environment HDFS clustered images like hadoop-master and hadoop-slave works fine. But when I try to run these images in swarm mode, I am facing connectivity issues. Is clustered hdfs compatible with docker swarm? The service that I deployed is restarting and exiting continously for every 2-3 seconds. Can someone help me in detail to implement HDFS clustering in swarm mode. When I do docker logs conatinerid, I get

start sshd…
/bin/sh: 0: Can’t open /bin/which
/etc/init.d/ssh: 424: .: Can’t open /lib/lsb/init-functions.d/20-left-info-blocks

start serf…
Error connecting to Serf agent: dial tcp 127.0.0.1:7373: connection refused

hadoop-cluster-docker developed by Kiwenlau kiwenlau@gmail.com