add master ip at the beginning of hosts file
add slave ip at the beginning of slave hosts file
addToHosts function