From 942a314cb425f1b3b41705b0ebfa62f04afd7b35 Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 09:09:10 +0800 Subject: [PATCH 1/6] Enable the RDO yum repository for a released version of OpenStack on CentOS with using RDO_RELEASE --- elements/trove-guest/install.d/15-install-from-repo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elements/trove-guest/install.d/15-install-from-repo b/elements/trove-guest/install.d/15-install-from-repo index 260d815..88ab515 100755 --- a/elements/trove-guest/install.d/15-install-from-repo +++ b/elements/trove-guest/install.d/15-install-from-repo @@ -13,7 +13,8 @@ if [ "${DISTRO}" = "rhel" ]; then fi if [ "${DISTRO}" = "centos" ]; then - yum -y install https://rdo.fedorapeople.org/rdo-release.rpm + rpm -q rdo-release || install-packages http://rdo.fedorapeople.org/openstack-$RDO_RELEASE/rdo-release-$RDO_RELEASE.rpm + #yum -y install https://rdo.fedorapeople.org/rdo-release.rpm # sed -i 's/http:\/\/repos.fedorapeople.org\/repos\/openstack\/openstack-juno\/epel-Derived\ from\ Red\ Hat\ Enterprise\ Linux\ 7.1\ (Source)\//http:\/\/repos.fedorapeople.org\/repos\/openstack\/openstack-kilo\/el7\//g' /etc/yum.repos.d/rdo-release.repo yum -y update sed -i -e 's/^Defaults.*requiretty/# Defaults requiretty/g' /etc/sudoers From e6570c0747ee63d6ddc278ec61e2f24441d8e284 Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 09:16:02 +0800 Subject: [PATCH 2/6] Install wget on CentOS because centos-mysql-guest-image/install.d/30-mysql will use it --- elements/trove-guest/install.d/15-install-from-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/elements/trove-guest/install.d/15-install-from-repo b/elements/trove-guest/install.d/15-install-from-repo index 88ab515..7c776e6 100755 --- a/elements/trove-guest/install.d/15-install-from-repo +++ b/elements/trove-guest/install.d/15-install-from-repo @@ -13,6 +13,7 @@ if [ "${DISTRO}" = "rhel" ]; then fi if [ "${DISTRO}" = "centos" ]; then + yum -y install wget rpm -q rdo-release || install-packages http://rdo.fedorapeople.org/openstack-$RDO_RELEASE/rdo-release-$RDO_RELEASE.rpm #yum -y install https://rdo.fedorapeople.org/rdo-release.rpm # sed -i 's/http:\/\/repos.fedorapeople.org\/repos\/openstack\/openstack-juno\/epel-Derived\ from\ Red\ Hat\ Enterprise\ Linux\ 7.1\ (Source)\//http:\/\/repos.fedorapeople.org\/repos\/openstack\/openstack-kilo\/el7\//g' /etc/yum.repos.d/rdo-release.repo From 9039854e65a63b977ba85695a97b99d28c543140 Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 09:25:27 +0800 Subject: [PATCH 3/6] Fix the conflict between mysql-community-server and mariadb-libs on CentOS --- elements/centos-mysql-guest-image/install.d/30-mysql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elements/centos-mysql-guest-image/install.d/30-mysql b/elements/centos-mysql-guest-image/install.d/30-mysql index 4edf969..47f0f2b 100755 --- a/elements/centos-mysql-guest-image/install.d/30-mysql +++ b/elements/centos-mysql-guest-image/install.d/30-mysql @@ -9,7 +9,11 @@ set -o xtrace wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm +set +e +yum -y erase mariadb-libs mariadb-config yum -y install mysql-server +yum -y install openstack-trove-guestagent +set -e sudo mkdir -p /etc/mysql/conf.d/ sudo chown mysql:mysql -R /etc/mysql #mkdir /etc/mysql From ddcfd1f372eb06f569e7a42fbaba796edd0854ed Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 09:48:07 +0800 Subject: [PATCH 4/6] Add /etc/trove/conf.d/guest_info.conf & /etc/trove/conf.d/trove-guestagent.conf as config files to openstack-trove-guestagent.service --- elements/trove-guest/openstack-trove-guestagent.service | 2 +- elements/trove-guest/post-install.d/30-register-guest-service | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/elements/trove-guest/openstack-trove-guestagent.service b/elements/trove-guest/openstack-trove-guestagent.service index 8989da1..8c85dd7 100755 --- a/elements/trove-guest/openstack-trove-guestagent.service +++ b/elements/trove-guest/openstack-trove-guestagent.service @@ -5,7 +5,7 @@ After=syslog.target network.target cloud-init.service [Service] Type=simple User=trove -ExecStart=/usr/bin/trove-guestagent --config-file /etc/trove/trove-guestagent.conf --config-file /etc/guest_info --log-dir=/var/log/trove --logfile=trove-guestagent.log +ExecStart=/usr/bin/trove-guestagent --config-file /etc/trove/trove-guestagent.conf --config-file /etc/guest_info --config-file /etc/trove/conf.d/guest_info.conf --config-file /etc/trove/conf.d/trove-guestagent.conf --log-dir=/var/log/trove --logfile=trove-guestagent.log Restart=on-failure [Install] diff --git a/elements/trove-guest/post-install.d/30-register-guest-service b/elements/trove-guest/post-install.d/30-register-guest-service index 754f8ad..4b25c13 100755 --- a/elements/trove-guest/post-install.d/30-register-guest-service +++ b/elements/trove-guest/post-install.d/30-register-guest-service @@ -14,6 +14,9 @@ if [ "${DISTRO}" != "ubuntu" ]; then sudo mv /etc/trove/guest_info /etc/guest_info sudo chmod 0755 /etc/guest_info chown trove:trove /etc/guest_info + mkdir -p /etc/trove/conf.d + sudo cp /etc/guest_info /etc/trove/conf.d/guest_info.conf + chown -R trove:trove /etc/trove/conf.d # Enable and start service systemctl enable openstack-trove-guestagent.service systemctl start openstack-trove-guestagent.service From 180a93f38ed2987ed7d691c5b06de513db3f3def Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 10:18:22 +0800 Subject: [PATCH 5/6] Add an empty /etc/trove/conf.d/trove-guestagent.conf to prevent it being injected with wrong user or group permissions --- elements/trove-guest/post-install.d/30-register-guest-service | 1 + 1 file changed, 1 insertion(+) diff --git a/elements/trove-guest/post-install.d/30-register-guest-service b/elements/trove-guest/post-install.d/30-register-guest-service index 4b25c13..52aad25 100755 --- a/elements/trove-guest/post-install.d/30-register-guest-service +++ b/elements/trove-guest/post-install.d/30-register-guest-service @@ -16,6 +16,7 @@ if [ "${DISTRO}" != "ubuntu" ]; then chown trove:trove /etc/guest_info mkdir -p /etc/trove/conf.d sudo cp /etc/guest_info /etc/trove/conf.d/guest_info.conf + echo '[DEFAULT]' > /etc/trove/conf.d/trove-guestagent.conf chown -R trove:trove /etc/trove/conf.d # Enable and start service systemctl enable openstack-trove-guestagent.service From aa80de1b6c294aa8428d6308e8f52f661e83e029 Mon Sep 17 00:00:00 2001 From: yysfire Date: Thu, 6 Apr 2017 10:19:56 +0800 Subject: [PATCH 6/6] Set datastore_registry_ext for MySQL --- .../trove-mysql-guest-configuration/post-install.d/63-mysql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elements/trove-mysql-guest-configuration/post-install.d/63-mysql b/elements/trove-mysql-guest-configuration/post-install.d/63-mysql index fdb5ac2..001918b 100755 --- a/elements/trove-mysql-guest-configuration/post-install.d/63-mysql +++ b/elements/trove-mysql-guest-configuration/post-install.d/63-mysql @@ -88,7 +88,7 @@ swift_service_type = $DIB_TROVE_SWIFT_SERVICE_TYPE # ========== Datastore Manager Configurations ========== # Datastore manager implementations. # Format: list of 'datastore-type:datastore.manager.implementation.module' -# datastore_registry_ext = mysql:trove.guestagent.datastore.mysql.manager.Manager, percona:trove.guestagent.datastore.mysql.manager.Manager +datastore_registry_ext = mysql:trove.guestagent.datastore.mysql.manager.Manager, percona:trove.guestagent.datastore.mysql.manager.Manager # ========== Default Users / DBs Configuration ========== @@ -155,4 +155,4 @@ replication_namespace = trove.guestagent.strategies.replication.mysql_gtid # replication_user = slave_user # replication_password = slave_password -EOF \ No newline at end of file +EOF