Skip to content

Instantly share code, notes, and snippets.

@sujee
Created March 8, 2012 01:33
Show Gist options
  • Save sujee/1997870 to your computer and use it in GitHub Desktop.
Save sujee/1997870 to your computer and use it in GitHub Desktop.
hadoop-dns : modify /etc/hosts
#!/bin/bash
hosts=$(cat $HADOOP_HOME/conf/slaves | grep -v '#')
for host in $hosts
do
echo "------------------" $host "------------"
scp -o StrictHostKeyChecking=no hadoop_hosts $host:
ssh -o StrictHostKeyChecking=no root@$host "cat /etc/hosts.orig hadoop_hosts >> /etc/hosts"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment