Skip to content

Percona XtraDB Cluster 5.7

Dsipe110 edited this page Jan 8, 2018 · 1 revision

Percona XtraDB Cluster 5.7 Install Guide

Update Operating System

Update APT

sudo apt-get update

Installing Percona XtraDB Cluster 5.7

Install from APT

sudo wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-xtradb-cluster-57

Creating the Secondary Partition for MySQL Data

###Create a partition sudo fdisk -l

Identify the Secondary Logical Volume

sudo fdisk /dev/sdb
Press "n"
Press "P"
Press "1"
Accept all remaining defaults
Press "w" to write to disk

Create a File System on the Newly Created Partition

sudo mkfs -t ext4 /dev/sdb1

Create the New Directory on Which to Mount the New Partition

cd /mnt
sudo mkdir percona
cd percona
sudo mkdir data
sudo mkdir tmp

Mount the New Partition

sudo mount /dev/sdb1 /mnt/percona

Edit the fstab file for Mounting Persistance

sudo nano /etc/fstab

Add the Following

/dev/sdb1 /mnt/percona ext4 defaults 0 2

Copy the MySQL Folder Contents to the new Partition

su
cd /var/lib/mysql
sudo cp -r * /mnt/percona/data/

Change the Ownership of All Files in /mnt/percona/data/

sudo chown -R mysql:mysql /mnt/percona/data/

Grant all permissions for everyone to the tmp folder

sudo chmod 1777 tmp

Redirect linux tmp writes to the new tmp folder.

cd /
sudo rm -rf /tmp
sudo ln -s /mnt/percona/tmp /tmp

Start Mysql

First Node

sudo /etc/init.d/mysql bootstrap-pxc

Additional Nodes

sudo service mysql start

Enable clustercheck

Install xinetd service

sudo apt-get install xinetd

Get the Proper clustercheck Script from a Production Galera Server

Edit the Services File

sudo nano /etc/services

Add the Following

In the Proper Numerical Ordering

mysqlchk     9200/tcp      # MySQL check

Clone this wiki locally