设为首页 加入收藏

TOP

memcached安装和验证
2015-07-24 11:13:59 来源: 作者: 【 】 浏览:1
Tags:memcached 安装 验证

1》 libevent安装

官网down: http://www.monkey.org

我的网盘down:http://pan.baidu.com/s/1qW8syZi

[root@luozhonghua memcachedsource]# tar -zxvf libevent-1.4.13-stable.tar.gz

[root@luozhonghua memcachedsource]# cd libevent-1.4.13-stable

[root@luozhonghua memcachedsource]# ./configure --prefix=/usr

[root@luozhonghua memcachedsource]# make && make install

#./configure --prefix=/usr && make && make install

这里一定要注意指定--prefix,后面配置memcached的时候就有必要用到。

2》 memcached安装

官网down: http://www.monkey.org

我的网盘down:http://pan.baidu.com/s/1qW8syZi

[root@luozhonghua memcachedsource]# tar -zxvf memcached-1.4.5.tar.gz

[root@luozhonghua memcachedsource]# cd memcached-1.4.5

[root@luozhonghua memcached-1.4.5]# ./configure --with-libevent=/usr/lib

[root@luozhonghua memcached-1.4.5]# make && make install

# ./configure --with-libevent=/usr/lib && make && make install

这里一定要指定libevent的路径,否则启动的时候就有找不到libevent的so文件的错误!

3> memcached 启动

# /usr/local/bin/memcached -m 32m -p 11211 -d -u root -P /var/run/memcached.pid -c 256 -vv

/usr/local/bin/memcached -d -m 512 -p 11211 -u root -c 256 -P /var/run/memcached.pid

4> memcached 关闭

kill -9 `cat /var/run/memcached.pid`

注意,如果`cat /var/run/memcached.pid`值是缓存上一次的就无效,可直接查到pid值=7787

5>测试

5.1> telnet 127.0.0.1 11211

5.2> stats

stats

STAT pid 7787

STAT uptime 470

STAT time 1405273052

STAT version 1.4.5

STAT pointer_size 32

STAT rusage_user 0.002999

STAT rusage_system 0.101984

STAT curr_connections 10

STAT total_connections 12

STAT connection_structures 11

STAT cmd_get 0

STAT cmd_set 0

STAT cmd_flush 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 auth_cmds 0

STAT auth_errors 0

STAT bytes_read 27

STAT bytes_written 49

STAT limit_maxbytes 536870912

STAT accepting_conns 1

STAT listen_disabled_num 0

STAT threads 4

STAT conn_yields 0

STAT bytes 0

STAT curr_items 0

STAT total_items 0

STAT evictions 0

STAT reclaimed 0

END

6》 退出

quit

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇【翻译自mos文章】oraclelinux和.. 下一篇操作系统的时区设置会影响数据库..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·用 C 语言或者限制使 (2025-12-25 08:50:05)
·C++构造shared_ptr为 (2025-12-25 08:50:01)
·既然引用计数在做 GC (2025-12-25 08:49:59)
·Java 编程和 c 语言 (2025-12-25 08:19:48)
·. net内存管理宝典这 (2025-12-25 08:19:46)