安装memcache集群管理工具

            安装memcache集群管理工具magent

一、安装libevent

tar xf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20
./configure --prefix=/usr/local/libevent
make && make install

echo "/usr/local/libevent/lib" > /etc/ld.so.conf.d/libevent.conf
ldconfig 

二、安装magent

mkdir /usr/local/magent
tar xf magent-0.5.tar.gz -C  /usr/local/magent
/sbin/ldconfig 
cd /usr/local/magent/
vim Makefile LIBS = -levent -lm -L /usr/local/libevent/lib INCLUDE = -I /usr/local/libevent/include CFLAGS = -Wall -O2 -g CC = gcc PROGS = magent ..........(以下省略)
vim ketama.h (在文件起始行加下以下代码) #ifndef SSIZE_MAX #define SSIZE_MAX
32767 #endif
ln
-sv /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/ cp magent /usr/bin/magent

查看是否安装成功及使用

命令帮助
Usage:
  -h this message
  -u uid
  -g gid
  -p port, default is 11211. (0 to disable tcp support)
  -s ip:port, set memcached server ip and port
  -b ip:port, set backup memcached server ip and port
  -l ip, local bind ip address, default is 0.0.0.0
  -n number, set max connections, default is 4096
  -D don't go to background
  -k use ketama key allocation algorithm
  -f file, unix socket path to listen on. default is off
  -i number, set max keep alive connections for one memcached server, default is 20
  -v verbose
示例:
magent -u root -n 2048 -l 10.1.1.244 -p 8888 -s 10.1.1.244 -s 10.1.1.245
telnet 10.1.1.244 8888
stats
memcached agent v0.4
matrix 1 -> 10.1.1.244:11211, pool size 0
matrix 2 -> 10.1.1.245:11211, pool size 0
END
quit

 

posted @ 2017-11-17 15:26  百衲本  阅读(227)  评论(0编辑  收藏  举报
cnblogs_post_body { color: black; font: 0.875em/1.5em "微软雅黑" , "PTSans" , "Arial" ,sans-serif; font-size: 15px; } cnblogs_post_body h1 { text-align:center; background: #333366; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 23px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h2 { text-align:center; background: #006699; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 20px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h3 { background: #2B6695; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 18px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } 回到顶部 博客侧边栏 回到顶部 页首代码 回到顶部 页脚代码