Files
trove/integration/scripts/files/elements/ubuntu-xenial-mariadb/install.d/30-mariadb
Lingxian Kong 89386032ae Fix MariaDB image build
The error in MariaDB installation during the guest image building:

```
apt-get -y install socat percona-xtrabackup
percona-xtrabackup : Depends: libcurl4 (>= 7.16.3) but it is not installable
                     Depends: libgcrypt20 (>= 1.8.0) but 1.6.5-2ubuntu0.5 is to be installed
                     Depends: libssl1.1 (>= 1.1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
```

This patch fixes the issue based on the process described in
https://mariadb.com/kb/en/library/installing-mariadb-deb-files

Change-Id: I368bddabffcc0f11f7181b3a33be1f213f0bdaba
2019-09-04 09:38:37 +12:00

37 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# CONTEXT: GUEST during CONSTRUCTION as ROOT
# PURPOSE: Install controller base required packages
# Refer to https://mariadb.com/kb/en/library/installing-mariadb-deb-files
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
# These GPG key IDs are used to fetch keys from a keyserver on Ubuntu & Debian
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |
bash -s -- --mariadb-server-version="mariadb-10.4" --skip-key-import --skip-maxscale
# NOTE(lxkong): Refer to https://www.percona.com/doc/percona-xtrabackup/2.4/installation/apt_repo.html
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
apt-get update
# Disable password prompt
debconf-set-selections <<< "mariadb-server mysql-server/root_password password ''"
debconf-set-selections <<< "mariadb-server mysql-server/root_password_again password ''"
apt-get install -y --allow-unauthenticated mariadb-server mariadb-client galera-4 libmariadb3 mariadb-backup mariadb-common percona-xtrabackup-24
cat <<EOF >/etc/mysql/conf.d/no_perf_schema.cnf
[mysqld]
performance_schema = off
EOF
chown mysql:mysql /etc/mysql/my.cnf
rm -f /etc/init.d/mysql
systemctl daemon-reload
systemctl enable mariadb