linux开启 Sersync 守护进程进行数据同步
a、配置 Sersync 环境变量
[root@SERSYNC sersync]# echo 'export PATH=$PATH:/usr/local/sersync/bin'>>/etc/profile
[root@SERSYNC sersync]# tail -1 /etc/profile export PATH=$PATH:/usr/local/sersync/bin [root@SERSYNC sersync]# . /etc/profile [root@SERSYNC sersync]# which sersync
启动的过程及结果:
注意:我们这里要启动的是多实例,即 confxml.xml 和 download_confxml.xml
[root@SERSYNC ~]# ls /usr/local/sersync/conf/*
/usr/local/sersync/conf/confxml.xml
/usr/local/sersync/conf/confxml.xml.bak.2014-06-04
/usr/local/sersync/conf/download_confxml.xml
[root@SERSYNC ~]# sersync -r -d -o /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: -r rsync all the local files to the remote servers before the sersync work
option: -d run as a daemon
option: -o config xml name: /usr/local/sersync/conf/confxml.xml
daemon thread num: 10
parse xml config file
host ip : localhosthost port: 8008
daemon start,sersync run behind the console
use
rsync password-file :
user isrsync_bak
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
thr eads)
Max threads numbers is: 32 = 12(Thread pool nums) + 20(Sub threads)
chmod: cannot access `/usr/local/logs/rsync_fail_log.sh': No such file or
directory
------------------------------------------
rsync
the directory recursivly to the remote servers once
working please wait...
execute command: cd /data/web &&
rsync -aruz -R --delete ./ --timeout=100 rsync_bak
@172.16.100.1::web --password-file=/etc/rsync.password >/dev/null 2>&1
run the sersync:
watch path is: /data/web
[root@SERSYNC ~]# sersync -r -d -o /usr/local/sersync/conf/download_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: -r rsync all the local files to the remote servers before the sersync work
option: -d run as a daemon
option: -o config xml name: /usr/local/sersync/conf/download_confxml.xml
daemon thread num: 10
parse xml config file
host ip : localhosthost port: 8008
daemon start,sersync run behind the console
use rsync password-file :
user isrsync_bak
passwordfile is /etc/rsync.password config xml parse success
please set /etc/rsyncd.conf max connections=0 Manually
eads)
Max threads numbers is: 32 = 12(Thread pool nums) + 20(Sub threads)
please according
your cpu ,use -n param to
adjust the cpu rate
chmod: cannot access `/usr/local/logs/rsync_fail_log.sh': No such file or
directory
------------------------------------------
rsync the directory recursivly to the remote servers once
working please wait...
execute command: cd /data/download && rsync -aruz -R --delete ./ --timeout=100 rsync
_bak@172.16.100.1::download --password-file=/etc/rsync.password >/dev/null 2>&1
run the sersync:
watch path is: /data/download
b、开启后查看进程
[root@SERSYNC ~]# ps -ef |grep sersync
root 2114 1 0 01:56 ? 00:00:00 sersync -r -d -o
/usr/local/sersync/conf/confxml.
xml
root 2223 1 0 02:03 ? 00:00:00 sersync -r -d -o
/usr/local/sersync/conf/downloa
d_confxml.xml
root 2295 2244 0 02:08 pts/2 00:00:00 grep sersync
C、配置开机自启动
[root@SERSYNC ~]# cp /etc/rc.local /etc/rc.local.bak._$(date +%F)
[root@SERSYNC ~]# cat >>/etc/rc.local<< 'EOF'
> # sync data to 172.16.100.1,172.16.100.2
> sersync -d -o
/usr/local/sersync/conf/confxml.xml
> sersync -d -o
/usr/local/sersync/conf/download_confxml.xml
> EOF
linux开启 Sersync 守护进程进行数据同步的更多相关文章
- rsync 守护进程及实时同步
目录 rsync 守护进程及实时同步 rsync简介 rsync特性 rsync应用场景 cp命令 scp命令 rsync的传输方式 rsync的传输模式 rsync实际使用 rsync命令 案例 r ...
- Linux实战教学笔记21:Rsync数据同步工具
第二十一节 Rsync数据同步工具 标签(空格分隔): Linux实战教学笔记-陈思齐 ---本教学笔记是本人学习和工作生涯中的摘记整理而成,此为初稿(尚有诸多不完善之处),为原创作品,允许转载,转载 ...
- Linux学习之守护进程详解
Linux系统守护进程详解 ---转自:http://yuanbin.blog ...
- Linux架构--------Rsync守护进程推和拉
一.Rsync基本概述 rsync是一款开源.快速.多功能.可实现全量及增量的本地或远程数据同步备份的优秀工具.rsync软件适用于Unix/linux/Windows等多种操作系统平台. 二.Rsy ...
- linux下daemon守护进程的实现(以nginx代码为例)
ngx_int_t ngx_daemon(ngx_log_t *log) { int fd; // 让init进程成为新产生进程的父进程: // 调用fork函数创建子进程后,使父进程立即退出.这样, ...
- rsync (windows 服务端,linux客户端)将windows上的数据同步到linux服务器,反之也可
一:总体概述. 1.windows上面首先装CW_rsync_Server.4.1.0_installer,安装时要输入的用户名密码要记住哦!接下来就是找到rsyncd.conf进入配置细节 2.li ...
- linux系统编程--守护进程,会话,进程组,终端
终端: 在UNIX系统中,用户通过终端登录系统后得到一个Shell进程,这个终端成为Shell进程的控制终端(Controlling Terminal), 进程中,控制终端是保存在PCB中的信息,而f ...
- Linux 中的 守护进程
什么是守护进程 脱离控制终端的,运行于后端的进程,由系统管理的,按计划自动启动/停止/重启,用以执行特定的任务. 为什么要有守护进程? 在某些需求场景下,我们希望某项系统任务能够按计划按预期,始终/自 ...
- linux下的守护进程daemon
什么是守护进程?其实感觉守护进程并没有什么明确的定义,只是守护进程有一些特征,这是它需要遵循的. 守护进程的第一个特征是长时间在后台运行的程序,并且主要是为了提供某种服务,而为了能够让服务尽可能随时都 ...
随机推荐
- [CSP-S模拟测试]:小P的2048(模拟)
题目描述 最近,小$P$迷上了一款叫做$2048$的游戏.这块游戏在一个$n\times n$的棋盘中进行,棋盘的每个格子中可能有一个形如$2^k(k\in N^*)$的数,也可能是空的.游戏规则介绍 ...
- 大数据笔记(三)——Hadoop2.0的安装与配置
一.Hadoop安装部署的预备条件 准备:1.安装Linux和JDK. 安装JDK 解压:tar -zxvf jdk-8u144-linux-x64.tar.gz -C ~/training/ 设置环 ...
- Qt 之 ZIP开源库 QuaZIP
2013-10-31 21:46 10856人阅读 评论(0) 收藏 举报 分类: Qt(12) 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[+] 一.简介 ...
- Linux内核调试方法总结之死锁问题分析
死锁问题分析 死锁就是多个进程(线程)因为等待别的进程已占有的自己所需要的资源而陷入阻塞的一种状态,死锁状态一旦形成,进程本身是解决不了的,需要外在的推动,才能解决,最重要的是死锁不仅仅影响进程业务, ...
- 协议:FTP
ylbtech-协议:FTP FTP(File Transfer Protocol,文件传输协议) 是 TCP/IP 协议组中的协议之一.FTP协议包括两个组成部分,其一为FTP服务器,其二为FTP客 ...
- unigui 服务器 是否显示 程序窗口
unigui 服务器 是否显示 程序窗口 servermodule 窗体的这个standaloneserver属性 为false 时 显示窗体. 为true 时 不显示窗体. 哈哈
- LeetCode 94. Binary Tree Inorder Traversal 动态演示
非递归的中序遍历,要用到一个stack class Solution { public: vector<int> inorderTraversal(TreeNode* root) { ve ...
- 应用安全-CTF-格式串漏洞
主要影响c库中print家族函数 - > printf,sprintf,fprintf等 利用: SIP请求URI中格式串
- IDEA-包层级结构显示(三)
IntelliJ IDEA包层级结构显示 如:A.B.C,在项目中希望以如下形式显示: A B C 效果: 再更换为A.B.C形式显示
- python列表-增强的赋值操作
增强赋值公式 (1) (2) (3) (4)