安装MySQL
参考脚本:CentOS6.5一键安装MySQL5.5.32(源码编译)
在备份服务器上配置rsync推送任务
在备份服务器上配置 /etc/rsyncd.conf
#在所有的客户端都配置密码
#客户端的配置为 echo "oldboy" > /etc/rsync.password
#客户端先测试推送是否成功:rsync -avzP a.log rsync_backup@192.168.1.30::www/ --password-file=/etc/rsync.password
具体内容参考脚本:rsync.sh
#rsync #echo "oldboy123" >/etc/rsync.password #chmod 600 /etc/rsync.password cat >>/etc/rsyncd.conf<<EOF #Rsync server #created by oldboy 15:01 2009-6-5 ##rsyncd.conf start## uid = root gid = root use chroot = no max connections = 2000 timeout = 600 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log ignore errors read only = false list = false hosts allow = 192.168.1.0/24 hosts deny = 0.0.0.0/32 auth users = rsync_backup secrets file = /etc/rsync.password ##################################### #服务端备份的目录 [www] comment = www by old0boy 14:18 2012-1-13 path = /data0/www/www/ ##################################### [bbs] comment = bbs by old0boy 14:18 2012-1-13 path = /data0/www/bbs/ ##################################### [blog] comment = blog by old0boy 14:18 2012-1-13 path = /data0/www/blog/ EOF #在所有的客户端都配置密码 #客户端的配置为 echo "oldboy" > /etc/rsync.password #客户端先测试推送是否成功:rsync -avzP a.log rsync_backup@192.168.1.29::www/ --password-file=/etc/rsync.password echo "rsync_backup:oldboy" >/etc/rsync.password chmod 600 /etc/rsync.password #写入开机自启动 rsync --daemon echo "/usr/bin/rsync --daemon" >>/etc/rc.local mkdir -p /data0/www/bbs/ /data0/www/www/ /data0/www/blog/
NFS(兼职分发)服务器上配置
生成ssh-key,利用expect软件分发到服务器上。
在分发客户端的家目录下 创建密钥:
ssh-keygen -t dsa
全部回车
tree .ssh
ssh-copy-id 只能copy公钥
ssh-copy-id -i .ssh/id_rsa.pub "-p 22 root@192.168.1.27"
需要输入密码后,就能分发公钥了
现在采用expect来批量分发
yum install expect -y
通过在expect的配置文件中fenfa_sshkey.exp配置分发内容,然后通过脚本调用来为不同的服务器分发执行脚本。
验证ssh root@192.168.1.27 /sbin/ifconfig eth0 查看ip