liushall 2016-05-07
二进制tar包方式安装Percona Server
Installing Percona Server from a Binary Tarball
以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.他们的区别如下:
此处选择安装到RHEL6,下载ssl101对应的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
#默认读取/etc/my.cnf,此处实验环境已经存在其他mysql实例,初始化和启动的时候都使用 --defaults-file=/tmp/my.cnf 参数来指定配置文件
# cat /tmp/my.cnf
[mysqld]
basedir=/data/percona/mysql
datadir=/data/percona/mysql/data
socket=/data/percona/mysql/mysql.sock
log-error=/data/percona/mysql/mysqld.log
innodb_buffer_pool_size = 128M
port=6603
#由于本地存在别的mysql实例,此处认为指定cnf路径
# ./scripts/mysql_install_db --defaults-file=/tmp/my.cnf
# /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 mysqld
160504 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
# netstat -antpl|grep mysqld
tcp 0 0 :::6603 :::* LISTEN 17835/mysqld #percona mysql
tcp 0 0 :::3306 :::* LISTEN 23233/mysqld #默认运行的mysql
# 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 1625997
2016-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: 6603
2016-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 events
2016-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的即可。
#此处由于有其他默认的mysql实例在运行的原因,需要指定当前sock位置和端口
~#/data/percona/mysql/bin/mysqladmin -S /data/percona/mysql/mysql.sock -P 6603 shutdown
#直接删除basedir和datadir即可
~# rm -rf /data/percona/mysql/
Percona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 对 MySQL 进行改造。
Percona Server 的详细介绍:请点这里
Percona Server 的下载地址:请点这里