rsync nfs 实时同步,实战

一、部署rsync服务端(backup)

1)安装rsync

  1. [root@backup ~]# yum install -y rsync

2)配置rsync

  1. [root@backup ~]# vim /etc/rsyncd.conf
  2. uid = www
  3. gid = www
  4. port = 873
  5. fake super = yes
  6. use chroot = no
  7. max connections = 200
  8. timeout = 600
  9. ignore errors
  10. read only = false
  11. list = false
  12. auth users = rsync_backup
  13. secrets file = /etc/rsync.passwd
  14. log file = /var/log/rsyncd.log
  15. #####################################
  16. [backup]
  17. comment = welcome to oldboyedu backup!
  18. path = /backup
  19. [nfs]
  20. comment = welcome to oldboyedu backup!
  21. path = /data

3)创建系统用户(www),为了和web nfs统一

  1. [root@backup ~]# groupadd www -g 666
  2. [root@backup ~]# useradd www -u 666 -g 666 -s /sbin/nologin -M

4)创建虚拟的认证用户和密码文件并授权

  1. [root@backup ~]# echo 'rsync_backup:123' > /etc/rsync.passwd
  2. [root@backup ~]# chmod 600 /etc/rsync.passwd

5)创建目录

  1. [root@backup ~]# mkdir /backup /data
  2. [root@backup ~]# chown -R www.www /backup/ /data/
  3. #检查
  4. [root@backup ~]# ll -d /backup/ /data/
  5. drwxr-xr-x 2 www www 6 Aug 7 16:56 /backup/
  6. drwxr-xr-x 2 www www 6 Aug 7 16:56 /data/

6)启动rsync服务并加入开机自启

  1. [root@backup ~]# systemctl start rsyncd
  2. [root@backup ~]# systemctl enable rsyncd

二、部署rsync客户端(nfs,web01)

1)安装rsync

  1. [root@nfs ~]# yum install -y rsync
  2. [root@web01 ~]# yum install -y rsync

2)免密码方式

  1. #方式一:
  2. [root@nfs ~]# echo '123' > /etc/rsync.pass
  3. [root@nfs ~]# chmod 600 /etc/rsync.pass
  4. [root@web01 ~]# echo '123' > /etc/rsync.pass
  5. [root@web01 ~]# chmod 600 /etc/rsync.pass
  6. [root@nfs ~]# rsync -avz /etc/passwd rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.pass
  7. #方式二(推荐):
  8. [root@nfs ~]# export RSYNC_PASSWORD=123
  9. [root@web01 ~]# export RSYNC_PASSWORD=123
  10. [root@nfs ~]# rsync -avz /etc/passwd rsync_backup@172.16.1.41::backup

三、部署web代码(web01)

1)安装httpd和php

  1. [root@web01 ~]# yum install -y httpd php

2)创建用户

  1. [root@web01 ~]# groupadd www -g 666
  2. [root@web01 ~]# useradd www -u 666 -g 666 -s /sbin/nologin -M
  3. 创建目录
  4. [root@web01 ~]# mkdir /data
  5. [root@web01 ~]# chown -R www.www /data/

3)修改配置文件

  1. [root@web01 ~]# vim /etc/httpd/conf/httpd.conf
  2. User www
  3. Group www

4)启动httpd并加入开机自启

  1. [root@web01 ~]# systemctl start httpd
  2. [root@web01 ~]# systemctl enable httpd
  3. #检查
  4. [root@web01 ~]# netstat -lntup|grep 80
  5. tcp6 0 0 :::80 :::* LISTEN 10427/httpd
  6. #检查启动用户
  7. [root@web01 ~]# ps -ef|grep httpd
  8. root 10427 1 0 17:09 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
  9. www 10428 10427 0 17:10 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
  10. www 10429 10427 0 17:10 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
  11. www 10430 10427 0 17:10 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
  12. www 10431 10427 0 17:10 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
  13. www 10432 10427 0 17:10 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND

