memcached在linux上的安装方法
发布日期:2021-09-30 18:10:51 浏览次数:15 分类:技术文章

本文共 3006 字,大约阅读时间需要 10 分钟。

可以使用在线代理www.tvdaili.com 访问官方站点
1、memcached的官网地址:http://memcached.org/
在官网上面下载最新的版本(当前是memcached-1.4.22.tar.gz)
2、Libevent的官网地址:http://www.monkey.org/~provos/libevent/
目前的版本是libevent-2.0.21-stable.tar.gz
libevent 是安装 memcached 的唯一前提条件。它是 memcached 所依赖的异步事件通知库。
安装的方法:
1.分别把memcached和libevent下载回来,放到 /tmp 目录下:
2.先安装libevent:
# tar zxvf libevent-2.0.21-stable.tar.gz
# cd libevent-2.0.21-stable
# ./configure cprefix=/usr
# make
# make install
3.测试libevent是否安装成功:
# ls -al /usr/local/lib|grep libevent
lrwxrwxrwx 1 root root 21 Jan 6 01:44 libevent-2.0.so.5 -> libevent-2.0.so.5.1.9
-rwxr-xr-x 1 root root 968674 Jan 6 01:44 libevent-2.0.so.5.1.9
-rw-r--r-- 1 root root 1571578 Jan 6 01:44 libevent.a
lrwxrwxrwx 1 root root 26 Jan 6 01:44 libevent_core-2.0.so.5 -> libevent_core-2.0.so.5.1.9
-rwxr-xr-x 1 root root 585217 Jan 6 01:44 libevent_core-2.0.so.5.1.9
-rw-r--r-- 1 root root 978306 Jan 6 01:44 libevent_core.a
-rwxr-xr-x 1 root root 976 Jan 6 01:44 libevent_core.la
lrwxrwxrwx 1 root root 26 Jan 6 01:44 libevent_core.so -> libevent_core-2.0.so.5.1.9
lrwxrwxrwx 1 root root 27 Jan 6 01:44 libevent_extra-2.0.so.5 -> libevent_extra-2.0.so.5.1.9
-rwxr-xr-x 1 root root 404844 Jan 6 01:44 libevent_extra-2.0.so.5.1.9
-rw-r--r-- 1 root root 593344 Jan 6 01:44 libevent_extra.a
-rwxr-xr-x 1 root root 983 Jan 6 01:44 libevent_extra.la
lrwxrwxrwx 1 root root 27 Jan 6 01:44 libevent_extra.so -> libevent_extra-2.0.so.5.1.9
-rwxr-xr-x 1 root root 941 Jan 6 01:44 libevent.la
lrwxrwxrwx 1 root root 29 Jan 6 01:44 libevent_openssl-2.0.so.5 -> libevent_openssl-2.0.so.5.1.9
-rwxr-xr-x 1 root root 94265 Jan 6 01:44 libevent_openssl-2.0.so.5.1.9
-rw-r--r-- 1 root root 131908 Jan 6 01:44 libevent_openssl.a
-rwxr-xr-x 1 root root 1012 Jan 6 01:44 libevent_openssl.la
lrwxrwxrwx 1 root root 29 Jan 6 01:44 libevent_openssl.so -> libevent_openssl-2.0.so.5.1.9
lrwxrwxrwx 1 root root 30 Jan 6 01:44 libevent_pthreads-2.0.so.5 -> libevent_pthreads-2.0.so.5.1.9
-rwxr-xr-x 1 root root 18422 Jan 6 01:44 libevent_pthreads-2.0.so.5.1.9
-rw-r--r-- 1 root root 18662 Jan 6 01:44 libevent_pthreads.a
-rwxr-xr-x 1 root root 1004 Jan 6 01:44 libevent_pthreads.la
lrwxrwxrwx 1 root root 30 Jan 6 01:44 libevent_pthreads.so -> libevent_pthreads-2.0.so.5.1.9
lrwxrwxrwx 1 root root 21 Jan 6 01:44 libevent.so -> libevent-2.0.so.5.1.9
还不错,都安装上了。
4.安装memcached,同时需要安装中指定libevent的安装位置:
# cd /tmp
# tar zxvf memcached-1.4.22.tar.gz
# cd memcached-1.4.22
# ./configure -with-libevent=/usr/local/
# make
# make install
如果中间出现报错,请仔细检查错误信息,按照错误信息来配置或者增加相应的库或者路径。
安装完成后会把memcached放到 /usr/local/bin/memcached ,
5.测试是否成功安装memcached:
# ls -al /usr/local/bin/mem*
-rwxr-xr-x 1 root root 341882 Jan 6 01:14 /usr/local/bin/memcached
6.启动Memcached服务:
1.启动Memcache的服务器端:
# /usr/local/bin/memcached -d -m 10 -u root -l 192.168.11.50 -p 12000 -c 256 -P /tmp/memcached.pid
7.测试
# telnet 192.168.11.50 12000
Trying 192.168.11.50...
Connected to 192.168.11.50.
Escape character is '^]'.
set key1 0 60 4
zhou
STORED
get key1
VALUE key1 0 4
zhou
END

转载地址:https://blog.csdn.net/iteye_10343/article/details/82612377 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:guzz的批量增加的功能
下一篇:Can't connect to local MySQL server through socket 问题解决

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年04月06日 11时18分50秒