码迷,mamicode.com
首页 > 系统相关 > 详细

memcache基本操作(包括错误问题)

时间:2015-04-07 20:05:12      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:memcache

一、出现问题

[root@jago-dbtest memcached-1.4.17]# /usr/local/bin/memcached -d -m 10 -u root  -p 11211 -c 32 -P /tmp/memcached.pid

/usr/local/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

二、解决办法

2.1、查找文件实际位置

[root@jago-dbtest memcached-1.4.17]# find / -name libevent-1.4.so.2

/home/libevent-1.4.14b-stable/.libs/libevent-1.4.so.2

/usr/local/lib/libevent-1.4.so.2

2.2、打印debug信息

[root@jago-dbtest memcached-1.4.17]# LD_DEBUG=libs /usr/local/bin/memcached -v

     24264: find library=libevent-1.4.so.2 [0]; searching

     24264: search cache=/etc/ld.so.cache

     24264: search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64 (system search path)

     24264:  trying file=/lib64/tls/x86_64/libevent-1.4.so.2

     24264:  trying file=/lib64/tls/libevent-1.4.so.2

     24264:  trying file=/lib64/x86_64/libevent-1.4.so.2

     24264:  trying file=/lib64/libevent-1.4.so.2

     24264:  trying file=/usr/lib64/tls/x86_64/libevent-1.4.so.2

     24264:  trying file=/usr/lib64/tls/libevent-1.4.so.2

     24264:  trying file=/usr/lib64/x86_64/libevent-1.4.so.2

     24264:  trying file=/usr/lib64/libevent-1.4.so.2

     24264:

/usr/local/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

2.3、软连接或者拷贝文件到所在目录

[root@jago-dbtest memcached-1.4.17]# ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2

三、启动

[root@jago-dbtest memcached-1.4.17]# /usr/local/bin/memcached -d -m 10 -u root  -p 11211 -c 32 -P /tmp/memcached.pid

四、检验memcached是否启动

[root@jago-dbtest memcached-1.4.17]# ps -ef|grep memcached | grep -v grep

root     24267     1  0 21:40 ?        00:00:00 /usr/local/bin/memcached -d -m 10 -u root -p 11211 -c 32 -P /tmp/memcached.pid

[root@jago-dbtest memcached-1.4.17]# 

五、杀掉memcached

[root@jago-dbtest memcached-1.4.17]# kill `cat /tmp/memcached.pid`


memcache基本操作(包括错误问题)

标签:memcache

原文地址:http://gfsunny.blog.51cto.com/990565/1629612

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!