5)部署代码,将代码上传至httpd的站点目录

  1. #查找站点目录
  2. [root@web01 ~]# rpm -ql httpd|grep html
  3. /var/www/html
  4. #进入站点目录,上传代码
  5. [root@web01 ~]# cd /var/www/html/
  6. [root@web01 html]# rz windows-提交作业代码.zip
  7. #安装unzip
  8. [root@web01 html]# yum install -y unzip
  9. #解压代码
  10. [root@web01 html]# unzip windows-提交作业代码.zip
  11. Archive: windows-提交作业代码.zip
  12. inflating: 1.png
  13. inflating: 2.png
  14. inflating: 3.png
  15. inflating: bg.jpg
  16. inflating: index.html
  17. inflating: info.php
  18. inflating: upload_file.php
  19. #授权
  20. [root@web01 html]# chown -R www.www /var/www/html/
  21. #修改用户上传文件的目录
  22. [root@web01 html]# vim upload_file.php
  23. $wen="/var/www/html/upload";

打开浏览器访问:提交作业

四、NFS服务端部署(nfs)

1)安装nfs和rpcbind

  1. [root@nfs ~]# yum install -y nfs-utils rpcbind

2)配置nfs

  1. [root@nfs ~]# vim /etc/exports
  2. /data 172.16.1.0/24(rw,sync,all_squash,anonuid=666,anongid=666)

3)创建www用户(uid和gid是666的用户)

  1. [root@nfs ~]# groupadd www -g 666
  2. [root@nfs ~]# useradd www -u 666 -g 666 -s /sbin/nologin -M

4)创建共享目录/data并授权

  1. [root@nfs ~]# mkdir /data
  2. [root@nfs ~]# chown -R www.www /data/

5)启动服务并加入开机自启

  1. [root@nfs ~]# systemctl start rpcbind nfs-server
  2. [root@nfs ~]# systemctl enable rpcbind nfs-server

6)检查nfs

  1. #检查文件
  2. [root@nfs ~]# cat /var/lib/nfs/etab
  3. /data 172.16.1.0/24(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=666,anongid=666,sec=sys,rw,secure,root_squash,all_squash)
  4. #检查端口
  5. [root@nfs ~]# netstat -lntup|grep 111
  6. tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
  7. tcp6 0 0 :::111 :::* LISTEN 1/systemd
  8. udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
  9. udp6 0 0 :::111 :::* 1/systemd
  10. #检查进程
  11. [root@nfs ~]# ps -ef|grep -E '(nfs|rpcbind)'
  12. rpc 8081 1 0 17:27 ? 00:00:00 /sbin/rpcbind -w
  13. root 8140 2 0 17:27 ? 00:00:00 [nfsd4_callbacks]
  14. root 8146 2 0 17:27 ? 00:00:00 [nfsd]
  15. root 8147 2 0 17:27 ? 00:00:00 [nfsd]
  16. root 8148 2 0 17:27 ? 00:00:00 [nfsd]
  17. root 8149 2 0 17:27 ? 00:00:00 [nfsd]
  18. root 8150 2 0 17:27 ? 00:00:00 [nfsd]
  19. root 8151 2 0 17:27 ? 00:00:00 [nfsd]
  20. root 8152 2 0 17:27 ? 00:00:00 [nfsd]
  21. root 8153 2 0 17:27 ? 00:00:00 [nfsd]

五、部署nfs备胎服务端(nfs)

1)安装nfs和rpcbind

  1. [root@nfs ~]# yum install -y nfs-utils rpcbind

2)配置nfs

  1. [root@nfs ~]# vim /etc/exports
  2. /data 172.16.1.0/24(rw,sync,all_squash,anonuid=666,anongid=666)

3)启动服务并加入开机自启

  1. [root@nfs ~]# systemctl start rpcbind nfs-server
  2. [root@nfs ~]# systemctl enable rpcbind nfs-server

4)检查nfs

  1. #检查文件
  2. [root@nfs ~]# cat /var/lib/nfs/etab
  3. /data 172.16.1.0/24(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=666,anongid=666,sec=sys,rw,secure,root_squash,all_squash)
  4. #检查端口
  5. [root@nfs ~]# netstat -lntup|grep 111
  6. tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
  7. tcp6 0 0 :::111 :::* LISTEN 1/systemd
  8. udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
  9. udp6 0 0 :::111 :::* 1/systemd
  10. #检查进程
  11. [root@nfs ~]# ps -ef|grep -E '(nfs|rpcbind)'
  12. rpc 8081 1 0 17:27 ? 00:00:00 /sbin/rpcbind -w
  13. root 8140 2 0 17:27 ? 00:00:00 [nfsd4_callbacks]
  14. root 8146 2 0 17:27 ? 00:00:00 [nfsd]
  15. root 8147 2 0 17:27 ? 00:00:00 [nfsd]
  16. root 8148 2 0 17:27 ? 00:00:00 [nfsd]
  17. root 8149 2 0 17:27 ? 00:00:00 [nfsd]
  18. root 8150 2 0 17:27 ? 00:00:00 [nfsd]
  19. root 8151 2 0 17:27 ? 00:00:00 [nfsd]
  20. root 8152 2 0 17:27 ? 00:00:00 [nfsd]
  21. root 8153 2 0 17:27 ? 00:00:00 [nfsd]

六、部署nfs的客户端web01(web01)

1)安装nfs和rpcbind

  1. [root@web01 ~]# yum install -y nfs-utils rpcbind

2)只启动rpcbind

  1. [root@web01 ~]# systemctl start rpcbind
  2. [root@web01 ~]# systemctl enable rpcbind

3)查看可挂载点

  1. [root@web01 ~]# showmount -e 172.16.1.31
  2. Export list for 172.16.1.31:
  3. /data 172.16.1.0/24
  4. [root@web01 ~]# showmount -e 172.16.1.41
  5. Export list for 172.16.1.41:
  6. /data 172.16.1.0/24

4)挂载前,要保证数据一致

  1. [root@web01 ~]# scp -r /var/www/html/upload/ 172.16.1.31:/data (输入的是root的密码)
  2. [root@nfs ~]# chown -R www.www /data/

5)挂载nfs的服务端

  1. [root@web01 ~]# mount -t nfs 172.16.1.31:/data /var/www/html/upload

七、backup实时同步nfs的data目录

编辑脚本

  1. [root@nfs ~]# vim rsync.sh
  2. #!/bin/bash
  3. PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin'
  4. H=`hostname`
  5. I=`ifconfig eth1|awk 'NR==2{print $2}'`
  6. D=`date +%F`
  7. S=${H}_${I}_${D}
  8. BD=/backup
  9. export RSYNC_PASSWORD=123
  10. mkdir -p ${BD}/${S}
  11. tar zcf /backup/${S}/conf.tar.gz /etc/passwd &>/dev/null
  12. md5sum /backup/${S}/conf.tar.gz > /backup/res1.txt
  13. find ${BD} -type d -mtime +7|xargs rm -fr
  14. ~
  15. [root@web01 ~]# vim rsync.sh
  16. #!/bin/bash
  17. PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin'
  18. H=`hostname`
  19. I=`ifconfig eth1|awk 'NR==2{print $2}'`
  20. D=`date +%F`
  21. S=${H}_${I}_${D}
  22. BD=/backup
  23. export RSYNC_PASSWORD=123
  24. mkdir -p ${BD}/${S}
  25. tar zcf /backup/${S}/conf.tar.gz /etc/passwd &>/dev/null
  26. md5sum /backup/${S}/conf.tar.gz > /backup/res2.txt
  27. find ${BD} -type d -mtime +7|xargs rm -fr

八、定时任务并发邮件

1.服务端部署rsync,用于接收客户端推送过来的备份数据

2.服务端需要每天校验客户端推送过来的数据是否完整

3.服务端需要每天校验的结果通知给管理员

  1. [root@backup ~]# yum install -y mailx
  2. #安装mailx
  3. yum install -y mailx
  4. #配置mail.rc
  5. vim /etc/mail.rc
  6. Shift + g
  7. set from=861962063@qq.com
  8. set smtp=smtps://smtp.qq.com:465
  9. set smtp-auth-user=861962063@qq.com
  10. set smtp-auth-passwordyfwapjxcfwnobfhh
  11. set smtp-auth=login
  12. set ssl-verify=ignore
  13. set nss-config-dir=/etc/pki/nssdb/

4.服务端仅保留6个月的备份数据,其余的全部删除 check_md5.sh

  1. [root@backup ~]# vim check_md5.sh
  2. #!/bin/bash
  3. PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin'
  4. H=`hostname`
  5. I=`ifconfig eth1|awk 'NR==2{print $2}'`
  6. D=`date +%F`
  7. S=${H}_${I}_${D}
  8. BD=/backup
  9. md5sum -c /backup/res*.txt|mail -s "${D}:校验结果" 861962063@qq.com
  10. find ${BD} -type d -mtime +180|xargs rm -fr
  11. ~

编写定时任务:crontab -e

  1. [root@backup ~]# crontab -l
  2. #校验结果 by:gjy at:20190807
  3. 01 00 * * * /bin/sh /root/check_md5.sh &>/dev/null

编辑定时任务

  1. [root@web01 ~]# crontab -e
  2. #每天凌晨备份重要数据 By:gjy At:2019-08-07
  3. 00 00* * * /bin/sh /root/rsync.sh &>/dev/null

执行脚本

九、NFS服务端部署sersync实时同步(nfs)

1)安装sersync需要依赖rsyncinotify

  1. [root@nfs ~]# yum install -y rsync inotify-tools

2)下载sersync

  1. [root@nfs ~]# wget https://raw.githubusercontent.com/wsgzao/sersync/master/sersync2.5.4_64bit_binary_stable_final.tar.gz

3)部署sersync

​ 源码包:解压 生成 编译 安装

​ 解压:

  1. [root@nfs ~]# tar xf sersync2.5.4_64bit_binary_stable_final.tar.gz

4)移动并改名

  1. [root@nfs ~]# mv GNU-Linux-x86 /usr/local/sersync

5)编辑配置文件

  1. [root@nfs ~]# vim /usr/local/sersync/confxml.xml
  2. <inotify>
  3. <delete start="true"/>
  4. <createFolder start="true"/>
  5. <createFile start="true"/>
  6. <closeWrite start="true"/>
  7. <moveFrom start="true"/>
  8. <moveTo start="true"/>
  9. <attrib start="true"/>
  10. <modify start="true"/>
  11. </inotify>
  12. -----------------------------------------------------------------------------------------
  13. <sersync>
  14. #监控的目录,改成/data
  15. <localpath watch="/opt/tongbu">
  16. #推送的IP(backup服务的IP)172.16.1.41 ,name是模块名
  17. <remote ip="127.0.0.1" name="tongbu1"/>
  18. <!--<remote ip="192.168.8.39" name="tongbu"/>-->
  19. <!--<remote ip="192.168.8.40" name="tongbu"/>-->
  20. </localpath>
  21. <rsync>
  22. #执行rsync的参数改成 -az
  23. <commonParams params="-artuz"/>
  24. #虚拟用户的用户名和密码文件,开启认证start=true rsync_backup /etc/rsync.pass
  25. <auth start="false" users="root" passwordfile="/etc/rsync.pas"/>
  26. <userDefinedPort start="false" port="874"/><!-- port=874 -->
  27. #设置超时时间
  28. <timeout start="true" time="100"/><!-- timeout=100 -->
  29. <ssh start="false"/>
  30. </rsync>
  31. <failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once-->
  32. <crontab start="false" schedule="600"><!--600mins-->
  33. <crontabfilter start="false">
  34. <exclude expression="*.php"></exclude>
  35. <exclude expression="info/*"></exclude>
  36. </crontabfilter>
  37. </crontab>
  38. <plugin start="false" name="command"/>
  39. </sersync>
  40. #完整配置文件
  41. [root@nfs ~]# cat /usr/local/sersync/confxml.xml
  42. <?xml version="1.0" encoding="ISO-8859-1"?>
  43. <head version="2.5">
  44. <host hostip="localhost" port="8008"></host>
  45. <debug start="false"/>
  46. <fileSystem xfs="false"/>
  47. <filter start="false">
  48. <exclude expression="(.*)\.svn"></exclude>
  49. <exclude expression="(.*)\.gz"></exclude>
  50. <exclude expression="^info/*"></exclude>
  51. <exclude expression="^static/*"></exclude>
  52. </filter>
  53. <inotify>
  54. <delete start="true"/>
  55. <createFolder start="true"/>
  56. <createFile start="true"/>
  57. <closeWrite start="true"/>
  58. <moveFrom start="true"/>
  59. <moveTo start="true"/>
  60. <attrib start="true"/>
  61. <modify start="true"/>
  62. </inotify>
  63. <sersync>
  64. <localpath watch="/data">
  65. <remote ip="172.16.1.41" name="nfs"/>
  66. <!--<remote ip="192.168.8.39" name="tongbu"/>-->
  67. <!--<remote ip="192.168.8.40" name="tongbu"/>-->
  68. </localpath>
  69. <rsync>
  70. <commonParams params="-az"/>
  71. <auth start="true" users="rsync_backup" passwordfile="/etc/rsync.pass"/>
  72. <userDefinedPort start="false" port="874"/><!-- port=874 -->
  73. <timeout start="true" time="100"/><!-- timeout=100 -->
  74. <ssh start="false"/>
  75. </rsync>
  76. <failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once-->
  77. <crontab start="false" schedule="600"><!--600mins-->
  78. <crontabfilter start="false">
  79. <exclude expression="*.php"></exclude>
  80. <exclude expression="info/*"></exclude>
  81. </crontabfilter>
  82. </crontab>
  83. <plugin start="false" name="command"/>
  84. </sersync>
  85. <plugin name="command">
  86. <param prefix="/bin/sh" suffix="" ignoreError="true"/> <!--prefix /opt/tongbu/mmm.sh suffix-->
  87. <filter start="false">
  88. <include expression="(.*)\.php"/>
  89. <include expression="(.*)\.sh"/>
  90. </filter>
  91. </plugin>
  92. <plugin name="socket">
  93. <localpath watch="/opt/tongbu">
  94. <deshost ip="192.168.138.20" port="8009"/>
  95. </localpath>
  96. </plugin>
  97. <plugin name="refreshCDN">
  98. <localpath watch="/data0/htdocs/cms.xoyo.com/site/">
  99. <cdninfo domainname="ccms.chinacache.com" port="80" username="xxxx" passwd="xxxx"/>
  100. <sendurl base="http://pic.xoyo.com/cms"/>
  101. <regexurl regex="false" match="cms.xoyo.com/site([/a-zA-Z0-9]*).xoyo.com/images"/>
  102. </localpath>
  103. </plugin>
  104. </head>

6)创建虚拟用户的密码文件,并授权

  1. [root@nfs sersync]# echo '123' > /etc/rsync.pass
  2. [root@nfs sersync]# chmod 600 /etc/rsync.pass

