replace localhost hdfs with obtaining namenode address from hadoop configuration.