centos 通过rsync实现远程文件同步
来源:互联网 发布:如何淘宝知识产权投诉 编辑:程序博客网 时间:2024/06/05 01:14
首先准备两台centos服务器分别是服务器A和服务器B,最终实现效果是将A服务器的文件同步到服务器B上。
开始安装
下面是两台服务器共同的操作
首先打开防火墙的873端口,或直接关闭防火前:service iptables stop
安装rsync工具
yum install rsync
配置/etc/rsyncd.conf文件文件内容如下:(注意点:hosts allow: 192.168.1.2 这个ip要生成当前主机的真实ip)
- # /etc/rsyncd: configuration file for rsync daemon mode
- # See rsyncd.conf man page for more options.
- # configuration example:
- uid = 0
- gid = 0
- #use chroot = yes
- #list = yes
- #address = 192.161.1.1
- max connections = 10
- pid file = /var/run/rsyncd.pid
- log file = /var/log/rsyncd.log
- # exclude = lost+found/
- # transfer logging = yes
- # timeout = 900
- # ignore nonreadable = yes
- # dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
- [data]
- path=/www/data/
- transfer logging = yes
- ignore errors
- read only = no
- list = no
- hosts allow = 192.168.1.1,192.168.1.2
- auth users = test
- secrets file = /etc/rsync.password
- # [ftp]
- # path = /home/ftp
- # comment = ftp export area
启动rsync服务
rsync --daemon
查看服务是否启动,rsync的默认端口是873
netstat -lnt
首先我们来设置好服务器B:
这里是创建rsync的password文件,内容为用户名:密码,为了安全起见,同时更改下文件权限:
跟着我们来设置好服务器A:
这里仅仅只需要密码,不需要用户了,免得要同步时还要手动互动
阅读全文
0 0
- centos 通过rsync实现远程文件同步
- rsync 通过密码文件实现远程同步
- rsync远程文件同步
- rsync 远程同步文件
- Centos 7.0 通过rsync和inotify实现实时同步
- Centos 7.0 通过rsync和inotify实现实时同步
- Linux Rsync 远程文件同步
- rsync 实现文件同步
- rsync实现文件同步
- rsync实现文件同步
- rsync实现文件同步
- rsync实现文件同步
- CentOS rsync文件同步配置
- CentOS 6 rsync 文件同步
- linux中部署rsync实现文件远程备份及同步
- CentOS 6.5下Rsync远程同步
- centos搭建rsync远程同步服务器
- Centos 7系统rsync远程同步
- 查长时间运行事务
- JS中decodeURI()与decodeURIComponent()区别
- noteBook2.17-C#基础第十七天
- vxworks中断处理程序不能使用printf的本质
- Android与服务器通过Servlet进行双向通信
- centos 通过rsync实现远程文件同步
- python 3.X版本 利用urllib.request 通过制定的URL抓取网易内容
- codeblocks运行时提示Can't find compiler executabl...
- 字符集与编码
- 文章标题
- 最新版Oracle数据库的PLSQL安装链接服务器
- Error:Execution failed for task transformClassesWithDexForDebug
- TypeScript 学习笔记:属性索引器
- ios10 禁止用户缩放失效