Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

Get free database assistance or contact our experts for personalized support.

Compile and install from source code

For routine deployments, prefer official packages or a binary tarball. Follow this page to compile Percona XtraDB Cluster when you package it yourself, ship custom patches, or develop the server locally.

Clone the source from GitHub , then install the build packages in the table.

Package apt yum
Git git git
SCons scons scons
GCC gcc gcc
g++ g++ gcc-c++
OpenSSL openssl openssl
Check check check
CMake cmake cmake
Bison bison bison
Boost libboost-all-dev boost-devel
Asio libasio-dev asio-devel
Async I/O libaio-dev libaio-devel
ncurses libncurses5-dev ncurses-devel
Readline libreadline-dev readline-devel
PAM libpam-dev pam-devel
socat socat socat
curl libcurl-dev libcurl-devel

Install dependencies

Fill any gaps with one of these commands:

sudo apt install -y git scons gcc g++ openssl check cmake bison \
libboost-all-dev libasio-dev libaio-dev libncurses5-dev libreadline-dev \
libpam-dev socat libcurl-dev
sudo yum install -y git scons gcc gcc-c++ openssl check cmake bison \
boost-devel asio-devel libaio-devel ncurses-devel readline-devel pam-devel \
socat libcurl-devel

glibc version

Percona XtraBackup tarballs encode glibc in the filename as glibc2.xx. Replace that token with the suffix from your actual file (for example glibc2.28). Choose archives built for the glibc you compile and run against. Inspect the library version with:

ldd --version

When build hosts and deployment hosts differ, keep the CPU architecture aligned and match glibc, or compile on a host that mirrors production.

Compile

Compile Percona XtraDB Cluster from source:

  1. Clone a fresh tree—stale checkouts can break the build scripts:

    git clone https://github.com/percona/percona-xtradb-cluster.git
    
  2. Check out the 8.4 branch and pull submodules:

    cd percona-xtradb-cluster
    git checkout 8.4
    git submodule update --init --recursive
    
  3. Fetch Percona XtraBackup 8.4 and Percona XtraBackup 8.4 *.tar.gz files for your OS from Percona Software Downloads .

    Git omits XtraBackup binaries; build-binary.sh copies them from pxc-build/pxc_extra. It expects two distinct install trees under fixed names—pxb-{{ vers_major }} for backup and restore tooling, pxb-8.4 for State Snapshot Transfer (SST):

    • Percona XtraBackup 8.4 backs up and restores data through the integrated tooling.

    • Percona XtraBackup 8.4 drives SST.

    You need two separate directory trees, not always two different releases. When one build satisfies both roles (same version, glibc, and architecture), unpack once, then duplicate the folder so both pxb-* paths exist, or run the extract steps twice against the same archive.

    The shell snippets assume Linux-x86_64. On ARM64, substitute filenames that match your CPU (aarch64, arm64, and so on); do not reuse paths that do not match your downloads.

    Unpack into pxc-build/pxc_extra and rename directories to match the mv targets in the example block. Swap glibc2.xx for the segment from each tarball name. Swap 8.4.x for the version string on the XtraBackup 8.4 file (for example 8.4.0-3). Point tar and mv at the real top-level directory each archive creates.

    mkdir -p ./pxc-build/pxc_extra
    
    tar -xvf percona-xtrabackup-8.4-Linux-x86_64.glibc2.xx.tar.gz -C ./pxc-build
    mv ./pxc-build/percona-xtrabackup-8.4-Linux-x86_64.glibc2.xx ./pxc-build/pxc_extra/pxb-{{ vers_major }}
    
    tar -xvf percona-xtrabackup-8.4.x-Linux-x86_64.glibc2.xx.tar.gz -C ./pxc-build
    mv ./pxc-build/percona-xtrabackup-8.4.x-Linux-x86_64.glibc2.xx ./pxc-build/pxc_extra/pxb-8.4
    
  4. Invoke ./build-ps/build-binary.sh with an explicit output directory (it defaults to the current directory):

    mkdir -p ./pxc-build
    ./build-ps/build-binary.sh ./pxc-build
    

On success, pxc-build holds a new archive named like Percona-XtraDB-Cluster_<version-number>-Linux.x86_64.glibc2.xx.tar.gz (full and minimal builds may both appear). Read <version-number> and glibc2.xx from the filename the script emits.

Note

Published version strings, glibc tags, and archive names vary by release.

Install and next steps

Your artifact matches a binary tarball: one base directory bundles binaries, libraries, and support files, as summarized in the version and archive table on that page.

  1. Unpack it on every node at the path you will treat as basedir.

  2. Layer in runtime OS packages from the Debian, Ubuntu, or Red Hat lists in Install from Binary Tarball.

  3. Create datadir and a MySQL option file, point basedir and datadir at your paths, and layer Galera and cluster settings into the file.

  4. Initialize the data directory before the first boot (for example ./bin/mysqld --initialize from the unpacked tree, using the account and permissions your policy requires).

  5. Start the cluster: bootstrap the first node, then join the rest.

Most tutorials assume RPM/DEB paths under /usr and systemctl. Tarball and hand-built trees live elsewhere, yet the same wsrep flow applies. For the full picture, read Get started with Percona XtraDB Cluster and Install Percona XtraDB Cluster.