Rsync installation and configuration
Backups will be sent to the second server and stored there. So we need 2 working and configured CentOS 8 servers. Cloud Servers Intel Xeon Gold 3. You also need to create the user that was specified in the configuration and file with credentials. The following command will start the backup. Replace source-server-ip with the source server's IP address. Let's check if the necessary Rsync packages are installed and install them if not.
Start the Rsync daemon and enable its automatic starting. Check if auto start is enabled and working. Check if the Rsync service is listening on the network port.
Open the configuration file:. Rsync is a tool used to replace RCP. This algorithm only transmits different parts of the two files, not the whole file every time, so it is very fast.
You can refer to how Rsync works a practical overview to further understand the operation mechanism of Rsync. In addition, it also has corresponding versions under the windows platform, and the well-known ones are cwrsync and sync2nas.
Of course, you can also connect directly through socket;. Regardless of the local synchronization directory or remote synchronization data, all files will be copied once in the first run, and only the changed files for the new files or the changed parts of the files for the original files will be copied in the future run.
Rsync has no speed advantage during the first replication and is not as fast as tar. Therefore, when the amount of data is large, you can consider using tar for the first replication and then Rsync for data synchronization.
CentOS runs the Rsync service in xinetd mode by default. To configure the Rsync service running with xinetd, execute the following command:. For example, you can modify the configuration line. Of course, you can also write a script to automatically start the rysnc service at startup. The configuration file rsyncd. To put all files related to Rsync service in a separate directory, execute the following command:.
The syntax of the configuration file is:. All configuration lines except [module] in the file are global parameters. Of course, you can also define module parameters in the global parameters section. At this time, the value of this parameter is the default value of all modules.
Module parameters are mainly used to define which directory of Rsync server should be synchronized. The format of module declaration must be in the form of [module]. This name is the name seen in Rsync client, similar to the share name provided by Samba server. The data actually synchronized by the server is specified through path.
You can specify multiple modules according to your needs. The following parameters can be defined in the module:. A module can only specify one exclude parameter and one include parameter. These parameters are equivalent to the corresponding Rsync client command options.
The only difference is that they act on the server side. The permission of Rsync authentication password file must be , otherwise the client will not be able to connect to the server.
Each line in the Rsync authentication password file specifies a user name: password pair in the format:. Solution: it is possible that the other party is not powered on, blocked by firewall, and blocked by firewall on the network. Solution: open port of the server rh-firewallinput is the chain name of rehl 5, and 10 is the last default rule reject therefore.
Modify these two parameters according to the actual situation. Note: the last rule reject all — anywhere Anywhere reject with ICMP host prohibited means to reject all packets and respond to ICMP host — prohibited packets to the other party.
The client still cannot perform rysnc backup. If I is used, it will be inserted to the front of the chain and can perform rysnc backup normally after testing. Solution: This is because the permission of rsyncd. For example: Chmod rsyncd. Solution: This is because the password is set incorrectly and the login cannot succeed. Check rsync. This can also happen if the Rsync service is not started on the server side.
Solution: This is because the path you set in rsync. You need to create a new directory to start synchronization. Just change it to No.
0コメント