could you provide some more details on your cluster? Is it a “real” cluster or a HDP sandbox VM? How do you connect on a network level to the cluster, e.g. are there firewalls that do NAT (*) inbetween?
Due to the way that the HDFS and WebHDFS protocols work your client needs to be able to make direct network connections to the NameNode service and all DataNode services in your cluster. The ports for those connections are documented here: