首先安装“Memcached”需要依赖“libevent libevent-devel”文件,因此我们使用“yum”来安装
[
root@
Jason
soft]
# yum install libevent libevent-devel
当前最新版本为v1.4.17
[
root@
Jason
soft]
# tar -zxvf memcached-1.4.17.tar.gz
[
root@
Jason
soft]
# cd memcached-1.4.17
[
root@
Jason
memcached-1.
4.17]
# ./configure --prefix=/usr/local/memcached
这样更适合在64位系统中稳定运行
[
root@
Jason
memcached-1.
4.17]
# ./configure --prefix=/usr/local/memcached --enable-64bit
[
root@
Jason
memcached-1.
4.17]
# make && make install
[
root@
Jason
memcached-1.
4.17]
# /usr/local/memcached/bin/memcached -d -u root -m 512 -p 11211
启
动
参
数
说
明
:
-
d
选
项
是
启
动
一
个
守
护
进
程
。
-
u
root
表
示
启
动
memcached
的
用
户
为
root
。
-
m
是
分
配
给
Memcache
使
用
的
内
存
数
量
,
单
位
是
MB
,
默
认64
MB
。
-
p
是
设
置
Memcache
的
TCP
监
听
的
端
口
,
默
认
为
11211
[
root@
Jason
memcached-1.
4.17]
# pgrep memcached
3115
[
root@
Jason
memcached-1.
4.17]
# netstat -tulpn | grep :11211
tcp
0
0
0.0.
0.0:
11211
0.0.
0.0:
*
LISTEN
3115/
memcached
udp
0
0
0.0.
0.0:
11211
0.0.
0.0:
*
3115/
memcached
[
root@
Jason
memcached-1.
4.17]
# ps -ef | grep memcached
root
3115
1
0
23:
49 ?
00:
00:
00 /
usr/
local/
memcached/
bin/
memcached
-
d
-
u
root
-
p
11211
-
m
512
root
3143
3028
0
23:
55
pts/
0
00:
00:
00
grep
memcached
|