Skip to content

Instantly share code, notes, and snippets.

@gbraccialli
Created September 7, 2017 15:22
Show Gist options
  • Select an option

  • Save gbraccialli/2663201ef3e97206c0c0b4ab9ed0c590 to your computer and use it in GitHub Desktop.

Select an option

Save gbraccialli/2663201ef3e97206c0c0b4ab9ed0c590 to your computer and use it in GitHub Desktop.
yarn node -list|sed -n "s/^\(ip[^:]*\):.*/\1/p" > /home/hadoop/nodes.txt
< /home/hadoop/nodes.txt xargs -t -I{} -P10 scp -o StrictHostKeyChecking=no /etc/hadoop/conf/mapred-site.xml_worker {}:/tmp/mapred-site.xml
< /home/hadoop/nodes.txt xargs -t -I{} -P10 ssh -o StrictHostKeyChecking=no {} "sudo cp -f /tmp/mapred-site.xml /etc/hadoop/conf/mapred-site.xml"
< /home/hadoop/nodes.txt xargs -t -I{} -P10 scp -o StrictHostKeyChecking=no /etc/hadoop/conf/yarn-site.xml_worker {}:/tmp/yarn-site.xml
< /home/hadoop/nodes.txt xargs -t -I{} -P10 ssh -o StrictHostKeyChecking=no {} "sudo cp -f /tmp/yarn-site.xml /etc/hadoop/conf/yarn-site.xml"
< /home/hadoop/nodes.txt xargs -t -I{} -P10 ssh -o StrictHostKeyChecking=no {} "sudo stop hadoop-yarn-nodemanager"
sleep 2
< /home/hadoop/nodes.txt xargs -t -I{} -P10 ssh -o StrictHostKeyChecking=no {} "sudo start hadoop-yarn-nodemanager"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment