同步rsyncd设置 rsyncd软件包
LAMP 网页镜像同步
原创liming004 博主文章分类:Linux、Windows ©著作权
©著作权归作者所有:来自51CTO博客作者liming004的原创作品,请联系作者获取转载授权,否则将追究法律责任
1. rsyncd配置文件
vi /etc/rsyncd.conf
uid=root
gid=root
use chroot=no
max connections=20
pid file= /var/run/rsyncd.pid
lock file= /var/run/rsyncd.lock
log file= /var/run/rsyncd.log
[web]
path=/var/www/html/bbs/
lgnore errors
read only=yes
hosts allow=169.254.1.0/16
hosts deny = 0.0.0.0/32
2. 启动rsync 守护进程
/usr/bin/rsync --daemon
-----------------------------------------------
mkdir /var/www/html/bbs/
vi /var/www/html/bbs/abc.txt
在本机上测试
rsync -av 169.254.1.233::web /tmp/bbs/ 测试本地同步
在客户机上测试
rsync -av 169.254.1.233::web ./bbs/ 测试非本地同步
--------------------------------------
windows 客户端批处理
2秒中自动同步
@echo off
:1
echo 同步中
rsync -av 169.254.1.233::web \bbs\
ping 127.0 -n 2 >nul 2>nul
goto 1
-----------------------------------------
linux 自动同步
脚本
#!/bin/bash
while true
do
/usr/bin/rsync -av 169.254.1.233::web ./bbs/ >/dev/null 2 >&1
sleep 20
done
--------------------------------------------
rsync -vzrtopg 169.254.1.233::web ./bbs/
参数
-----------------------------------
站点压力测试
安装
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
测试
webbench -c 650 -t 30 http://127.0.0.1/test.php
参数说明: -c 表示并发数 -t 表示时间秒
上一篇:Mysql 主从服务器配置
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
数据同步--rsync
使用rsync进行两台或多台主机直接的数据同步
rsync数据同步