Improve image build
- Remove network-scripts package from guest agent, otherwise image creation will fail with network-scripts not found. - Improve the way to install percona-xtrabackup package on Xenial to avoid the failure: "write error: No space left on device" Change-Id: I6d8de1ad0f675db9635f4762cefc26169e738bbc
This commit is contained in:
@@ -37,7 +37,6 @@ lsof:
|
|||||||
net-tools:
|
net-tools:
|
||||||
netbase:
|
netbase:
|
||||||
netcat-openbsd:
|
netcat-openbsd:
|
||||||
network-scripts:
|
|
||||||
open-vm-tools:
|
open-vm-tools:
|
||||||
arch: i386, amd64
|
arch: i386, amd64
|
||||||
openssh-client:
|
openssh-client:
|
||||||
|
|||||||
@@ -11,37 +11,42 @@ export DEBIAN_FRONTEND=noninteractive
|
|||||||
apt-get --allow-unauthenticated -y install mysql-client mysql-server
|
apt-get --allow-unauthenticated -y install mysql-client mysql-server
|
||||||
|
|
||||||
# Xenial provides mysql 5.7 which requires percona-xtrabackup-24
|
# Xenial provides mysql 5.7 which requires percona-xtrabackup-24
|
||||||
|
|
||||||
PXB_VERSION_OVERRIDE=24
|
PXB_VERSION_OVERRIDE=24
|
||||||
PKGS=$(apt-cache search percona-xtrabackup-${PXB_VERSION_OVERRIDE})
|
#PKGS=$(apt-cache search percona-xtrabackup-${PXB_VERSION_OVERRIDE})
|
||||||
if [[ "$PKGS" == *"percona-xtrabackup-$PXB_VERSION_OVERRIDE"* ]]; then
|
#if [[ "$PKGS" == *"percona-xtrabackup-$PXB_VERSION_OVERRIDE"* ]]; then
|
||||||
apt-get --allow-unauthenticated -y install percona-xtrabackup-${PXB_VERSION_OVERRIDE}
|
# apt-get --allow-unauthenticated -y install percona-xtrabackup-${PXB_VERSION_OVERRIDE}
|
||||||
else
|
#else
|
||||||
# Architecture is not supported by percona website. Compile and install it
|
# # Architecture is not supported by percona website. Compile and install it
|
||||||
PXB_VERSION=${PXB_VERSION_OVERRIDE:0:1}.${PXB_VERSION_OVERRIDE:1:1}
|
# PXB_VERSION=${PXB_VERSION_OVERRIDE:0:1}.${PXB_VERSION_OVERRIDE:1:1}
|
||||||
|
#
|
||||||
|
# apt-get --allow-unauthenticated -y install build-essential flex bison automake autoconf \
|
||||||
|
# libtool cmake libaio-dev mysql-client libncurses-dev zlib1g-dev \
|
||||||
|
# libgcrypt11-dev libev-dev libcurl4-gnutls-dev vim-common
|
||||||
|
#
|
||||||
|
# pushd /tmp
|
||||||
|
#
|
||||||
|
# git clone https://github.com/percona/percona-xtrabackup.git
|
||||||
|
# cd percona-xtrabackup
|
||||||
|
# git checkout $PXB_VERSION
|
||||||
|
#
|
||||||
|
# mkdir /tmp/boost
|
||||||
|
# cmake -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF && make -j4
|
||||||
|
# make install
|
||||||
|
# ln -s /usr/local/xtrabackup/bin/* /usr/bin/
|
||||||
|
#
|
||||||
|
# dpkg -P build-essential automake autoconf libtool cmake
|
||||||
|
# apt-get -y clean
|
||||||
|
#
|
||||||
|
# popd
|
||||||
|
#
|
||||||
|
# rm -rf /tmp/boost /tmp/percona-xtrabackup
|
||||||
|
#fi
|
||||||
|
|
||||||
apt-get --allow-unauthenticated -y install build-essential flex bison automake autoconf \
|
# NOTE(lxkong): Refer to https://www.percona.com/doc/percona-xtrabackup/2.4/installation/apt_repo.html
|
||||||
libtool cmake libaio-dev mysql-client libncurses-dev zlib1g-dev \
|
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
|
||||||
libgcrypt11-dev libev-dev libcurl4-gnutls-dev vim-common
|
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
|
||||||
|
apt-get update
|
||||||
pushd /tmp
|
apt-get --allow-unauthenticated -y install percona-xtrabackup-${PXB_VERSION_OVERRIDE}
|
||||||
|
|
||||||
git clone https://github.com/percona/percona-xtrabackup.git
|
|
||||||
cd percona-xtrabackup
|
|
||||||
git checkout $PXB_VERSION
|
|
||||||
|
|
||||||
mkdir /tmp/boost
|
|
||||||
cmake -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF && make -j4
|
|
||||||
make install
|
|
||||||
ln -s /usr/local/xtrabackup/bin/* /usr/bin/
|
|
||||||
|
|
||||||
dpkg -P build-essential automake autoconf libtool cmake
|
|
||||||
apt-get -y clean
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
rm -rf /tmp/boost /tmp/percona-xtrabackup
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat >/etc/mysql/conf.d/no_perf_schema.cnf <<_EOF_
|
cat >/etc/mysql/conf.d/no_perf_schema.cnf <<_EOF_
|
||||||
[mysqld]
|
[mysqld]
|
||||||
@@ -62,4 +67,3 @@ if [ -e /etc/init/mysql.conf ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl enable mysql
|
systemctl enable mysql
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user