二進位tar包方式安裝Percona Server
二進位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包或者源碼下載
#此處下載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/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 server1. 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
Percona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 對 MySQL 進行改造。
CentOS中編譯安裝Percona Server 5.5.42出現問題解決一例
Percona Server 5.6跟5.5的差異統計
CentOS中編譯安裝Percona Server 5.5.42出現問題解決一例
Percona Server 的詳細介紹:請點這裡
Percona Server 的:請點這裡
本文永久更新連結地址: