Use Rsync for Centos 6.3 installation and configuration

Source: Internet
Author: User
Tags centos iptables rsync

Rsync has the following advantages:

1. Images can be used to save the entire directory tree and file system.

2. You can easily maintain the permission, time, and soft link of the original file.

3. Installation without the authorization of the special envoy.

4. Optimized processes and high file transmission efficiency.

5. You can use Rsh, SSH, and other methods to transmit files. Of course, you can also directly connect to files through Socket.

6. Anonymous transmission is supported.

In addition, compared with SCP, the transmission speed is not hierarchical. We often use Rsync and SCP to transmit a large amount of Mysql data in the LAN, and found that Rsync is at least 20 times faster than Scp. Therefore, if you need to transmit massive data between Linux/Unix servers, rsync is a good choice.

My installation environment is Centos 6.2, and the IP address of the Rsync server (192.168.1.220) client (192.168.1.210)

 

1. Install Rsync server

[Root @ chenyi1 Packages] # yum install rsync
1 [root @ chenyi1 Packages] # yum install rsync
Note: disable iptables and SELINUX here (you do not need to disable iptables here, because iptables is useful in this article)

[Root @ chenyi1 Packages] # service iptables stop

[Root @ chenyi1 Packages] # chkconfig iptables off

[Root @ chenyi1 Packages] # setenforce 0


2. Create The Rsync configuration file

[Root @ chenyi1 Packages] # vi/etc/rsyncd. conf # This file does not exist by default. The name format can be created by yourself

[Root @ chenyi1 Packages] # cat/etc/rsyncd. conf
1 [root @ chenyi1 Packages] # cat/etc/rsyncd. conf
Uid = nobody # indicates the backup user. The nobody is any user.

Max connections = 200 # indicates the maximum number of connections

Pid file =/var/run/rsyncd. pid # tell the process to write to the/var/run/rsyncd. pid file.

Lock file =/var/run/rsyncd. lock # specifies the location where the lock file is stored.

Motd file =/etc/rsyncd. motd # indicates the prompt displayed after the client connects to the Rsync server.

Log file =/var/log/rsyncd. log # refers to the location where log files are stored.

 

[Backup] # the default group name is the same as the Samba configuration syntax and is the name published to the outside world.

Path =/home/itchenyi # directory involved in synchronization

Ignore errors # ignore irrelevant I/O errors

Read only = no # Allow read and write

List = no # column list not allowed

Hosts allow = 192.168.1.0/255.255.255.0 # similar to the Samba syntax, it indicates that only the network segments of 192.168.1.0/24> are allowed to be synchronized and others are rejected.

Auth users = itchenyi, chenyi

Secrets file =/etc/rsyncd. password # file for storing user passwords

Next, we need to manually create two files, rsyncd. password, rsyncd. motd, and the/home/itchenyi synchronization directory.

[Root @ chenyi1 Packages] # touch/etc/rsyncd. password
[Root @ chenyi1 Packages] # chmod 600/etc/rsyncd. password
[Root @ chenyi1 Packages] # echo 'www .111cn.net '>

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.