Four ways to implement web data synchronization =========================================== ======== nfs enables web data sharing rsync + inotify for web data synchronization rsync + sersync faster and more resource-saving implementation of web data synchronization unison + inotify for two-way web data synchronization = ============================================================ 1. nfs achieve web Data Sharing & n
Four ways to implement web data synchronization
========================================================
Nfs for web data sharing
Rsync + inotify for web data synchronization
Rsync + sersync faster and more resource-saving for web data synchronization
Unison + inotify achieve two-way web data synchronization
========================================================
I. nfs for web data sharing
12345678910111213 |
[root@jie1 ~] # vim /etc/httpd/conf/httpd.conf ######################################## ServerName 172.16.22.1:80 #DocumentRoot "/var/www/html"
ServerName www.jie.com
DocumentRoot /web/htdocs < /VirtualHost > ####################################### [root@jie1 ~] # mkdir -pv /web/htdocs [root@jie1 ~] # Cd/web/htdocs # No webpage files on the server [root@jie1 ~] # ls [root@jie1 ~] # |
3) rsync service configuration
* ***** Create The rsync configuration file and password file ************
Touch/etc/rsyncd. conf (rsync configuration file)
Touch/etc/rsyncd. pwd (user's password file)
Chmod 600/etc/rsyncd. pwd (the permission must be set to 600; otherwise, the backup will fail)
1234567891011121314151617181920212223242526272829303132 |
[root@jie1 ~] # vim /etc/rsyncd.conf ############vim /etc/rsyncd.conf######################################## uid = nobody # Id of the backup, user ID gid = nobody # ID of the backup group use chroot = no # Banned from the source directory max connections = 3 # Maximum number of connections. 0 indicates no limit strict modes = yes # Check the permissions of the password file pid file = /var/run/rsyncd .pid # Pid file of the running process log file = /var/log/rsyncd .log # Log file [htdocs] # Specify the name of the authenticated backup module path = /web/htdocs # Path of the directory to be backed up ignore errors = yes # Ignore irrelevant IO errors read only = no # If it is set to no, it can be passed to the corresponding directory on the server. write only = no # Set to no, indicating that the client can download files hosts allow = 172.16.22.3 # IP address of the host that can connect to the rsync server hosts deny = * # Set the host address to prohibit the connection to the rsync server. * indicates that all requests except those defined by hosts allow are rejected. uid = root gid = root auth users = backuper # User name of the connection module secrets file = /etc/rsyncd . pwd # Path for storing the password file of the connection module User name ##################################################################### [root@jie1 ~] # Vim/etc/rsyncd. pwd # user's password file ##################################################################### backuper:pwd123 # Username: password ##################################################################### [root@jie1 ~] # Chmod 600/etc/rsyncd. pwd # grant permissions to 600 [root@jie1 ~] # chkconfig rsync on [root@jie1 ~] # chkconfig xinetd on [root@jie1 ~] |