Installation configuration for rsync+inotify under Centos 6.3

Source: Internet
Author: User
Tags inotify centos iptables rsync

What is INotify?

INotify is a powerful, fine-grained, asynchronous file system time monitoring mechanism, which can replace Crond with rsync trigger file synchronization, thus monitoring the file system to add, delete, modify, move and other fine-grained events, from Linux 2.6.13, has added support for inotify, so we only need to install a third party software Inotify-tools to manage this service.

Before using the Rsync+crond to trigger the bottleneck of synchronization is that rsync in the synchronization of data, the need to scan all files before the comparison, and then differential transmission, if the number of files is large and changes quickly, scanning all files will be very time-consuming, and there will be leakage synchronization problems, Cause inefficiency.

And Rsync+inotify will make up for the first scan after the synchronization of the efficiency problem, the use of system-level monitoring of various changes, when the file changes, will trigger rsync synchronization, solve the efficiency and real-time problems.

Linux operating system: centOS6.3 64bit

Rsync: System with Self

Inotify-tools:inotify-tools-master

WWW1 (rsync server): 192.168.7.73

WWW2 (rsync client): 192.168.7.74

Topology map:

(server) Represents server-side configuration only

(client) represents only clients configuration

(Server,client) indicates that both the client and the server need to be configured

Environment construction: (server,client)

1. Close Iptables and SELinux

# Service Iptables Stop

# Setenforce 0

# Vi/etc/sysconfig/selinux

---------------

Selinux=disabled

---------------

Determine if the Linux system kernel is up to 2.6.13 or more:

# uname-a

-------------

Linux www1.example.com 2.6.32-279.el6.x86_64 #1 SMP Fri June 12:19:21 UTC-x86_64 x86_64 x86_64 gnu/linux

-------------

To see if the INotify directory exists:

# ls-lsart/proc/sys/fs/inotify/

------------------

Total dosage 0

0 dr-xr-xr-x 0 root root 0 June 4 14:04.

0 dr-xr-xr-x 0 root root 0 June 4 17:35.

0-rw-r--r--1 Root 0 June 4 17:35 max_user_watches

0-rw-r--r--1 Root 0 June 4 17:35 max_user_instances

0-rw-r--r--1 Root 0 June 4 17:35 max_queued_events

------------------

If the above content is returned, the system supports inotify.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.