大家好,又見面了,我是你們的朋友全棧君。
HandlerSocket 是MySQL的一個插件,用來實作 NoSQL 功能,用于跳過MySQL的SQL層面,直接通路内部的InnoDB存儲引擎。
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.11-1.rhel4.i386.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.11-1.rhel4.i386.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.11-1.rhel4.i386.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-5.5.11-1.rhel4.i386.rpm
rpm -ivh MySQL-client-5.5.11-1.rhel4.i386.rpm MySQL-devel-5.5.11-1.rhel4.i386.rpm MySQL-server-5.5.11-1.rhel4.i386.rpm MySQL-shared-5.5.11-1.rhel4.i386.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.11.tar.gz
一、安裝HandlerSocket
擷取安裝包:https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.git
tar -zxvf ahiguti-HandlerSocket-Plugin-for-MySQL-1.0.6-73-g0e63366.tar.gz
cd ahiguti-HandlerSocket-Plugin-for-MySQL-0e63366/
./autogen.sh
./configure –with-mysql-source=/home/xinze/software/mysql-5.5.11 –with-mysql-bindir=/usr/bin –with-mysql-plugindir=/usr/lib/mysql/plugin
make && make install
修改/etc/my.cnf 配置
[mysqld]
plugin-load=handlersocket.so
loose_handlersocket_port = 9998 # 指定讀請求端口号
# the port number to bind to (for read requests)
loose_handlersocket_port_wr = 9999 # 指定寫請求端口号
# the port number to bind to (for write requests)
loose_handlersocket_threads = 16 # 指定讀線程數目
# 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 accept many concurrent
# connections, make open_files_limit as large as
# possible.
在mysql裡加載HandlerSocket插件:
mysql> INSTALL PLUGIN handlersocket SONAME “handlersocket.so”;
mysql>SHOW PLUGINS; # 檢視插件是否加載成
mysql>SHOW PROCESSLIST; # 檢視handlersocket是否正常運作
* 如果SHOW PROCESSLIST沒有handlersocket 程序, 則先關閉SELinux後再試試看看。
* 在ubuntu下,可以先 /etc/init.d/apparmor stop 然後重新開機MySQL, 然後 /etc/init.d/apparmor start
二、安裝 php-handlersocket 子產品:
wget http://php-handlersocket.googlecode.com/files/php-handlersocket-0.1.0.tar.gz
tar zxvf php-handlersocket-0.1.0.tar.gz
cd php-handlersocket
phpize
./configure
make
make install
釋出者:全棧程式員棧長,轉載請注明出處:https://javaforall.cn/172624.html原文連結:https://javaforall.cn