root@com:~# service memcached start #启动memcached
root@com:~# ss -tnl | grep 11211
LISTEN 0 128 172.31.11.96:11211 *:*
root@com:~# service memcached status #查看memcached的是否已启动
● memcached.service - memcached daemon
Loaded: loaded (/lib/systemd/system/memcached.service; enabled)
Active: active (running) since Thu 2015-08-13 14:06:44 CST; 2min 47s ago
Main PID: 17416 (memcached)
CGroup: /system.slice/memcached.service
└─17416 /usr/bin/memcached -m 1024 -p 11211 -u memcache -l 172.31.11.96
root@com:~# service memcached stop #停止memcached
root@com:~# chkconfig --list | grep memcached #查看在哪些启动级别memcached是自启动
memcached 0:off 1:off 2:on 3:on 4:on 5:on 6:off
4、Memcached测试
Xshell:\> telnet 172.31.11.96 11211 #我这里直接用xshell工具进行测试
Connecting to 172.31.11.96:11211...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
stats #输入stats命令获取到memcached的状态信息
STAT pid 17416
STAT uptime 1637
STAT time 1439447639
STAT version 1.4.21
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 0.036000
STAT rusage_system 0.052000
STAT curr_connections 5
STAT total_connections 7
STAT connection_structures 6
STAT reserved_fds 20
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT cmd_touch 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 22
STAT bytes_written 1103
STAT limit_maxbytes 1073741824 #这里是内存大小,单位是字节
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 524288
STAT hash_is_expanding 0
STAT malloc_fails 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT expired_unfetched 0
STAT evicted_unfetched 0
STAT evictions 0
STAT reclaimed 0
STAT crawler_reclaimed 0
STAT lrutail_reflocked 0
END
------------------------------------------分割线------------------------------------------
CentOS 6.6下Memcached 源码安装配置
Ubuntu下安装Memcached及命令解释