http://memcached.org/ 下载解压进入目录,阅读README
Dependencies:
-- libevent, http://www.monkey.org/~provos/libevent/ (libevent-dev)
If using Linux, you need a kernel with epoll. Sure, libevent will
work with normal select, but it sucks.
epoll isn't in Linux 2.4, but there's a backport at:
http://www.xmailserver.org/linux-patches/nio-improve.html
You want the epoll-lt patch (level-triggered).
去下载libevent后,解压并进入目录,阅读README,
执行
$ ./configure
$ make
$ make verify # (optional)
$ sudo make install
果然在$ make verify # (optional)这一步报错:
EPOLL
test-eof: OKAY
test-weof: OKAY
test-time: OKAY
test-changelist: OKAY
regress: [Error code 3]
FAIL regress_dns.c:188: assert(dns_ok == DNS_PTR): 0 vs 2dns/gethostbyaddr:
FAIL regress_main.c:303: Legacy unit test failed
[gethostbyaddr FAILED]
1/177 TESTS FAILED. (0 skipped)
FAILED
就是Memcached文档中提到的epoll isn't in Linux 2.4。这个错误我暂时不去解决。
然后进入memcached目录,执行
$./configure
$sudo make install
现在我要启动memcached。
root@loveztt:/usr/local/bin# ./memcached restart
./memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
root@loveztt:/usr/local/bin# LD_DEBUG=libs /usr/local/bin/memcached -v
......
15730: trying file=/usr/lib/libevent-2.0.so.5
15730:
/usr/local/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
root@loveztt:/usr/local/bin# ln -s /home/zj/Downloads/ProgrammerSoft/libevent-2.0.16-stable/.libs/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
root@loveztt:/usr/local/bin# ./memcached restart
can't run as root without the -u switch
$su zj
$memcached
failed to listen on TCP port 11211: Address already in use
zj@loveztt:~$ netstat -ap | grep 11211
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
^C
zj@loveztt:~$ su
Password:
root@loveztt:/home/zj# netstat -ap | grep 11211
tcp 0 0 *:11211 *:* LISTEN 16110/memcached
tcp6 0 0 [::]:11211 [::]:* LISTEN 16110/memcached
udp 0 0 *:11211 *:* 16110/memcached
udp6 0 0 [::]:11211 [::]:* 16110/memcached
Dependencies:
-- libevent, http://www.monkey.org/~provos/libevent/ (libevent-dev)
If using Linux, you need a kernel with epoll. Sure, libevent will
work with normal select, but it sucks.
epoll isn't in Linux 2.4, but there's a backport at:
http://www.xmailserver.org/linux-patches/nio-improve.html
You want the epoll-lt patch (level-triggered).
去下载libevent后,解压并进入目录,阅读README,
执行
$ ./configure
$ make
$ make verify # (optional)
$ sudo make install
果然在$ make verify # (optional)这一步报错:
EPOLL
test-eof: OKAY
test-weof: OKAY
test-time: OKAY
test-changelist: OKAY
regress: [Error code 3]
FAIL regress_dns.c:188: assert(dns_ok == DNS_PTR): 0 vs 2dns/gethostbyaddr:
FAIL regress_main.c:303: Legacy unit test failed
[gethostbyaddr FAILED]
1/177 TESTS FAILED. (0 skipped)
FAILED
就是Memcached文档中提到的epoll isn't in Linux 2.4。这个错误我暂时不去解决。
然后进入memcached目录,执行
$./configure
$sudo make install
现在我要启动memcached。
root@loveztt:/usr/local/bin# ./memcached restart
./memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
root@loveztt:/usr/local/bin# LD_DEBUG=libs /usr/local/bin/memcached -v
......
15730: trying file=/usr/lib/libevent-2.0.so.5
15730:
/usr/local/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
root@loveztt:/usr/local/bin# ln -s /home/zj/Downloads/ProgrammerSoft/libevent-2.0.16-stable/.libs/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
root@loveztt:/usr/local/bin# ./memcached restart
can't run as root without the -u switch
$su zj
$memcached
failed to listen on TCP port 11211: Address already in use
zj@loveztt:~$ netstat -ap | grep 11211
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
^C
zj@loveztt:~$ su
Password:
root@loveztt:/home/zj# netstat -ap | grep 11211
tcp 0 0 *:11211 *:* LISTEN 16110/memcached
tcp6 0 0 [::]:11211 [::]:* LISTEN 16110/memcached
udp 0 0 *:11211 *:* 16110/memcached
udp6 0 0 [::]:11211 [::]:* 16110/memcached