@Ayushj250
Please check the following:
1. What is the ambari server host name used by the agents ?
# grep 'hostname' /etc/ambari-agent/conf/ambari-agent.ini
Ideally you should see the FQDN of ambari-server host listed in the hostname section of the ambari-agent.ini file.
>>> Above need to be checked carefully because in your attached screenshot we see partial output sayig :
NetUtil.py:61 - Connecting to https://ip......
.
NOTICE it shows that your ambari-server FQDN is something like "ip-" ....
.
But from the screenshot looks like your ambari server FQDN may be "ayush-ambari-server.com"
So please check if all your cluster nodes are able to resolve each other using their FQDN (Fully Qualified Hostname) or not?
Hence please check the following from every cluster node:
1. If each host has correct FQDN?
# hostname -f
# python -c "import socket; print('FQDN = ' + socket.getfqdn()); print('Hostname = ' + socket.gethostname()); print('IPAddress = ' + socket.gethostbyname(socket.getfqdn()))"
2. If every host can connect to ambari-server using ambari servers FQDN on ambari ports like:
# nc -v ayush-ambari-server.com 8440
# nc -v ayush-ambari-server.com 8441