Welcome 微信登录

首页 / 数据库 / MySQL / 二进制tar包方式安装Percona Server

二进制tar包方式安装Percona ServerInstalling Percona Server from a Binary Tarball

1 下载二进制tar包

以5.6版本为例,去官网https://www.percona.com/downloads/Percona-Server-5.6/LATEST/也可以看到如下:#在Version下拉框中选择具体的percona server的版本#在Software下拉框中选择对应的OS版本或者二进制tar包或者源码下载 #此处下载5.6最后一个版本,如下:由上图发现,当选择了版本和下载方式(二进制tar包)后,下方显示了不止一个对应的tar包,而他们不同的地方是:ssl098、ssl100、ssl101.他们的区别如下:
  • ssl100 - for all Debian/Ubuntu versions except Debian Squeeze (libssl.so.1.0.0 =>/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f2e389a5000));
  • ssl098 - only for Debian Squeeze (libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8(0x00007f9b30db6000));
  • ssl101 - for CentOS 6 and CentOS 7 (libssl.so.10 => /usr/lib64/libssl.so.10(0x00007facbe8c4000));
  • ssl098e - to be used only for CentOS 5 (libssl.so.6 => /lib64/libssl.so.6(0x00002aed5b64d000)).
此处选择安装到RHEL6,下载ssl101对应的tar包

2 解压tar包

#创建basedir# mkdir /data/percona#解压# tar -zxvf Percona-Server-5.6.29-rel76.2-Linux.x86_64.ssl101.tar.gz -C /data/percona/# cd /data/percona/# mv Percona-Server-5.6.29-rel76.2-Linux.x86_64.ssl101/ mysql#最终安装到/data/percona/mysql/目录# ls /data/percona/mysql/# chown mysql:mysql /data/percona/mysql/ -R

3 编辑配置文件

#默认读取/etc/my.cnf,此处实验环境已经存在其他mysql实例,初始化和启动的时候都使用 --defaults-file=/tmp/my.cnf 参数来指定配置文件# cat /tmp/my.cnf[mysqld]basedir=/data/percona/mysqldatadir=/data/percona/mysql/datasocket=/data/percona/mysql/mysql.socklog-error=/data/percona/mysql/mysqld.loginnodb_buffer_pool_size = 128Mport=6603

4 初始化db

#由于本地存在别的mysql实例,此处认为指定cnf路径# ./scripts/mysql_install_db  --defaults-file=/tmp/my.cnf

5 启动percona mysql

# /data/percona/mysql/bin/mysqld_safe --defaults-file=/tmp/my.cnf  &160504 10:37:02 mysqld_safe Adding "/data/percona/mysql/lib/mysql/libjemalloc.so.1" to LD_PRELOAD for mysqld160504 10:37:02 mysqld_safe Logging to "/data/percona/mysql/mysqld.log".160504 10:37:02 mysqld_safe Starting mysqld daemon with databases from /data/percona/mysql/data

6 查看进程

# netstat -antpl|grep mysqldtcp        0      0 :::6603                   :::*                   LISTEN      17835/mysqld  #percona mysql    tcp        0      0 :::3306                   :::*                     LISTEN      23233/mysqld  #默认运行的mysql

7 查看log

# tail -f  /data/percona/mysql/mysqld.log   2016-05-04 10:37:03 17835 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.29-rel76.2 started; log sequence number 16259972016-05-04 10:37:03 17835 [Note] RSA private key file not found: /data/percona/mysql/data//private_key.pem. Some authentication plugins will not work.2016-05-04 10:37:03 17835 [Note] RSA public key file not found: /data/percona/mysql/data//public_key.pem. Some authentication plugins will not work.2016-05-04 10:37:03 17835 [Note] Server hostname (bind-address): "*"; port: 66032016-05-04 10:37:03 17835 [Note] IPv6 is available.2016-05-04 10:37:03 17835 [Note] - "::" resolves to "::";2016-05-04 10:37:03 17835 [Note] Server socket created on IP: "::".2016-05-04 10:37:03 17835 [Note] Event Scheduler: Loaded 0 events2016-05-04 10:37:03 17835 [Note] /data/percona/mysql/bin/mysqld: ready for connections.Version: "5.6.29-76.2"  socket: "/data/percona/mysql/mysql.sock"  port: 6603  Percona Server (GPL), Release 76.2, Revision ddf26fe至此,percona的二进制tar包的安装简单完成,发现跟mysql的安装几乎一样,关于配置文件的更多选项配置、启动脚本配置以及一些后续的配置等都类似mysql的即可。

8 卸载percona server

1.   Stop the Percona Server service

#此处由于有其他默认的mysql实例在运行的原因,需要指定当前sock位置和端口~#/data/percona/mysql/bin/mysqladmin -S /data/percona/mysql/mysql.sock  -P 6603 shutdown

2.   Remove the data and configuration files

#直接删除basedir和datadir即可~# rm -rf /data/percona/mysql/如何在 CentOS 7 上安装 Percona Server  http://www.linuxidc.com/Linux/2015-06/119144.htmPercona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 对 MySQL 进行改造。CentOS中编译安装Percona Server 5.5.42出现问题解决一例  http://www.linuxidc.com/Linux/2015-03/114279.htmPercona Server 5.6跟5.5的差异统计  http://www.linuxidc.com/Linux/2015-05/116975.htmCentOS中编译安装Percona Server 5.5.42出现问题解决一例  http://www.linuxidc.com/Linux/2015-03/114279.htmPercona Server 的详细介绍:请点这里
Percona Server 的下载地址:请点这里本文永久更新链接地址