memcached安装
memcached安装
一、安装gcc # yum -y install gcc 二、安装libevent # wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz # tar zxf libevent-2.0.12-stable.tar.gz # cd libevent-2.0.12-stable #./configure --prefix=/software/libevent # make && make install 三、安装make # yum -y install make 四、下载安装最新版本:http://memcached.org/downloads # wget http://memcached.org/files/memcached-1.4.20.tar.gz # cd memcached-1.4.20 #./configure --prefix=/software/memcached --with-libevent=/software/libevent && make && make install
启动memcached
/software/memcached/bin/memcached -c 512 -d -u cdczhangg -m 2048 -p 11213
启动参数说明:
- -d是启动一个守护进程;
- -m是分配给Memcache使用的内存数量,单位是MB;
- -u是运行Memcache的用户;
- -l是监听的服务器IP地址,可以有多个地址;
- -p是设置Memcache监听的端口,,最好是1024以上的端口;
- -c是最大运行的并发连接数,默认是1024;
- -P是设置保存Memcache的pid文件。