Memcached安装

首先现在最新版本memcached,以为memcached对libevent有依赖,所以也要一起下下来

wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
然后下加压安装libevent

sudo ./configure -prefix=/usr/local/
sudo make
sudo make install
查看libevent是否安装成功

[dongji@localhost libevent-2.0.21-stable]$ ls /usr/local/lib | grep libevent
libevent-2.0.so.5
libevent-2.0.so.5.1.9
libevent.a
libevent_core-2.0.so.5
libevent_core-2.0.so.5.1.9
libevent_core.a
libevent_core.la
libevent_core.so
libevent_extra-2.0.so.5
libevent_extra-2.0.so.5.1.9
libevent_extra.a
libevent_extra.la
libevent_extra.so
libevent.la
libevent_pthreads-2.0.so.5
libevent_pthreads-2.0.so.5.1.9
libevent_pthreads.a
libevent_pthreads.la
libevent_pthreads.so
libevent.so
没问题,接下来继续安装memcached

tar zxvf memcached-1.4.15.tar.gz
cd memcached-1.4.15
./configure -prefix=/usr/local/
sudo make
sudo make install
安装完成后会把memcached放到 /usr/local/bin/memcached 

[dongji@localhost memcached-1.4.15]$ ls -al /usr/local/bin/memcached 
-rwxr-xr-x. 1 root root 255417 Dec 20 14:55 /usr/local/bin/memcached
完成完毕。接下来就可以启动memcached了

[dongji@localhost ~]$ /usr/local/bin/memcached -d -u dongji -m 125 -l 192.168.29.128 -p 11211
/usr/local/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
后来发现是没有建立软链接

sudo ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
/usr/local/bin/memcached -d -u dongji -m 125 -l 192.168.29.128 -p 11211
就没有问题了

然后再查看进程

[dongji@localhost ~]$ ps -ef | grep memcached
dongji   17803     1  0 15:15 ?        00:00:00 /usr/local/bin/memcached -d -u dongji -m 125 -l 192.168.29.128 -p 11211

[dongji@localhost ~]$ telnet 192.168.29.128 11211
Trying 192.168.29.128...
Connected to 192.168.29.128.
Escape character is '^]'.
安装成功

你可能感兴趣的:(Install,memcached,memcached安装)