Chinaunix首页 | 论坛 | 博客
  • 博客访问: 333561
  • 博文数量: 68
  • 博客积分: 405
  • 博客等级: 一等列兵
  • 技术积分: 1288
  • 用 户 组: 普通用户
  • 注册时间: 2013-01-09 15:39
个人简介

本人从事 Linux Nginx Mysql PHP 开发多年,联系v:luhuang2003 ,希望接触到更新的web开发软件,开此博客希望能把自己的经验和接触的东西与大家进行共享。

文章分类

全部博文(68)

文章存档

2024年(1)

2013年(67)

我的朋友

分类: LINUX

2013-01-14 10:25:55

2台机器环境 Centos 系统
1、2台机器IP    先关闭2台机器的防火墙: /etc/init.d/iptables stop
10.207.26.240  #客户机
10.207.26.241  #服务器端

以下在 10.207.26.241  服务器端 操作
2、安装 软件包 rsync
yum install rsync
或者
从原始网站下载:
[root@localhost bin]#./configure
[root@localhost bin]#make
[root@localhost bin]#make install

3、服务器端机器 10.207.26.241 新建 文件 /etc/rsyncd.conf 添加以下内容
#########[global]  全局配置
uid = root
gid = root
use chroot = no
max connections = 30
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300

[web]
read only = no
path = /www
comment = root
auth users = root
secrets file = /etc/rsync.pas

#注释: web 是客户机链接的模块名称,你可以配置多个 链接到不同的模块
#path 就是 要把文件同步到哪个目录上
#/etc/rsync.pas  客户机链接的账号密码


4、新建文件 /etc/rsync.pas
添加以下内容, 是客户机链接的账号密码:
root:xsw21234

5、修改 权限
chmod 600 /etc/rsync.pas


6、启动服务器端程序
rsync --daemon

7、查看服务器端是否启动成功
lsof -i:873
如图:




以下是10.207.26.240 客户机上操作配置
先关闭机器的防火墙:  /etc/init.d/iptables stop

1、安装rsync 软件
yum install rsync -y

2、新建目录 /www

3、在目录下/www 创建  index.php

4、创建文件
/etc/rsyncd.secrets
添加以下内容, 文件内容要和服务器端的配置密码一致:
123

5、同步文件 index.php 到 10.207.26.241
rsync -vzrtopg --delete /www/ root@10.207.26.241::web --password-file=/etc/rsyncd.secrets

如图:

操作成功。
阅读(1817) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~