Created on 07-03-2016 11:27 PM - edited 08-17-2019 11:43 AM
How within few minutes you can setup Rack Awareness through Ambari?
Series1: Introduction to Rack Awareness can be viewed here:
https://community.hortonworks.com/content/kbentry/43057/rack-awareness-1.html
How does my cluster look?
Image below shows the hosts and the rack:
You will see that the rack mentioned for each of the hosts in the test cluster is “/default-rack”. Which means Ambari (And HDFS and YARN) thinks of this cluster inside a single rack i.e. default-rack. In other words, it is not rack aware.
Now let us examine the configurations that will change after we make the cluster rack-aware.
Steps to verify Rack Awareness:
ssh root@node2
ls –lrt /etc/hadoop/conf/topology* cat /etc/hadoop/conf/toplogy_mappings.data
Qs: Why is node 2 not listed here?
Because node 2 does not contain a datanode.
su – hdfs hdfs fsck –racks hdfs dfsadmin –report
For showing the relevant entries I grepped “hdfs dfsadmin –report” command. You will see that there is no rack information attached to the current cluster
Steps to setup Rack Awareness through Ambari:
3.Click on Individual hosts and then click on Host actions:
4.Click on Set Rack in the host actions and set the rack name (I choose two racks: rack1 and rack2). Then click ok.
5.Hit Back and go back to the Hosts page.
Similarly set rack names for the other nodes in your cluster.
So far you do not need to restart any components.
6.I have set up the following rack names for the different nodes in my cluster:
7.Now go back to your dashboard and you will see that HDFS and MapReduce2 services needs to be restarted
8.Restart those two services.
Wait for them to finish and your cluster is now Rack Aware
Steps to verify Rack Awareness:
1.On the same terminal view the current topology mapping of the system:
cat /etc/hadoop/conf/toplogy_mappings.data
As you can see the racks are mapped as we intended through Ambari Admin console.
2.As super user run the fsck and dfsadmin commands
su – hdfs
hdfs fsck –racks
hdfs dfsadmin –report
The report shows that Rack Awareness is in effect.
Logout from superuser aka hdfs in this case.
Congratulations your cluster is now Rack Aware!!!
Created on 10-19-2016 10:48 PM
After making the changes as specified for rack awareness, the resource manager (resourcemanager:8088/cluster) still shows the rack as /default-rack. Is this expected? Why doesn't the resource manager show the correct rack information?
Created on 04-18-2017 03:45 PM
What about adding new host and assign it at the same time to a specific rack? I'd like to avoid the host (data node) and then have to set the rack and restart again. Is there a way via Ambari UI?