Rsync server construction

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.