This document is a trove image of the manual authoring mysql5.5
OpenStack version is Newton
1. Create the underlying virtual machine
Login OpenStack to create a virtual machine, this virtual machine is used to make trove image, the root disk of the virtual machine will eventually be uploaded to the glance for trove use, the root disk capacity of the virtual machine is set according to the needs, here to skip the detailed operation of this step.
The following actions are logged on to this virtual machine
2. Configure SSH
Cat/etc/ssh/sshd_configusedns No
3. Add MySQL Source
Yum Install Http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpmyum Remove Mariadb-libs
4. Edit/etc/yum.repos.d/mysql-community.repo disable mysql5.7, enable mysql5.5
# Enable to use MySQL 5.5[mysql55-community]name=mysql 5.5 community serverbaseurl=http://repo.mysql.com/yum/ mysql-5.5-community/el/7/$basearch/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql[ Mysql57-community]name=mysql 5.7 Community serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$ Basearch/enabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql
5, Installation mysql5.5
Yum Install Mysql-community-server
6. Configure MySQL
6.1, edit/etc/my.cnf, add the following line at the end of the file, include this line has a row of blank
...! includedir/etc/mysql/conf.d/
6.2 Creating a Directory
Mkdir-p/etc/mysql/conf.d/
7, Installation Percona-xtrabackup
Innobackupexyum Install https://www.percona.com/redir/downloads/percona-release/redhat/ Percona-release-0.1-4.noarch.rpmyum Install percona-xtrabackup-24
8. Source code Installation Trove-agent
8.1. Install related software packages
Yum Install git python-virtualenv
8.2. Create user
Useradd-m trove# Set trove sudocat/etc/sudoers.d/trove defaults:trove!requirettytrove all= (All) NOPASSWD:ALL
8.3. Download trove Source code
Su-trovegit Clone Https://github.com/openstack/trove.git
8.4. Integration Code
Since the backup on CentOS, there is bug:1649592, has been integrated into the master branch, need to integrate the commit into the Stable/newton branch
Commit c1fd3e3a4c643dba524656c8d53d3506233beaf3merge:880c707 f5d1caeauthor:jenkins <[email protected]>Date: Thu Jan 16:07:48 +0000 Merge "Fix backup of MySQL variants on Centos" ... commit f5d1caea889f85196dfc1efe4892560f 0b145191author:doug Shelley <[email protected]> 2016-01-20 04:22:03committer:doug Shelley <[email protected]& Gt 2016-12-14 00:29:41
8.5. Integrated Submission
git config--global user.email "youre mail" git config--global user.name "yuoure name" git checkout stable/newtongit cherr Y-pick F5d1cae
8.6, installation trove
8.6.1, installation trove
Yum install GCCCD ~virtualenv vensource ven/bin/activatepip install pip--upgradecd trovepip install-r requirements.txt --index-url http://mirrors.aliyun.com/pypi/simple/--trusted-host mirrors.aliyun.compython setup.py Install
8.6.2, creating related directories and startup files
mkdir -p /etc/trove/conf.dchown -r trove:trove /etc/trovemkdir -p /var/lib/ trovechown -r trove:trove /var/lib/trovemkdir -p /var/log/trovechown -r trove:trove /var/log/trove# If trove-guestagent.conf,guest_info.conf is not pre-created,# and set/etc/ Trove owner is trove, after creating instance,# the two files injected by Nova will have root privileges # file pre-existing,nova injected files do not change the file's user and group, Will change the file's read and Write permissions Touch /etc/trove/conf.d/trove-guestagent.conftouch /etc/trove/conf.d/guest_info.confchown -r trove:trove /etc/trovecat /usr/lib/systemd/system/trove-guestagent.service[unit] Description=openstack trove guestagent serviceafter=syslog.target network.target[service] type=simpleuser=troveexecstart=/home/trove/ven/bin/trove-guestagent --config-file /etc/trove/conf.d/ Trove-guestagent.conf --config-file /etc/trove/conf.d/guest_info.confrestart=on-failure[install] Wantedby=multi-user.targetsystemctl daemon-reload # This step is not necessary systemctl enable trove-guestagent
9. Upload Image
9.1. Cleaning system
Rm-rf. SSHRM-RF/HOME/TROVE/.CACHE/RM-RF/VAR/LIB/MYSQL/AUTO.CNF Poweroff
9.2. Create a snapshot of the image
10, configuration trove use made good image
Trove-manage--config-file/etc/trove/trove.conf datastore_version_update mysql mysql-5.5 mysql 0eb99b Ad-ad41-420c-bab5-844d84421c23 ' 1
This article is from the "Wuling Grassland" blog, please make sure to keep this source http://penguintux.blog.51cto.com/3021117/1912119
Trove mysql5.5 mirroring based on CENTOS7