magent + memcached架构图
安装步骤如下:
------------------10.1.64.196 10.1.64.197 10.1.65.104 10.1.65.107 memcached (存储节点)----------------------------------------
yum install gcc
mkdir /usr/local/src/memcached
cd /usr/local/src/memcached
tar -xzvf ./libevent-2.0.22-stable.tar.gz
cd ./libevent-2.0.22-stable
./configure --prefix=/usr
make && make install
cd /usr/local/src/memcached
tar -xzvf memcached-1.4.24.tar.gz
cd memcached-1.4.24
mkdir /usr/local/memcached
./configure --prefix=/usr/local/memcached --with-libevent=/usr
make && make install
cd /usr/local/memcached/bin
./memcached -u root -d -m 2048 -l 10.1.64.196 -p 11211 -P /tmp/memcached.pid
-----------------------10.1.65.105 magent (控制节点)-------------------------------------------------------------------
yum install gcc
mkdir /usr/local/src/memcached
cd /usr/local/src/memcached
tar -xzvf ./libevent-2.0.22-stable.tar.gz
cd ./libevent-2.0.22-stable
./configure --prefix=/usr
make && make install
mkdir /usr/local/magent
cd /usr/local/magent
tar xzvf ./magent-0.6.tar.gz
/sbin/ldconfig
sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile
vim ketama.h
#在开头加入
#ifndef SSIZE_MAX
#define SSIZE_MAX 32767
#endif
ln -s /usr/lib/libevent* /usr/lib64/
yum install -y glibc glibc-devel
cp /usr/lib64/libm.so /usr/lib64/libm.a
vim ./Makefile
将
CFLAGS = -Wall -g -O2 -I/usr/local/include $(M64)
改为:
CFLAGS = -lrt -Wall -g -O2 -I/usr/local/include $(M64)
make
cp magent /usr/bin/magent
magent -u root -n 51200 -l 192.168.1.2 -p 12000 -s 192.168.1.4:11211 -s 192.168.1.5:11211 -s 192.168.1.6:11211 -b 192.168.1.7:11211 -b 192.168.1.8:11211