安装memcached依赖包
[root@localhost tools]# yum install -y libevent libevent-devel nc -y
将memcached包上传至服务器
[root@localhost tools]# ls
memcached-1.4.13.tar.gz
安装memcached
[root@localhost tools]# ls
memcached-1.4.13.tar.gz
[root@localhost tools]# tar xf memcached-1.4.13.tar.gz
[root@localhost tools]# ls
memcached-1.4.13 memcached-1.4.13.tar.gz
[root@localhost tools]# cd memcached-1.4.13/
[root@localhost memcached-1.4.13]# ./configure
[root@localhost memcached-1.4.13]# make
[root@localhost memcached-1.4.13]# make install
启动memcached
[root@localhost ~]# memcached -m 16 -p 33211 -d -u root -c 8192
查看结果
[root@localhost ~]# lsof -i:33211
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
memcached 6373 root 26u IPv4 39764 0t0 TCP *:33211 (LISTEN)
memcached 6373 root 27u IPv6 39765 0t0 TCP *:33211 (LISTEN)
memcached 6373 root 28u IPv4 39768 0t0 UDP *:33211
memcached 6373 root 29u IPv6 39769 0t0 UDP *:33211
总结
这样memcached就安装成功了!