To set up Hadoop VM in centOS for the single node cluster, Please follow the steps given in the below link:
https://www.edureka.co/blog/install-hadoop-single-node-hadoop-cluster
To set up Hadoop VM in centOS for the multi-node cluster, Please follow the steps given in the below link:
https://www.edureka.co/blog/setting-up-a-multi-node-cluster-in-hadoop-2.X
The same steps need to be followed for Ubuntu. The only changes that need to be done in Ubuntu are:
Where we use 'yum' in centOS we need to use 'apt-get' command in Ubuntu.