In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the example analysis of Rsync services in Linux, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
Rsync is a data mirroring backup tool in Linux system. Through rsync, local system data can be backed up to any remote host through the network. Rysnc can not only synchronize files and directories in different locations, but also calculate differences and compress transfer files to minimize data transfer.
Rsync features support copying special files, such as linked files, devices, and so on. Can maintain the permissions of the original file, time, belonging to the main group, soft links, hard links and other attributes are not changed (the same as the original). It has the function of excluding specified file or directory synchronization, which is equivalent to the exclusion function of the packaging command tar. Incremental synchronization can be achieved, that is, only the changed data can be synchronized, and the transmission efficiency is very high (tar-N can achieve incremental synchronization). You can use methods such as rcp,rsh,ssh to transfer files (rsync itself does not encrypt the data). Files and data (server and client) can be transferred through socket (process mode) to support anonymous or authenticated (without system users) process mode transfer, which can achieve secure and convenient data backup and mirroring. Common parameter option description parameter description-v,-verbose detailed mode output, progress during transfer and other information-r,-recursive gives recursive mode to subdirectories, that is, all directories under the directory also transfer-a,-archive archive mode, indicating that files are transferred recursively and all file attributes are maintained, which is equal to-rtopgD-z,-compress and compressed to improve transmission efficiency. -t,-times keep file time information-o,-owner keep file owner information-p,-perms keep file permissions-g,-group keep file group information-P,-progress show synchronization process and progress during transfer and other information-Dmam times keep device file information-l keep soft connection-e-rsh=COMMAND specifies the shell program that replaces rsh
Show details
System version
Three uses: server hostname backup client hostname oldboy local mode: we backup / etc/hosts to the / mnt directory without any parameters, so the properties will be different
Using files sent from the client using the rsync command through the remote shell, the comparison properties are the same as the client
Insert a picture here to describe the third way separately, which involves the configuration of the server-side daemon.
1. Does the server have rsync? if not, install rpm-qa rsync2. Users who add rsync services and manage local directories linux all files or directories have a corresponding user to execute adduser-s / sbin/nologin-M rsync-s to specify the shell used by the user to log in. Here, select nologin, that is, virtual users, and do not allow login to the command line. -M does not create a user's home directory, linux creation users will create a home directory by default. Id rsync3. Generate rsyncd.conf configuration file, the specific role can be man rsyncd.conf to view this file does not exist by default, we need to create our direct vi / etc/rsyncd.conf4. Generate the password file echo 'rsync_backup:123456' > / etc/rsync.passwordcat / etc/rsync.password5 according to rsyncd.conf 's auth user configuration account and the secrets file parameter. It's no fun to configure permissions for password files so that everyone can't see them. Chmod 600 / etc/rsync.passwordls-l / etc/rsync.password6. Create a shared directory and authorize the rsync service to manage mkdir / backupchown-R rsync.rsync / backup7. Start the rsync service and check rsync-daemonps-ef | grep' rsync' | grep-v 'grep'lsof-I: 873 (rsync defaults to port 873) 8. Join the boot echo "/ usr/bin/rsync-daemon" > > / etc/rc.localtail-l / etc/rc.local server and end here
The client only needs to generate the password file needed to connect to the server to continue to configure permissions 600 for the password file.
Back up in the third way
Create 100 files in the client / backup touch stu {001... Use the rsync command to backup to the server / backup directory rsync-avz / backup/ rsync_backup@172.16.1.41::backup/-password-file=/etc/rsync.passwordrsync-avz command plus attribute / backup to back up the contents of this directory, including the directory As long as the contents in the directory are added to the auth users@172.16.1.41 specified server in the / (/ backup/) rsync_backup configuration file:: after the module name in the fixed format backup/ configuration file is specified to use the password file in the client side, this kind of problem may occur: the server firewall is not turned off, resulting in the client connection can not be connected, telnet check the reason to turn off the server firewall / etc/init.d/iptables stop
The above is all the content of the article "sample Analysis of Rsync Services in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.