Rsync server setup this solution uses the client to actively synchronize servers. server configuration: 1. create the mkdir/etc/rsyncdtouch/etc/rsyncd directory. conftouch/etc/rsyncd. secretschmod600/etc/rsyncd. s...
Rsync server construction
This solution uses the client to actively synchronize servers
Server configuration:
1. create a directory
Mkdir/etc/rsyncd
Touch/etc/rsyncd. conf
Touch/etc/rsyncd. secrets
Chmod 600/etc/rsyncd. secrets
2. specify the directory to be backed up
3. modify the configuration file
Pid file =/var/run/rsyncd. pid
Log file =/var/log/rsyncd. log
Read only = no
Max connections = 50
Use chroot = yes
[Mysql]
Hosts allow = 192.168.0.0/24 10.13.2.0/24 210.51.19.0/24 220.181.67.0/24
Path =/data/mysql // directory to be backed up
Uid = root
Gid = root
Secrets file =/etc/rsyncd. secrets
Read only = no
[Www]
Hosts allow = 192.168.0.0/24 10.13.2.0/24 210.51.19.0/24 220.181.67.0/24
Path =/data/www/
Uid = root
Gid = root
Secrets file =/etc/rsyncd. secrets
Read only = no
4. change the password file
Vim/etc/rsyncd. secrets
Mysql: 123.com
Www: 123.com
5. start The rsync daemon mode.
/Usr/bin/rsync -- daemon -- config =/etc/rsyncd. conf
6. Open Firewall Port 873
Iptables-a input-p tcp-m state -- state NEW-m tcp -- dport 873-j ACCEPT
Client settings
1. add a password file
Cd/root/
Vim rsyncd. secrets
Only enter the 123.com password.
2. synchronize data
/Usr/bin/rsync-vzrtopg -- password-file =/root/rsyncd. secrets root@192.168.0.10: mysql/data/mysql/
3. verify data
4. add a scheduled task
Crontab-e
This article is from the "ShareDream" blog