字體:  

在 ubuntu 12.04 上安裝 Percona Server + HandlerSocket

altis 發表於: 2013-11-08 04:59 來源: ADJ網路控股集團


percona-server 基本上跟 MySQL 完全相容…因為他就是從 MySQL 原始碼 Fork 出來的一個強化版的 MySQL Server ….

在 ubuntu 上面你還看不到他.. 所以你可以根據下面的步驟來安裝…


安裝步驟:

# gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A

# gpg -a --export CD2EFD2A | sudo apt-key add -

# vim /etc/apt/sources.list  (最後面加入二行)

QUOTE:

    deb http://repo.percona.com/apt precise main

    deb-src http://repo.percona.com/apt precise main

   


# apt-get update

# apt-get install percona-server-server percona-xtrabackup


到此就安裝完成, 使用方式跟 MySQL 一模一樣, "mysql -u root -p" 就可以開始使用了.


安裝 HandlerSocket:
Login to MySQL as root and run:

mysql> install plugin handlersocket soname 'handlersocket.so';

mysql> SHOW PROCESSLIST;
mysql> exit;

接著在 /etc/mysql/my.cnf 的 [mysqld] Section 加上底下幾行:

QUOTE:


performance_schema
# server adderss
#bind-address           = 10.0.0.2

# HandlerSocket
loose_handlersocket_port = 9998
# the port number to bind to for read requests
handlersocket_plain_secret = hsr9998
# Authentication for the read-only listener on port 9998

loose_handlersocket_port_wr = 9999
# the port number to bind to for write requests
handlersocket_plain_secret_wr = hsw9999
# Authentication for the write listener on port 9999

loose_handlersocket_threads = 8
# the number of worker threads for read requests
loose_handlersocket_threads_wr = 1
# the number of worker threads for write requests
open_files_limit = 65535
# to allow handlersocket to accept many concurrent
# connections, make open_files_limit as large as
# possible.

# charset
skip-character-set-client-handshake
init_connect            = 'SET NAMES utf8'
character-set-server    = utf8
collation-server        = utf8_unicode_ci


重新啟動 mysql...這樣就可以囉~~