阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

二进制tar包方式安装Percona Server

107次阅读
没有评论

共计 3687 个字符,预计需要花费 10 分钟才能阅读完成。

二进制 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 的版本

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

 二进制 tar 包方式安装 Percona Server

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

二进制 tar 包方式安装 Percona Server

由上图发现,当选择了版本和下载方式(二进制 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/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

# 直接删除 basedir 和 datadir 即可

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

如何在 CentOS 7 上安装 Percona Server  http://www.linuxidc.com/Linux/2015-06/119144.htm

Percona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 对 MySQL 进行改造。

CentOS 中编译安装 Percona Server 5.5.42 出现问题解决一例  http://www.linuxidc.com/Linux/2015-03/114279.htm

Percona Server 5.6 跟 5.5 的差异统计  http://www.linuxidc.com/Linux/2015-05/116975.htm

CentOS 中编译安装 Percona Server 5.5.42 出现问题解决一例  http://www.linuxidc.com/Linux/2015-03/114279.htm

Percona Server 的详细介绍 :请点这里
Percona Server 的下载地址 :请点这里

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-05/131112.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计3687字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中