[root@backup sersync_installdir_64bit]# tree . └── sersync ├── bin │ └── sersync ├── conf │ └── confxml.xml └── logs
[root@nfs01 sersync_installdir_64bit]# mv sersync/ /usr/local/ [root@nfs01 tools]# tree /usr/local/sersync/ /usr/local/sersync/ ├── bin │ └── sersync ├── conf │ └── confxml.xml └── logs directories, 2 files
[root@backup conf]# ll
total 4
-rw-r--r-- 1 root root 2214 Oct 26 2011 confxml.xml
[root@backup conf]# cp confxml.xml{,.bak}
<filter start="false"> <exclude expression="(.*)\.svn"></exclude> <exclude expression="(.*)\.gz"></exclude> <exclude expression="^info/*"></exclude> <exclude expression="^static/*"></exclude> </filter>
<inotify> <delete start="true"/> <createFolder start="true"/> <createFile start="false"/> <closeWrite start="true"/> <moveFrom start="true"/> <moveTo start="true"/> <attrib start="false"/> <modify start="false"/> </inotify>
<localpath watch="/data"> #监控那个目录 <remote ip="172.16.1.41" name="backup"/> <!--<remote ip="192.168.8.39" name="tongbu"/>--> <!--<remote ip="192.168.8.40" name="tongbu"/>--> </localpath>
<rsync> <commonParams params="-az"/> <auth start="true" users="rsync_backup" passwordfile="/etc/rsync.password"/> <userDefinedPort start="false" port="874"/><!-- port=874 --> <timeout start="false" time="100"/><!-- timeout=100 --> <ssh start="false"/> </rsync>
[root@nfs01 tools]# cat /usr/local/sersync/conf/confxml.xml <?xml version="1.0" encoding="ISO-8859-1"?> <head version="2.5"> <host hostip="localhost" port="8008"></host> <debug start="false"/> <fileSystem xfs="false"/> <filter start="false"> <exclude expression="(.*)\.svn"></exclude> <exclude expression="(.*)\.gz"></exclude> <exclude expression="^info/*"></exclude> <exclude expression="^static/*"></exclude> </filter> <inotify> <delete start="true"/> <createFolder start="true"/> <createFile start="false"/> <closeWrite start="true"/> <moveFrom start="true"/> <moveTo start="true"/> <attrib start="false"/> <modify start="false"/> </inotify> <sersync> <localpath watch="/data"> <remote ip="172.16.1.41" name="nfsbackup"/> <!--<remote ip="192.168.8.39" name="tongbu"/>--> <!--<remote ip="192.168.8.40" name="tongbu"/>--> </localpath> <rsync> <commonParams params="-az"/> <auth start="true" users="rsync_backup" passwordfile="/etc/rsync.password"/> <userDefinedPort start="false" port="874"/><!-- port=874 --> <timeout start="false" time="100"/><!-- timeout=100 --> <ssh start="false"/> </rsync> <failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once--> <crontab start="false" schedule="600"><!--600mins--> <crontabfilter start="false"> <exclude expression="*.php"></exclude> <exclude expression="info/*"></exclude> </crontabfilter> </crontab> <plugin start="false" name="command"/> </sersync> <plugin name="command"> <param prefix="/bin/sh" suffix="" ignoreError="true"/> <!--prefix /opt/tongbu/mmm.sh suffix--> <filter start="false"> <include expression="(.*)\.php"/> <include expression="(.*)\.sh"/> </filter> </plugin> <plugin name="socket"> <localpath watch="/opt/tongbu"> <deshost ip="192.168.138.20" port="8009"/> </localpath> </plugin> <plugin name="refreshCDN"> <localpath watch="/data0/htdocs/cms.xoyo.com/site/"> <cdninfo domainname="ccms.chinacache.com" port="80" username="xxxx" passwd="xxxx"/> <sendurl base="http://pic.xoyo.com/cms"/> <regexurl regex="false" match="cms.xoyo.com/site([/a-zA-Z0-9]*).xoyo.com/images"/> </localpath> </plugin> </head>
[root@nfs01 bin]# chmod a+x sersync [root@nfs01 bin]# ll total 1768 -rwxr-xr-x 1 root root 1810128 Oct 26 2011 sersync
[root@nfs01 bin]# ./sersync -h set the system param execute:echo 50000000 > /proc/sys/fs/inotify/max_user_watches execute:echo 327679 > /proc/sys/fs/inotify/max_queued_events parse the command param _______________________________________________________ 重要参数-d:启用守护进程模式 重要参数-r:在监控前,将监控目录与远程主机用rsync命令推送一遍 参数-n: 指定开启守护线程的数量,默认为10个 重要参数-o:指定配置文件,默认使用confxml.xml文件 参数-m:单独启用其他模块,使用 -m refreshCDN 开启刷新CDN模块 参数-m:单独启用其他模块,使用 -m socket 开启socket模块 参数-m:单独启用其他模块,使用 -m http 开启http模块 不加-m参数,则默认执行同步程序 ________________________________________________________________
./sersync -dro /usr/local/sersync/conf/confxml.xml
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/sersync/bin/
[root@nfs01 scripts]# sersync -dro /usr/local/sersync/conf/confxml.xml set the system param execute:echo 50000000 > /proc/sys/fs/inotify/max_user_watches execute:echo 327679 > /proc/sys/fs/inotify/max_queued_events parse the command param option: -d run as a daemon option: -r rsync all the local files to the remote servers before the sersync work option: -o config xml name: /usr/local/sersync/conf/confxml.xml daemon thread num: 10 parse xml config file host ip : localhost host port: 8008 daemon start,sersync run behind the console use rsync password-file : user is rsync_backup passwordfile is /etc/rsync.password config xml parse success please set /etc/rsyncd.conf max connections=0 Manually sersync working thread 12 = 1(primary thread) + 1(fail retry thread) + 10(daemon sub threads) Max threads numbers is: 22 = 12(Thread pool nums) + 10(Sub threads) please according your cpu ,use -n param to adjust the cpu rate ------------------------------------------ rsync the directory recursivly to the remote servers once working please wait... execute command: cd /data && rsync -az -R --delete ./ rsync_backup@172.16.1.41::nfsbackup --password-file=/etc/rsync.password >/dev/null 2>&1 run the sersync: watch path is: /data
[root@nfs01 ~]# man man The standard sections of the manual include: User Commands #用户命令 System Calls #系统调用 C Library Functions # Ç库函数 Devices and Special Files #设备和特殊文件 File Formats and Conventions #文件格式和约定 Games et. Al. #游戏等。 Miscellanea #杂记 System Administration tools and Daemons #系统管理工具和程序 Distributions customize the manual section to their specifics, which often include additional sections.
[root@clsn tuichu]# man ~ Executable programs or shell commands System calls (functions provided by the kernel) Library calls (functions within program libraries) Special files (usually found in /dev) File formats and conventions eg /etc/passwd Games Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) System administration commands (usually only for root) Kernel routines [Non standard]
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有