转载

二进制tar包方式安装Percona server

Installing Percona Server from a Binary Tarball

1 下载二进制tar

5.6版本为例,去官网https://www.percona.com/downloads/Percona-Server-5.6/LATEST/也可以看到如下:

#Version下拉框中选择具体的percona server的版本

二进制tar包方式安装Percona server

#Software下拉框中选择对应的OS版本或者二进制tar包或者源码下载

二进制tar包方式安装Percona server

#此处下载5.6最后一个版本,如下:

二进制tar包方式安装Percona server

由上图发现,当选择了版本和下载方式(二进制tar包)后,下方显示了不止一个对应的tar包,而他们不同的地方是:ssl098ssl100ssl101.他们的区别如下:

  • 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/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

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 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

6 查看进程

]# netstat -antpl|grep mysqld

tcp        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 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的即可。

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

#直接删除basedirdatadir即可

~]# rm -rf /data/percona/mysql/



参考:
https://www.percona.com/doc/percona-server/5.6/installation.html#installing-percona-server-from-repositories
http://blog.itpub.net/27000195/viewspace-2093534/   rpm包方式安装
http://blog.itpub.net/27000195/viewspace-2093561/   二进制tar包方式安装
http://blog.itpub.net/27000195/viewspace-2093563/   源码方式安装

正文到此结束
Loading...