SME OpenStack Private Cloud Deployment "9.3 Master Controller One-way synchronization glance-image directory"

Source: Internet
Author: User
Tags rsync

The use of RYSNC one-way synchronization, without the two sides in real-time synchronization, because in the history of the operation, we found that some of the image is too large, when the main use of the glance to save the image, not 1:30 will save the image, when the main use in the Save, Backup node in real-time synchronization of the normal copy of the state of the incomplete master files, so we will see on the standby node, it deleted the way, it is very loss of the machine's hard disk.  so we used RYSNC one-way synchronization, and when this step was done, I had deployed the cluster before the good. The following example is the office network test environment, for example, the same branch hing, only the IP and host name is different using the root user to run the controller2 process of the source server, Controller1 indirectly uses the root user to synchronize Controller2/home/local/glance/images, pull the file over, and keep the file's properties   2 controller Install software, basic This software is the CentOS release early built-in installedYum install-y rsync*  On the server-side source Controller2,to define a profile rule on the source server Controller2 vi/etc/rsyncd.confuid = rootgid = rootUse chroot = noRead Only = yeshosts allow=10.40.42.0/255.255.255.0hosts deny=*Max connections =  log file =/var/log/rsync.logpid file =/var/run/rsyncd.pid [Glance]Path =/home/local/glance/imagesList=yesIgnore Errorsauth users = rootcomment = This is OPENSTACK-CONTROLLER2-GLANCE-IMAGE-FILE-RYSNC source dataSecrets file =/etc/rsyncd.secrets   Save Exit,Create a password file for client login authentication, service startup, boottouch/etc/rsyncd.secretschmod 600/etc/rsyncd.secretsvi/etc/rsyncd.secretsRoot:myrsynpassSave Exit service startup, bootService RSYNCD Startchkconfig RSYNCD on Check that there is no error log generated. The default is normal as follows 

 On the client controller1,  As mentioned above, the client is equipped with Rsync program, we can not start the client service, directly can use its commandCreate a password file for rsync firsttouch/etc/rsyncd.secretschmod 600/etc/rsyncd.secretsvi/etc/rsyncd.secretsMyrsynpassSave Exit run through the command first to see the effect.  /usr/bin/rsync-rtopglh--progress--delete--bwlimit 90000 [email protected]::glance/home/local/glance/images/-- Password-file=/etc/rsyncd.secrets Command Description-RTOPGLH-R,--recursive subdirectories in recursive mode-T,--times keep file time information-O,--owner keep file owner information-P,--perms maintain file permissions-G,--group keep file group information-L,--links reserved Soft link-H,--hard-links reserved Hard link --progress Show synchronization process--bwlimit 90000 KBPS represents 80mbtye/s, and the split bandwidth is 800Mbps. Since our management port is a 1000M network port, we can choose to reserve 200M bandwidth to communicate with other applications .[Email protected]::glance glance sub-item in source Rsynce--corresponds to the configuration file above/home/local/glance/images/Target Storage directory --password-file password file, do not add, is to lose their own hand password Myrsynpass   to confirm that the command is performing without problems,The next step is to write the shell script on The Controller1 backup client and perform a scheduled incremental backupMkdir/usr/scripttouch/usr/script/rsyncd.shchmod +x/usr/script/rsyncd.sh vi/usr/script/rsyncd.sh rsyncprocess= ' ps aux|grep '/usr/bin/rsync ' |grep-v grep ' if [${#rsyncProcess}-ne 0]  Thenecho $ (date +%y-%m-%d_%h:%m:%s) >>/var/log/rsync.logecho "' Date ' Process is already running!  Do nothing!! " >>/var/log/rsync.log Else/usr/bin/rsync-rtopglh--progress--delete--bwlimit 90000 [email Protected]::glance/home/local/glance/ima ges/--password-file=/etc/rsyncd.secrets 1>>/var/log/rsync.log 2>&1echo $ (date +%y-%m-%d_%h:%m:%s) >>/var/log/rsync.logecho "Process is not running! RUN rsync glance-file successfully ">>/var/log/rsync.logfi  Save ExitI went through the script first./bin/sh/usr/script/rsyncd.sh Check to see if the/var/log/rsync.log output is normal, Normal write timed tasks, synchronized 1 o'clock in the morning dailycrontab-e* 1 * * */bin/sh/usr/script/rsyncd.sh >/dev/null 2>&1

SME OpenStack Private Cloud Deployment "9.3 Master Controller One-way synchronization glance-image directory"

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.