国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務(wù)器 > Web服務(wù)器 > 正文

Linux下rsync遠(yuǎn)程數(shù)據(jù)同步命令的詳細(xì)介紹

2024-09-01 13:50:44
字體:
供稿:網(wǎng)友

介紹

rsync命令是一個遠(yuǎn)程數(shù)據(jù)同步工具,可通過LAN/WAN快速同步多臺主機間的文件。rsync使用所謂的“rsync算法”來使本地和遠(yuǎn)程兩個主機之間的文件達(dá)到同步,這個算法只傳送兩個文件的不同部分,而不是每次都整份傳送,因此速度相當(dāng)快。 rsync是一個功能非常強大的工具,其命令也有很多功能特色選項,我們下面就對它的選項一一進行分析說明。

常用場景

無密碼同步

服務(wù)端:vim /etc/rsyncd.conf

#This is the rsync daemon configuration #global settings pid file = /var/run/rsyncd.pidport = 873lock file = /var/run/rsyncd.locklog file = /var/log/rsync.loggid = rootuid = root#module settings [share_data]path = /web/rsync/share_datause chroot = nomax connections = 15read only = yeswrite only = nolist = noignore errors = yestimeout = 120
/usr/bin/rsync --daemonmkdir -p /web/rsync/share_data

客戶端

rsync -avz --progress root@192.168.1.98::share_data /home/hadoop/share_data

限制流量同步

rsync -avz --bwlimit=50 --progress root@192.168.1.98::share_data /home/hadoop/share_data

有密碼同步

服務(wù)端 

vim /etc/rsyncd.conf

#This is the rsync daemon configuration #global settings pid file = /var/run/rsyncd.pidport = 873lock file = /var/run/rsyncd.locklog file = /var/log/rsync.loggid = rootuid = root#module settings [auth_data]path = /web/rsync/auth_datause chroot = nomax connections = 15read only = yeswrite only = nolist = noignore errors = yestimeout = 120auth users = hadoopsecrets file = /etc/rsyncd.passwd
echo "hadoop:password123" > /etc/rsyncd.passwd chmod 600 /etc/rsyncd.passwdmkdir -p /web/rsync/auth_data

客戶端

echo "password123" > /home/hadoop/rsyncd.passwd chmod 600 /home/hadoop/rsyncd.passwd rsync -avz --progress --password-file=/home/hadoop/rsyncd.passwd hadoop@192.168.1.98::auth_data /home/hadoop/auth_data

或者是

export RSYNC_PASSWORD="password123"rsync -avz --progress hadoop@192.168.1.98::auth_data /home/hadoop/auth_data

寫入同步

服務(wù)端

vim /etc/rsyncd.conf

#global settings pid file = /var/run/rsyncd.pidport = 873lock file = /var/run/rsyncd.locklog file = /var/log/rsync.loggid = rootuid = root#module settings [write_data]path = /web/rsync/write_datause chroot = nomax connections = 15read only = nolist = noignore errors = yestimeout = 120auth users = hadoopsecrets file = /etc/rsyncd.passwd
mkdir -p /web/rsync/write_data

客戶端

echo "123" > /home/hadoop/write_fileexport RSYNC_PASSWORD="password123"rsync -avz --progress --delete /home/hadoop/write_file hadoop@192.168.1.98::write_data 

限定IP或者網(wǎng)段

#global settings pid file = /var/run/rsyncd.pidport = 873lock file = /var/run/rsyncd.locklog file = /var/log/rsync.loggid = rootuid = root#module settings [write_data]path = /web/rsync/write_datause chroot = nomax connections = 15read only = nolist = noignore errors = yestimeout = 120auth users = hadoopsecrets file = /etc/rsyncd.passwdhosts allow = 192.168.2.32 192.168.1.0/24

客戶端 https://download.samba.org/pub/rsync/rsync.html

服務(wù)端 https://download.samba.org/pub/rsync/rsyncd.conf.html 

總結(jié)

以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。謝謝大家對VEVB武林網(wǎng)的支持。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 永清县| 房产| 类乌齐县| 墨竹工卡县| 海门市| 马山县| 嘉善县| 肇州县| 绥阳县| 虹口区| 曲阜市| 句容市| 普陀区| 巫山县| 丹凤县| 乌鲁木齐县| 大理市| 新疆| 尉犁县| 海安县| 将乐县| 商都县| 洮南市| 浦北县| 黑河市| 仙居县| 北宁市| 石阡县| 新巴尔虎右旗| 伽师县| 天门市| 郸城县| 鸡泽县| 南通市| 普陀区| 青冈县| 平顺县| 左贡县| 云南省| 宜春市| 遂溪县|