rpm包方式安裝Percona server

jx_yu發表於2016-05-04

Percona XtraDB InnoDB 儲存引擎的增強版,被設計用來更好的使用更新計算機硬體系統的效能,同時還包含有一些在高效能環境下的新特性。XtraDB 儲存引擎是完全的向下相容,於是完全可以使用XtraDB來替代InnoDB儲存引擎。

 

Percona XtraDB 包含有所有 InnoDB's 健壯性,可依賴的 ACID 相容設計和高階 MVCC 架構。XtraDB InnoDB 的堅實基礎上構建,使 XtraDB 具有更多的特性,更好呼叫,更多的引數指標和更多的擴充套件。

 

尤其是,XtraDB 被設計用來在多核心的條件下更有效的使用記憶體和更加方便,更加可用。也解除了InnoDB的很多限制;提供了比InnoDB更多的配置和效能監控引數。

 

Percona XtraDB engine包含在Percona Server and MariaDB

Installing Percona Server on Red Hat Enterprise Linux

Percona ServerMySQL一樣有多種安裝方法:yum RepositoriesrpmBinary TarballSource TarballGit Source Tree等,可以根據實際環境選擇,具體安裝步驟請參考官方文件。下文主要以rpm包在RHEL 6上的安裝為例說明主要步驟

Installing Percona Server using rpm packages

1下載軟體包

wget

2 解壓tar

]# tar -xvf Percona-Server-5.6.29-76.2-rddf26fe-el6-x86_64-bundle.tar

]# ls *.rpm

Percona-Server-56-debuginfo-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-tokudb-56-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-devel-56-5.6.29-rel76.2.el6.x86_64.rpm

Percona-Server-test-56-5.6.29-rel76.2.el6.x86_64.rpm

image

3 安裝Percona Server

]#rpm -ivh Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64.rpm \

Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64.rpm \

Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64.rpm

#以上三個rpm包僅僅為了完成Percona server的安裝

 

#若需要(包含debugging, testing,etc等),則直接安裝所有的rpm包即可

]#rpm -ivh *.rpm

 

附:RHEL6上安裝報錯:libcrypto.so.10libssl.so.10

error: Failed dependencies:

        libcrypto.so.10(libcrypto.so.10)(64bit) is needed by Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64

        libssl.so.10(libssl.so.10)(64bit) is needed by Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64

        libcrypto.so.10(libcrypto.so.10)(64bit) is needed by Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64

        libssl.so.10(libssl.so.10)(64bit) is needed by Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64

#RedHat EL6自帶openssl-1.0.0版本,對於Percona-Server應該安裝openssl-1.0.1的版本,安裝新版本後,問題解決

]# rpm -ivh openssl10-libs-1.0.1e-1.ius.el6.x86_64.rpm --force

warning: openssl10-libs-1.0.1e-1.ius.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 9cd4953f: NOKEY

Preparing...                ########################################### [100%]

   1:openssl10-libs         ########################################### [100%]

clip_image003

4 配置檔案

Percona Server預設的資料檔案路徑在/var/lib/mysql/

 

#編輯配置檔案/etc/my.cnf

]# cat /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log

innodb_buffer_pool_size = 128M

注:配置檔案有很多選項,具體的根據實際需求配置,此處只是簡單配置了下而已

5 執行Percona Server

1. Starting the service

]# /etc/init.d/mysql start

Starting MySQL (Percona Server).............[  OK  ]

2. Confirming that service is running

]# /etc/init.d/mysql status

MySQL (Percona Server) running (3369)[  OK  ]

3. Stopping the service

]# /etc/init.d/mysql stop

Shutting down MySQL (Percona Server)..[  OK  ]

4. Restarting the service

]# /etc/init.d/mysql restart

Shutting down MySQL (Percona Server)..[  OK  ]

Starting MySQL (Percona Server).....[  OK  ]

6 檢視log

]# tail -f /var/log/mysqld.log

2016-05-03 16:28:23 3595 [Note] InnoDB:  Percona XtraDB () 5.6.29-76.2 started; log sequence number 1626007

2016-05-03 16:28:23 3595 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.

2016-05-03 16:28:23 3595 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

2016-05-03 16:28:23 3595 [Note] Server hostname (bind-address): '*'; port: 3306

2016-05-03 16:28:23 3595 [Note] IPv6 is available.

2016-05-03 16:28:23 3595 [Note]   - '::' resolves to '::';

2016-05-03 16:28:23 3595 [Note] Server socket created on IP: '::'.

2016-05-03 16:28:23 3595 [Note] Event Scheduler: Loaded 0 events

2016-05-03 16:28:23 3595 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.6.29-76.2'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Percona Server (GPL), Release 76.2, Revision ddf26fe

7 解除安裝Percona Server

1. Stop the Percona Server service

]# /etc/init.d/mysql stop

Shutting down MySQL (Percona Server)..[  OK  ]

2. Remove the packages

]# rpm -qa|grep -i percona

Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64

Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64

Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64

]# rpm -e Percona-Server-client-56-5.6.29-rel76.2.el6.x86_64 \

 Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64 \

 Percona-Server-shared-56-5.6.29-rel76.2.el6.x86_64

]# rpm -qa|grep -i percona

3. Remove the data and configuration files

]# rm -rf /var/lib/mysql/ /etc/my.cnf

注:這裡將刪除所有的資料檔案(databases, tables, logs, etc.),可能你環境中的datafile的位置並不是預設的/var/lib/mysql,而是其他的目錄,解除安裝的時候根據實際情況刪除檔案

 

參考:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27000195/viewspace-2093534/,如需轉載,請註明出處,否則將追究法律責任。

相關文章