On each agent host, stop the agent.
ambari-agent stop
Remove old agent certificates.
rm /var/lib/ambari-agent/keys/*
Using a text editor, edit
/etc/ambari-agent/conf/ambari-agent.ini
to point to the new host.[server]
hostname= <NEW FULLY.QUALIFIED.DOMAIN.NAME>
url_port=8440
secured_url_port=8441