前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >handlersocket mysql,MySQL插件HandlerSocket

handlersocket mysql,MySQL插件HandlerSocket

作者头像
全栈程序员站长
发布2022-09-23 11:14:10
4310
发布2022-09-23 11:14:10
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档