@Harish S
Looks like you are using your own Custom Local Repository which is not configured properly hence the Yum is not able to locate the repodata.xml file.
Can you please check if you are able to access the public repo? From the ambari server host.
# wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/repodata/repomd.xml
.
Also please check the "baseurl" that you are using inside the following file if it is correct and accessible?
# cat /etc/yum.repos.d/ambari.repo
.
If above works then you will need to check if you have configured your local offline repo correctly or not? And if you are able to access the following URL using wget / curl or using browser?
http://xxx.xxx.xxx/data/AMBARI-2.4.1.0/centos7/2.4.1.0-22/repodata/repomd.xml
.
Also please login to your webserver host where you have configured the local repository and then please check if the path exists?
# ls -l /PATH/TO/AMBARI-2.4.1.0/centos7/2.4.1.0-22/repodata/repomd.xml
(OR)
# ls -l /PATH/TO/AMBARI-2.4.1.0/centos7/2.4.1.0/repodata/repomd.xml
Please refer to the following doc to know more about offline local repo configuration.
https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-installation/content/setting_up_a...