Support Questions
Find answers, ask questions, and share your expertise

How we can sync up the ambari agents in other nodes after ambari upgrade?

Explorer

Hi Guys,

We are using 24 node cluster.

We have upgraded my Ambari-server and ambari agent in main server. How can i sync up the ambari agent in all other nodes.

Can someone please help us?

1 ACCEPTED SOLUTION

Accepted Solutions

Contributor

@Narasimha Gunturu

You would need to upgrade the Ambari agent in other nodes as well. Check below link for details (point #7):

http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_upgrading_Ambari/content/_upgrade_ambari....

Once agents are upgraded and started, they would sync up with Ambari server. All agents should be at same version as Ambari server

-Vivek

View solution in original post

5 REPLIES 5

Contributor

@Narasimha Gunturu

You would need to upgrade the Ambari agent in other nodes as well. Check below link for details (point #7):

http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_upgrading_Ambari/content/_upgrade_ambari....

Once agents are upgraded and started, they would sync up with Ambari server. All agents should be at same version as Ambari server

-Vivek

View solution in original post

@Narasimha Gunturu

On all host you need to do -

1. ambari-agent stop

2. #yum upgrade ambari-agent

3. ambari-agent restart

Thats sit.

Explorer

@Vivek,

If it is single digit nodes we can update the agent manually.

For example: If it is 500 Node cluster, is there any way to sync up the updated agent in all the nodes at a time?

@Narasimha Gunturu

1. Just put the hostname/ipaddress in a file say - '/tmp/nodes'

2. use below command to run -

for i in `cat /tmp/nodes`; do ssh $i 'yum upgrade -y ambari-agent; /etc/init.d/ambari-agent restart'; done

-- [You might need to enter password if there is no passwordless ssh configured]

Contributor

@Narasimha Gunturu - In such cases, it is good to write a script to upgrade the agents across all nodes

For example:

key="/tmp/ambari-keypair"
for i in {1..5} ; do ssh -i $key -o StrictHostKeyChecking=no root@host-$i.mydomain ambari-agent stop ; done
repourl="http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo"

for i in {1..5} ; do ssh -i $key root@host-$i.mydomain  wget -nv $repourl -O /etc/yum.repos.d/ambari.repo; done
for i in {1..5} ; do ssh -i $key root@host-$i.mydomain yum upgrade -y ambari-agent ; done
for i in {1..5} ; do ssh -i $key root@host-$i.mydomain ambari-agent start ; done

Here host-1.mydomain to host-5.mydomain are the five agent nodes and 'key' variable holds the ssh key to connect to those nodes from a central server (could be the Ambari server host)