7)查看帮助

  1. [root@nfs sersync]# /usr/local/sersync/sersync2 -h
  2. set the system param
  3. executeecho 50000000 > /proc/sys/fs/inotify/max_user_watches
  4. executeecho 327679 > /proc/sys/fs/inotify/max_queued_events
  5. parse the command param
  6. _______________________________________________________
  7. 参数-d:启用守护进程模式
  8. 参数-r:在监控前,将监控目录与远程主机用rsync命令推送一遍
  9. c参数-n: 指定开启守护线程的数量,默认为10
  10. 参数-o:指定配置文件,默认使用confxml.xml文件
  11. 参数-m:单独启用其他模块,使用 -m refreshCDN 开启刷新CDN模块
  12. 参数-m:单独启用其他模块,使用 -m socket 开启socket模块
  13. 参数-m:单独启用其他模块,使用 -m http 开启http模块
  14. 不加-m参数,则默认执行同步程序
  15. ________________________________________________________________

8)启动sersync

  1. [root@nfs data]# /usr/local/sersync/sersync2 -rdo /usr/local/sersync/confxml.xml

十、切换备胎backup(web01)

单点故障

1)编写脚本

  1. [root@web01 ~]# vim nfs.sh
  2. #!/bin/bash
  3. check_nfs=`df -h|grep '/var/www/html/upload'|wc -l`
  4. if [ $check_nfs -eq 0 ];then
  5. showmount -e 172.16.1.31 &>/dev/null
  6. if [ $? -eq 0 ];then
  7. mount -t nfs 172.16.1.31:/data /var/www/html/upload
  8. else
  9. mount -t nfs 172.16.1.41:/data /var/www/html/upload
  10. fi
  11. fi

2). 查询当前挂载

  1. [root@web01 ~]# df -h
  2. Filesystem Size Used Avail Use% Mounted on
  3. /dev/sda3 19G 1.4G 18G 8% /
  4. devtmpfs 476M 0 476M 0% /dev
  5. tmpfs 487M 0 487M 0% /dev/shm
  6. tmpfs 487M 7.7M 479M 2% /run
  7. tmpfs 487M 0 487M 0% /sys/fs/cgroup
  8. /dev/sda1 497M 120M 378M 25% /boot
  9. tmpfs 98M 0 98M 0% /run/user/0
  10. 172.16.1.31:/data 19G 1.4G 18G 8% /var/www/html/upload

3)先卸载当前挂载

  1. [root@web01 ~]# umount /var/www/html/upload

4)关闭172.16.31 的nfs-server服务

  1. [root@nfs data]# systemctl stop nfs-server

5)开启172.16.41 的nfs-server服务

  1. [root@backup ~]# systemctl start nfs-server

6)执行脚本并查看挂载

  1. [root@web01 ~]# df -h
  2. Filesystem Size Used Avail Use% Mounted on
  3. /dev/sda3 19G 1.4G 18G 8% /
  4. devtmpfs 476M 0 476M 0% /dev
  5. tmpfs 487M 0 487M 0% /dev/shm
  6. tmpfs 487M 7.7M 479M 2% /run
  7. tmpfs 487M 0 487M 0% /sys/fs/cgroup
  8. /dev/sda1 497M 120M 378M 25% /boot
  9. tmpfs 98M 0 98M 0% /run/user/0
  10. 172.16.1.41:/data 19G 1.4G 18G 8% /var/www/html/upload

