Ambari Upgrade Guide
Also available as:

Record Component Layout

How you have chosen to install the HDP component across the hosts is unique to your cluster. Before upgrading HDP, use the Ambari Web Hosts and Services tabs to determine the components installed on each host. For more information about using Ambari Web, see the Ambari User’s Guide sections Working with Hosts and Viewing Components on a Host. Be sure to record the location of all components, including master components (such as NameNode, ResourceManager, etc) and slave components (such as DataNodes, NodeManagers, etc).

Another option is to use the Ambari REST API and export the list of hosts and their associated components in json format.

curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://ambari.server:8080/api/v1/clusters/ > > cluster.name_blueprint.json

where ambari.server is the Ambari Server host and is your cluster name.