1. 程式人生 > >用rsync同步本地DNS和Hadoop給Datanode主機

用rsync同步本地DNS和Hadoop給Datanode主機

Hadoop

#!/bin/bash
function rr(){
rsync -aSH --delete -e ‘ssh‘ /usr/local/hadoop/etc/hadoop $1:/usr/local/hadoop/etc/
rsync -a --delete -e ‘ssh‘ /etc/hosts $1:/etc/hosts
}
if (( $# == 0 ));then
echo "用法:$0 host1 host2 host3 ...."
else
for ((i=1;i<=$#;i++));
do
rr ${!i}

用rsync同步本地DNS和Hadoop給Datanode主機