1 環境準備
1.1 修改host 主機名,加入hosts解析
# hostnamectl set-hostname es1
# cat >> /etc/hosts << EOF
192.168.234.160 es1
EOF
1.2 關閉防火牆
# systemctl stop firewalld
# systemctl disable firewalld
1.3 禁用selinux
# sed -ri 's#(SELINUX=)enforcing#\1disabled#' /etc/selinux/config
# grep ^SELINUX= /etc/selinux/config
# setenforce 0
1.4 配置免密登入
# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa -q
# for ((i=160;i<=162;i++));do ssh-copy-id 192.168.234.${i};done
1.5 安裝資料同步工具rsync
# yum install rsync -y
資料同步指令碼