From 016c0f577c535def40dd32ddf41e6cb145a2f9b8 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 12 Sep 2019 11:48:07 +0200 Subject: Drop Percona XtraBackup in favour of MariaDB Backup XtraBackup started failing to install on Ubuntu and does not support MariaDB 10.3 version. Related-Bug: #1843043 Change-Id: I9cf62c8e03a02574d85e5349df1d23a51d4c99be --- README.rst | 3 +- docker/base/Dockerfile.j2 | 5 --- docker/base/percona-release.repo | 15 ------- docker/base/sources.list.ubuntu | 4 -- docker/mariadb/Dockerfile.j2 | 19 ++++----- docker/mariadb/backup.sh | 48 +++++++++++++++++++++ docker/xtrabackup/Dockerfile.j2 | 28 ------------- docker/xtrabackup/backup.sh | 49 ---------------------- kolla/image/build.py | 2 - .../notes/drop-xtrabackup-e58a97b617ff708c.yaml | 5 +++ tests/templates/template_overrides.j2 | 3 -- tests/vars/zuul.yml | 1 - 12 files changed, 61 insertions(+), 121 deletions(-) delete mode 100644 docker/base/percona-release.repo create mode 100644 docker/mariadb/backup.sh delete mode 100644 docker/xtrabackup/Dockerfile.j2 delete mode 100755 docker/xtrabackup/backup.sh create mode 100644 releasenotes/notes/drop-xtrabackup-e58a97b617ff708c.yaml diff --git a/README.rst b/README.rst index 12be6d014..5f29130e6 100644 --- a/README.rst +++ b/README.rst @@ -154,8 +154,7 @@ Kolla provides images to deploy the following infrastructure components: - `Open vSwitch `__ and Linuxbridge back ends for Neutron. - `Linux ptp `__ an implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux. -- `Percona XtraBackup `__ - A tool which provides a method of performing a hot backup of your MySQL data while the +- MariaDB Backup A tool which provides a method of performing a hot backup of your MySQL data while the system is running. - `Prometheus `__ an open-source systems monitoring and alerting toolkit originally built at SoundCloud. diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 1acfe0202..d72427a96 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -80,12 +80,10 @@ COPY yum.conf /etc/yum.conf 'grafana.repo', 'influxdb.repo', 'opendaylight.repo', - 'percona-release.repo', 'rabbitmq_rabbitmq-server.repo', 'td.repo' ] %} - ## NOTE(yoctozepto): Percona keys omitted on purpose (handled via the repo file for compatibility with Zuul) {% set base_yum_repo_keys = [ 'https://artifacts.elastic.co/GPG-KEY-elasticsearch', 'https://packages.grafana.com/gpg.key', @@ -342,7 +340,6 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences {# 391A9AA2147192839E9DB0315EDB1B62EC4926EA -- Canonical Cloud Archive Signing Key #} {# 46095ACC8548582C1A2699A9D27D666CD88E42B4 -- Elasticsearch (Elasticsearch Signing Key) #} {# 49B07274951063870A8B7EAE7B8AA1A344C05248 -- Opendaylight Signing Key #} - {# 4D1BB29D63D98E422B2113B19334A25F8507EFA5 -- Percona MySQL Development Team (Packaging key) #} {# 58118E89F3A912897C070ADBF76221572C52609D -- Docker Release Tool (releasedocker) #} {# 4D8EB5FDA37AB55F41A135203BF88A0C6A770882 -- Apache Qpid PPA Signing Key #} {# 901F9177AB97ACBE -- Treasure Data, Inc (Treasure Agent Official Signing key) #} @@ -352,7 +349,6 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences '391A9AA2147192839E9DB0315EDB1B62EC4926EA', '46095ACC8548582C1A2699A9D27D666CD88E42B4', '49B07274951063870A8B7EAE7B8AA1A344C05248', - '4D1BB29D63D98E422B2113B19334A25F8507EFA5', '58118E89F3A912897C070ADBF76221572C52609D', '4D8EB5FDA37AB55F41A135203BF88A0C6A770882', '901F9177AB97ACBE', @@ -367,7 +363,6 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences {% elif base_distro == 'debian' %} {% set base_apt_keys = [ '46095ACC8548582C1A2699A9D27D666CD88E42B4', - '4D1BB29D63D98E422B2113B19334A25F8507EFA5', ] %} {% set remote_apt_keys = [ 'https://download.docker.com/linux/debian/gpg', diff --git a/docker/base/percona-release.repo b/docker/base/percona-release.repo deleted file mode 100644 index 74bb1623a..000000000 --- a/docker/base/percona-release.repo +++ /dev/null @@ -1,15 +0,0 @@ -[percona-release-$basearch] -name = Percona-Release YUM repository - $basearch -baseurl = https://repo.percona.com/release/$releasever/RPMS/$basearch -enabled = 0 -gpgcheck = 1 -gpgkey = https://repo.percona.com/yum/RPM-GPG-KEY-Percona - https://repo.percona.com/yum/PERCONA-PACKAGING-KEY - -[percona-release-noarch] -name = Percona-Release YUM repository - noarch -baseurl = https://repo.percona.com/release/$releasever/RPMS/noarch -enabled = 0 -gpgcheck = 1 -gpgkey = https://repo.percona.com/yum/RPM-GPG-KEY-Percona - https://repo.percona.com/yum/PERCONA-PACKAGING-KEY diff --git a/docker/base/sources.list.ubuntu b/docker/base/sources.list.ubuntu index 3ffe3449b..4e8e4d121 100644 --- a/docker/base/sources.list.ubuntu +++ b/docker/base/sources.list.ubuntu @@ -36,9 +36,5 @@ deb http://ppa.launchpad.net/odl-team/carbon/ubuntu xenial main # rabbitmq repo deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ bionic main -# Percona XtraBackup repo -# NOTE(yoctozepto): enabled only in the xtrabackup image (to spare MariaDB deps and allow Zuul override) -#deb http://repo.percona.com/apt bionic main - # MariaDB repo deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic main diff --git a/docker/mariadb/Dockerfile.j2 b/docker/mariadb/Dockerfile.j2 index 55898dc18..7fa09a30d 100644 --- a/docker/mariadb/Dockerfile.j2 +++ b/docker/mariadb/Dockerfile.j2 @@ -23,19 +23,11 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% elif base_package_type == 'deb' %} {% set mariadb_packages = [ - 'expect' + 'expect', + 'mariadb-backup', + 'mariadb-client', + 'mariadb-server' ] %} - {% if base_distro == 'debian' %} - {% set mariadb_packages = mariadb_packages + [ - 'mariadb-server' - ] %} - {% else %} - {% set mariadb_packages = mariadb_packages + [ - 'mariadb-server', - 'mariadb-client', - 'mariadb-backup', - ] %} - {% endif %} {% endif %} {{ macros.install_packages(mariadb_packages | customizable("packages")) }} @@ -53,6 +45,9 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start \ RUN mkdir -p /var/run/mysqld && chown mysql /var/run/mysqld && chmod 755 /var/run/mysqld {% endif %} +COPY backup.sh /usr/local/bin/kolla_mariadb_backup.sh +RUN chmod 755 /usr/local/bin/kolla_mariadb_backup.sh + {% if use_dumb_init %} {% block mariadb_entrypoint %} # NOTE(mgoddard): Override the dumb-init arguments to avoid passing diff --git a/docker/mariadb/backup.sh b/docker/mariadb/backup.sh new file mode 100644 index 000000000..8c494a5eb --- /dev/null +++ b/docker/mariadb/backup.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -eu + +# Execute a full backup +backup_full() { + echo "Taking a full backup" + mariabackup --defaults-file=/etc/mysql/my.cnf \ + --no-timestamp \ + --stream=xbstream \ + --compress \ + --history=$(date +%d-%m-%Y) ./ > \ + $BACKUP_DIR/mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs +} + +# Execute an incremental backup +backup_incremental() { + echo "Taking an incremental backup" + mariabackup --defaults-file=/etc/mysql/my.cnf \ + --no-timestamp \ + --stream=xbstream \ + --compress \ + --incremental \ + --incremental-history-name=$(date +%d-%m-%Y) \ + --history=$(date +%d-%m-%Y) ./ > \ + $BACKUP_DIR/incremental-$(date +%H)-mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs +} + +BACKUP_DIR=/backup/ +cd $BACKUP_DIR + +if [ -n $BACKUP_TYPE ]; then + case $BACKUP_TYPE in + "full") + backup_full + ;; + "incremental") + backup_incremental + ;; + *) + echo "Only full or incremental options are supported." + exit 1 + ;; + esac +else + echo "You need to specify either full or incremental backup options." + exit 1 +fi diff --git a/docker/xtrabackup/Dockerfile.j2 b/docker/xtrabackup/Dockerfile.j2 deleted file mode 100644 index 341a0d2f3..000000000 --- a/docker/xtrabackup/Dockerfile.j2 +++ /dev/null @@ -1,28 +0,0 @@ -FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} -LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" - -{% block xtrabackup_header %}{% endblock %} - -{% import "macros.j2" as macros with context %} - -{% if base_package_type == 'rpm' %} -RUN yum-config-manager --enable percona-release-\* -{% endif %} - -{% if base_package_type == 'deb' %} -RUN sed -i -e '/percona/ s|^#deb |deb |' /etc/apt/sources.list -{% endif %} - -{% if base_package_type in ['rpm', 'deb'] %} - {% set xtrabackup_packages = ['percona-xtrabackup-24', 'qpress'] %} -{% endif %} - -{{ macros.install_packages(xtrabackup_packages | customizable("packages")) }} - -COPY backup.sh /usr/local/bin/kolla_mariadb_backup.sh -RUN chmod 755 /usr/local/bin/kolla_mariadb_backup.sh - -CMD /usr/local/bin/kolla_mariadb_backup.sh - -{% block xtrabackup_footer %}{% endblock %} -{% block footer %}{% endblock %} diff --git a/docker/xtrabackup/backup.sh b/docker/xtrabackup/backup.sh deleted file mode 100755 index f8dff8bd7..000000000 --- a/docker/xtrabackup/backup.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -# Execute a full backup -backup_full() { - echo "Taking a full backup" - innobackupex --defaults-file=/etc/mysql/my.cnf \ - --no-timestamp \ - --stream=xbstream \ - --compress \ - --history=$(date +%d-%m-%Y) ./ > \ - $BACKUP_DIR/mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs -} - -# Execute an incremental backup -backup_incremental() { - echo "Taking an incremental backup" - innobackupex --defaults-file=/etc/mysql/my.cnf \ - --no-timestamp \ - --stream=xbstream \ - --compress \ - --incremental \ - --incremental-history-name=$(date +%d-%m-%Y) \ - --history=$(date +%d-%m-%Y) ./ > \ - $BACKUP_DIR/incremental-$(date +%H)-mysqlbackup-$(date +%d-%m-%Y-%s).qp.xbc.xbs -} - -BACKUP_DIR=/backup/ -cd $BACKUP_DIR - -if [ -n $BACKUP_TYPE ]; then - case $BACKUP_TYPE in - "full") - backup_full - ;; - "incremental") - backup_incremental - ;; - *) - echo "Only full or incremental options are supported." - exit 1 - ;; - esac -else - echo "You need to specify either full or incremental backup options." - exit 1 -fi - diff --git a/kolla/image/build.py b/kolla/image/build.py index 09734591a..e1b43b789 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -89,7 +89,6 @@ UNBUILDABLE_IMAGES = { "opendaylight", # no binary package "prometheus-mtail", # no aarch64 binary "telegraf", # no binary package - "xtrabackup", # no binary package }, 'source': { @@ -138,7 +137,6 @@ UNBUILDABLE_IMAGES = { "qdrouterd", "sensu-base", "telegraf", # no binary package - "xtrabackup", # no binary package }, 'ubuntu': { "cyborg-base", diff --git a/releasenotes/notes/drop-xtrabackup-e58a97b617ff708c.yaml b/releasenotes/notes/drop-xtrabackup-e58a97b617ff708c.yaml new file mode 100644 index 000000000..987bd4df7 --- /dev/null +++ b/releasenotes/notes/drop-xtrabackup-e58a97b617ff708c.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Percona XtraBackup tool got dropped in favour of MariaDB Backup. + "xtrabackup" image is no longer present. diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2 index 22baa2a56..adc0194a9 100644 --- a/tests/templates/template_overrides.j2 +++ b/tests/templates/template_overrides.j2 @@ -33,7 +33,6 @@ RUN sed -i -e "/^mirrorlist/ d" \ {% if base_distro == "centos" %} {% endraw %} -## NOTE(yoctozepto): GPG key location is replaced for Percona repo only ## TODO(yoctozepto): CentOS hits external EPEL repo for its repo package (epel-release-*.rpm), should use the mirrored RUN sed -i \ -e "/^mirrorlist/ d" \ @@ -46,7 +45,6 @@ RUN sed -i \ && sed -i \ -e "s|https://trunk.rdoproject.org|{{ nodepool_rdo_proxy }}|g" \ -e "s|https://cbs.centos.org/repos|{{ nodepool_cbs_centos_proxy }}|g" \ - -e "s|https://repo.percona.com|{{ nodepool_percona_proxy }}|g" \ /etc/yum.repos.d/*.repo {% raw %} @@ -56,7 +54,6 @@ RUN sed -i \ ## TODO(yoctozepto): replace base repo earlier as well (like RHEL-based do) RUN sed -i -e "s|http://archive.ubuntu.com|http://{{ nodepool_mirror_host }}|" \ -e "s|http://ubuntu-cloud.archive.canonical.com/ubuntu|http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|" \ - -e "s|http://repo.percona.com|{{ nodepool_percona_proxy }}|" \ /etc/apt/sources.list \ && apt-get update diff --git a/tests/vars/zuul.yml b/tests/vars/zuul.yml index 68c35e69b..524f38a60 100644 --- a/tests/vars/zuul.yml +++ b/tests/vars/zuul.yml @@ -4,4 +4,3 @@ nodepool_pypi_mirror: "http://{{ zuul_site_mirror_fqdn }}:8080/pypi/simple" nodepool_mirror_host: "{{ zuul_site_mirror_fqdn }}" nodepool_npmjs_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/registry.npmjs/" nodepool_cbs_centos_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/cbs.centos" -nodepool_percona_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/percona" -- cgit v1.2.3