Do all slaves and masters in Hadoop need to have the same username?
- Should all slaves and masters have the same username?
- Should all slaves and masters have hadoop on the same path?
If yes, is there any way to overcome the above limitation?
Make sure (namenode, datanode) shares the same user,
and (jobtracker, tasktracker) share the same user (not necessarily the same user as (namenode, datanode). So to answer your question (1): Yes.
For #2, you should have all master/slave machines share the same Hadoop version, preferably in the same directory structure. You can use a deployment tool such as puppet/chef/ansible/etc or simply use rsync to maintain files the same way on all systems