If zookeeper is down when discovery is started, it fails to register
when the zookeeper comes up for the first time. This commit has fix for
this issue