安装memcache集群管理工具

            安装memcache集群管理工具magent

一、安装libevent

tar xf libevent-2.0.-stable.tar.gz
cd libevent-2.0.
./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
#endif
ln -sv /usr/local/libevent/lib/libevent-2.0.so. /usr/lib/
cp magent /usr/bin/magent

查看是否安装成功及使用

命令帮助
Usage:
-h this message
-u uid
-g gid
-p port, default is . ( 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
-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
-v verbose
示例:
magent -u root -n  -l 10.1.1.244 -p  -s 10.1.1.244 -s 10.1.1.245
telnet 10.1.1.244
stats
memcached agent v0.
matrix -> 10.1.1.244:, pool size
matrix -> 10.1.1.245:, pool size
END
quit

上一篇:Uedit个人专注


下一篇:[转]NET Core中实现一个Token base的身份认证