Monday, July 25, 2016

Installing Percona Server on Red Hat Enterprise Linux and CentOS

Installing Percona Server on Red Hat Enterprise Linux and CentOS

Installing Percona Server from Percona yum repository


1) Install the Percona repository
You can install Percona yum repository by running the following command as a root user or with sudo:

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm


You should see some output such as the following:

Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
Preparing...                ########################################### [100%]
   1:percona-release        ########################################### [100%]
  

Note :-
RHEL/Centos 5 doesn’t support installing the packages directly from the remote location so you’ll need to download the package first and install it manually with rpm:
wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
rpm -ivH percona-release-0.1-3.noarch.rpm


2) Testing the repository
Make sure packages are now available from the repository, by executing the following command:

yum list | grep percona

You should see output similar to the following:

Percona-Server-55-debuginfo.x86_64          5.5.44-rel37.3.el6           percona-release-x86_64
Percona-Server-client-55.x86_64             5.5.44-rel37.3.el6           percona-release-x86_64
Percona-Server-devel-55.x86_64              5.5.44-rel37.3.el6           percona-release-x86_64
Percona-Server-server-55.x86_64             5.5.44-rel37.3.el6           percona-release-x86_64
Percona-Server-shared-55.x86_64             5.5.44-rel37.3.el6           percona-release-x86_64
Percona-Server-shared-compat.x86_64         5.1.68-rel14.6.551.rhel6     percona-release-x86_64
Percona-Server-test-55.x86_64               5.5.44-rel37.3.el6           percona-release-x86_64


3) Install the packages
You can now install Percona Server by running:
yum install Percona-Server-server-55


Installing Percona Server using downloaded rpm packages
1) Download the packages of the desired series for your architecture from the download page.
   The easiest way is to download bundle which contains all the packages. Following example will
   download Percona Server 5.5.44-37.3 release packages for CentOS 6:
  
wget https://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.44-37.3/binary/redhat/6/x86_64/Percona-Server-5.5.44-37.3-r729fbe2-el6-x86_64-bundle.tar

2) You should then unpack the bundle to get the packages:
tar xvf Percona-Server-5.5.44-37.3-r729fbe2-el6-x86_64-bundle.tar

After you unpack the bundle you should see the following packages:
$ ls *.rpm

Percona-Server-55-debuginfo-5.5.44-rel37.3.el6.x86_64.rpm
Percona-Server-client-55-5.5.44-rel37.3.el6.x86_64.rpm
Percona-Server-devel-55-5.5.44-rel37.3.el6.x86_64.rpm
Percona-Server-server-55-5.5.44-rel37.3.el6.x86_64.rpm
Percona-Server-shared-55-5.5.44-rel37.3.el6.x86_64.rpm
Percona-Server-test-55-5.5.44-rel37.3.el6.x86_64.rpm

3) Now you can install Percona Server by running:
rpm -ivh Percona-Server-server-55-5.5.44-rel37.3.el6.x86_64.rpm
rpm -ivh Percona-Server-client-55-5.5.44-rel37.3.el6.x86_64.rpm
rpm -ivh Percona-Server-shared-55-5.5.44-rel37.3.el6.x86_64.rpm

This will install only packages required to run the Percona Server. To install all the packages (for debugging, testing, etc.) you should run:
rpm -ivh *.rpm


Running Percona Server
service mysql start
service mysql status
service mysql stop
service mysql restart

=======================================================================================

Uninstalling Percona Server
To completely uninstall Percona Server you’ll need to remove all the installed packages and data files.

1) Stop the Percona Server service
service mysql stop

2)Remove the packages
yum remove Percona-Server*

3) Remove the data and configuration files
rm -rf /var/lib/mysql
rm -f /etc/my.cnf


No comments:

Post a Comment