实验部分
1.安装rsync

2.配置文件


3.配置密码


4.后续

5.为了测试,创建几个文件

配置实时同步
1.调整inotify内核参数



安装inotify-tools

测试同步



编写脚本

验证


重点内容
1、认识
Rsync(remote synchronize)是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件。Rsync使用所谓的“Rsync算法”来使本地和远 程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而不是每次都整份传送,因此速度相当快
Rsync支持大多数的类Unix系统,无论是Linux、Solaris还是BSD上都经过了良好的测试
此外,它在windows平台下也有相应的版本,如cwRsync和Sync2NAS等工具
2、原理
Rsync本来是用于替代rcp的一个工具,目前由rsync.samba.org维护,所以rsync.conf文件的格式类似于samba的主配 置文件;Rsync可以通过rsh或ssh使用,也能以daemon模式去运行
在以daemon方式运行时Rsync server会打开一个873 端口,等待客户端去连接。连接时,Rsync server会检查口令是否相符,若通过口令查核,则可以开始进行文件传输。第一次连通完成时,会把整份文件传输一次,以后则就只需进行增量备份
3、特点
1、可以镜像保存整个目录树和文件系统;
2、可以很容易做到保持原来文件的权限、时间、软硬链接等;
3、无须特殊权限即可安装;
4、优化的流程,文件传输效率高;
5、可以使用rsh、ssh等方式来传输文件,当然也可以通过直接的socket连接;
6、支持匿名传输
课后习题

1.同步源负责提供文档的原始位置,发起端应对该位置具有读取权限
2.a:授权账户,s:存放账户信息的数据文件
3.rsync——daemon
4.采取kill进程的方式
5.用户名@主机地址::共享模块名或者是rsync//用户名@主机地址/共享模块名
6.删除
7.——password—file=/etc/server.pass
8.监控事件队列(16384),最多监控实例数(128),每个实例最多监控文件数(8192)
9.监控和汇总改动情况
10.修改,创建,移动,删除
1.传统代理:需要手动设置代理服务器的地址和端口,才能使用代理来访问网络。
透明代理:不需要指定代理服务器的地址和端口,而是通过默认路由、防火墙策略将Web访问重定向
2.支持透明代理
3.进行控制