rsync nfs 实时同步,结合实战的更多相关文章

  1. 实时同步sersync实战

    目录 实时同步sersync实战 什么是实时同步 sersync和rsync+inotify对比 sersync项目实战 安装rsync的服务端(backup) NFS服务端部署sersync 实时同 ...

  2. rsync+inotify实时同步环境部署记录

    随着应用系统规模的不断扩大,对数据的安全性和可靠性也提出的更好的要求,rsync在高端业务系统中也逐渐暴露出了很多不足.首先,rsync在同步数据时,需要扫描所有文件后进行比对,进行差量传输.如果文件 ...

  3. rsync+inotify实时同步方案

    rsync+inotify实时同步,inotify可以实时监控本地文件或目录变化,当检测到本地文件变化,执行rsync同步命令,将变化的文件同步到其他服务器节点. 1.配置环境 3.在服务节点1.服务 ...

  4. CentOS6.5实现rsync+inotify实时同步

    参考博文: 参考1:CentOS6.5实现rsync+inotify实时同步 参考2:inotify-tools+rsync实时同步文件安装和配置 CentOS 6.3下rsync服务器的安装与配置  ...

  5. Rsync同步、Rsync+Lsync实时同步

    Rsync同步.Rsync+Lsync实时同步 原创博文http://www.cnblogs.com/elvi/p/7658049.html #!/bin/sh #Myde by Elven @ #c ...

  6. 配置rsync+inotify实时同步

    与上一篇同步做 配置rsync+inotify实时同步 1:调整inotify内核参数 在linux内核中,默认的inotify机制提供三个调控参数:max_queue_events.max_user ...

  7. Rsync + sersync 实时同步备份

    一      Rsync + Sersync  实时同步介绍 1.Rsync 服务搭建介绍 云机上搭建Rsync server,在本地搭建Rsync Clinet. 2. Sersync 服务搭建介绍 ...

  8. 【转】inotify+rsync实现实时同步

    [转]inotify+rsync实现实时同步 1.1 什么是实时同步:如何实现实时同步 要利用监控服务(inotify),监控同步数据服务器目录中信息的变化 发现目录中数据产生变化,就利用rsync服 ...

  9. (转)rsync+inotify实时同步

    原文:http://lxw66.blog.51cto.com/5547576/1331048 声明:rsync inotify 需要逆向思考,当只做rsync不实时同步时,我们一般是从rsync服务端 ...

随机推荐

  1. TCP为什么会采用三次握手,若采用二次握手可以吗?

    建立连接的过程是利用C/S(客户机/服务器)模式,假设A为客户端,B为服务器端. TCP是采用三次握手进行连接的,简要说明该过程: (1) A向B发送连接请求 (2) B对收的的A的报文段进行确认 ( ...

  2. 【LeetCode】几何学 geometry(共2题)

    [587]Erect the Fence [892]Surface Area of 3D Shapes

  3. Flutter-AppBar

    1.1 简介 AppBar “应用栏” 应用栏由工具栏组成,或者是工具栏和其他 widget 组合形成,例如 TabBar和FlexibleSpaceBar; 应用栏通常用于 Scaffold.app ...

  4. 注意!黑客可以通过CSS3功能攻击浏览器

    随着通过HTML5和CSS3引入的惊人数量的功能,浏览器的攻击面也相应增长.因此,这些功能之间的交互可能会导致意外行为影响用户的安全,这并不奇怪.在这篇文章中,中国知名黑客安全组织东方联盟描述了这样一 ...

  5. Java管道流学习

    管道流 作用:用于线程之间的数据通信 管道流测试:一个线程写入,一个线程读取 import java.io.IOException; import java.io.PipedInputStream; ...

  6. wxpython总体

    人到夏天就特别懒 from math import * import wx def sin_fun(event): a=text_angle.GetValue() b=sin(radians(floa ...

  7. spring-boot整合Mybatis多数据源案例

    1.运行环境 开发工具:intellij idea JDK版本:1.8 项目管理工具:Maven 4.0.0 2.GITHUB地址 https://github.com/nbfujx/springBo ...

  8. 使用CSS在页面中嵌入字体

    http://jingyan.baidu.com/article/3065b3b6e9b2d9becff8a4c1.html 首先感谢css9.net照抄原话: 字体使用是网页设计中不可或缺的一部分. ...

  9. operator函数操作符

    函数操作数() 可以实现将对象当函数使用. class Square{ public: double operator()(double x)const{return x*x;} };

  10. delphi 异形窗体可半透明

    unit xDrawForm; interface uses Windows, Messages, SysUtils, Classes, Controls, Forms, Menus, Graphic ...