For the rsync used therein, see: basic use of rsync
#!/bin/bash#Rsyncs HBase files across all slaves. Must run on master. assumes#All files is located in/usr/localif["$#"!="2" ]; Then Echo"Usage: $ (basename $) <dir-name> <ln-name>"Echo"Example: $ (basename $) hbase-0.1 hbase"Exit1fi Src_path="/usr/local/$1/conf/regionservers" forSrvinch$ (cat$SRC _path); DoEcho"sending command to $srv ..."; #–v represents complex output information;-A represents the permission save mode, which is equivalent to the-rlptgod parameter. Very fast saves almost all permission settings except for hard connections;-Z for Compression
-vaz--exclude= ' logs/* '/usr/local/$$srv:/usr/local/$srv"rm-fr /usr/local/$2; Ln-s/usr/local/$1/usr/local/$2""done. "
The same function, the following simple
# !/bin/bash # Rsync ' s HBase config files across all region servers. Must run on master. for srv in $ (cat/usr/local/hbase/conf/ Regionservers); do echo " sending command to $srv ... "
# $srv:/usr/local/hadoop/$srv:/usr/local/hbase/" Done. "
HBase configuration files from master to slave synchronization