当前位置:网站首页>Lsyncd real time synchronization
Lsyncd real time synchronization
2022-07-24 15:37:00 【Brother Xing plays with the clouds】
1、 describe ,, Lsyncd+ssh
Open source lsyncd use inotify Principle monitor a directory , If there is a change in the directory , utilize rsync Automatic protocol synchronization The server , therefore lsyncd It is a lightweight real-time image solution .
Fine grained customization can be achieved through configuration files , Configuration files can be written lua Code , It's easy , Powerful and flexible configuration .
2、 Open source software
rely on lua Environmental Science :
#wget https://lsyncd.googlecode.com/files/lsyncd-2.1.5.tar.gz #yum install lua lua-static lua-devel #tar -xzvf lsyncd-2.1.5.tar.gz #cd lsyncd-2.1.5 #./configure #make #make install #whereis lsyncd lsyncd: /usr/local/bin/lsyncd
Create a directory of configuration files :
#mkdir /etc/lsyncd #cd /etc/lsyncd #vim lsyncd.lua -- Be careful :lua Rules of grammar
File configuration syntax settings{ logfile = "/var/log/lsyncd.log", # Log path statusFile = "/var/log/lsyncd-status.log", # Status file pidfile = "/var/run/lsyncd.pid", #pid File path statusInterval = 1, # Minimum write time of status file nodaemon = false, #daemon function maxProcesses = 4, # The biggest process maxDelays = 1 # Maximum delay }
## many host Sync servers = { "192.168.0.10", "192.168.0.20" } ## The synchronization rules for _, server in ipairs(servers) do ## iteration servers sync{ default.rsyncssh, ## Default rsync+ssh,rsync The version needs to be upgraded 3 Above version source = "/test1", # Source directory delete = true, host = server, targetdir = "/test1", # Target directory exclude={ ".txt" # exclude }, rsync = { binary = "/usr/bin/rsync", archive = true, # file compress = false, # Compress owner = true, # Belong to perms = true, # jurisdiction whole_file = false }, ssh = { port = 22 } } end
start-up lsyncd service :
#lsyncd /etc/lsyncd/lsyncd.lua #ps -ef | grep lsyncd lsyncd lsyncd.lua
Be careful : The server Configuration is required between ssh Password-free login
边栏推荐
- 图的存储和遍历
- Discussion on the basic use and address of pointer in array object
- kubernetes GPU的困境和破局
- 请问好的券商的排名?网上开户安全吗
- 2022 robocom world robot developer competition - undergraduate group (provincial competition) CAIP full version solution
- Analysys analysis "2022 China data security market data monitoring report" was officially launched
- Introduction to single chip microcomputer: LED bidirectional water lamp
- What is the ranking of good securities companies? Is online account opening safe
- 2022 RoboCom 世界机器人开发者大赛-本科组(省赛)-- 第二题 智能服药助手 (已完结)
- Yolo5face: why reinvent the face detector
猜你喜欢

How to deal with being attacked? Advanced anti DDoS IP protection strategy

From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?

Automatic derivation of pytorch

Istio1.12: installation and quick start

【Flutter -- 布局】流式布局(Flow和Wrap)

Research on stability of time-delay systems based on Lambert function

C - partial keyword

报错【项目报错】

简化理解:发布订阅

celery 启动beat出现报错ERROR: Pidfile (celerybeat.pid) already exists.
随机推荐
【机器学习基础】——另一个视角解释SVM
How to deal with being attacked? Advanced anti DDoS IP protection strategy
3、 Set foundation ArrayList set and simple student management system
Nine key measures to maintain server security in Hong Kong
2022 RoboCom 世界机器人开发者大赛-本科组(省赛)-- 第五题 树与二分图 (已完结)
MySQL learning notes (summary)
Istio1.12:安装和快速入门
Error reporting [project error reporting]
Outlook tutorial, how to set rules in outlook?
微调LayoutLM v3进行票据数据的处理和内容识别
Cloud development standalone image Jiugongge traffic main source code
sklearn.metrics模块模型评价函数
24.原生磁盘的使用
[tkinter beautification] window out of system style (common to three systems)
iptables常用命令小清单
15. Talk about these common multi-threaded interview questions
26.文件使用磁盘的代码实现
力扣 31.下一个排列--双指针法
C # exit login if there is no operation
C. Recover an RBS