Mysql+handlerSocket

OS:Centos

        1.安装编译时所需文件

            yum install bison gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libtool-ltdl-devel*

        2.安装Cmake

            wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
            tar zxvf cmake-2.8.6.tar.gz
           cd cmake-2.8.6/

           ./configure
           gmake
           gmake install

         3.下载Mysql源码安装Mysql

             wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/http://mysql.ntu.edu.tw/

              tar -xzvf mysql-5.5.17.tar.gz

             cp mysql-5.5.17.tar.gz /usr/local

             tar -xzvf mysql-5.5.17.tar.gz

             mv mysql-5.5.17 mysql

             cd mysql

             cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data 

                          -DSYSCONFDIR=/etc/

             make

             make install

             初始化数据库

             scripts/mysql_install_db --user=mysql

             ps:如果此处遇到权限不够的错误,请将mysql_install_db 的权限+x

                  chmod +x  mysql_install_db

             启数据库

             bin/mysqld_safe --user=mysql &

             

             cp ./support-files/my-huge.cnf /etc/my.cnf

             cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

             chmod +x /etc/init.d/mysqld

             chkconfig --add mysqld

             进入数据库

             bin/mysql

          4.安装handlersocket

             从 https://github.com/DeNADev/HandlerSocket-Plugin-for-MySQL/downloads获得安装包 上传到服务器

             tar -xzvf ahiguti-HandlerSocket-Plugin-for-MySQL-1[1].1.0-2-g395fa55.tar.gz

             cd ahiguti-HandlerSocket-Plugin-for-MySQL-395fa55

             ./autogen.sh

             ./configure --with-mysql-source=/usr/local/mysql --with-mysql-bindir=/usr/local/mysql/bin

             make

             make install


             在my.cnf中添加相关参数

              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

               

               重启mysql服务

               service mysqld restart

               重启mysql服务后install plugin

               mysql> INSTALL PLUGIN handlersocket soname 'handlersocket.so';

             

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值