I\'ve started hadoop cluster composed of on master and 4 slave nodes.
Configuration seems ok:
hduser@ubuntu-amd64:/usr/local/hadoop$ ./bin/hdfs dfsadmin -rep
It's because of the same hostname in both datanodes. In your case both datanodes are registering to the namenode with same hostname ie 'localhost' Try with different hostnames it will fix your problem.
in UI it will show only one entry for a hostname.
in "hdfs dfsadmin -report" output you can see both.