顿搜
飞过闲红千叶,夕岸在哪
类目归类
首先下载libevent-2.0.22-stable.tar.gz,然后
tar -zxvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure
make
sudo make install
make cleanwget https://memcached.org/latest #将文件下载地址替换成想要的版本
tar -xzvf memcached-1.4.31.tar.gz
cd memcached-1.4.31
./configure
make
sudo make install
make cleanmemcached -d -u dunso -m 512m -p 11211 -P /tmp/11211.pid出现错误:
memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory是因为找不到libevent-2.0.so.5文件,查看该文件在什么位置
whereis libevent-2.0.so.5发现在/usr/local/lib/libevent-2.0.so.5,然后查看mc是否能找到
ldd /usr/local/bin/memcachedlinux-vdso.so.1 => (0x00007ffe88f2f000)
libevent-2.0.so.5 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f76cdaba000)
libc.so.6 => /lib64/libc.so.6 (0x00007f76cd6f8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f76cdcdd000)
发现找不到,然后
cd /usr/local/bin
LD_DEBUG=libs ./memcached -v17605: find library=libevent-2.0.so.5 [0]; searching
17605: search cache=/etc/ld.so.cache
17605: 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)
17605: trying file=/lib64/tls/x86_64/libevent-2.0.so.5
17605: trying file=/lib64/tls/libevent-2.0.so.5
17605: trying file=/lib64/x86_64/libevent-2.0.so.5
17605: trying file=/lib64/libevent-2.0.so.5
17605: trying file=/usr/lib64/tls/x86_64/libevent-2.0.so.5
17605: trying file=/usr/lib64/tls/libevent-2.0.so.5
17605: trying file=/usr/lib64/x86_64/libevent-2.0.so.5
17605: trying file=/usr/lib64/libevent-2.0.so.5
发线memcached查找目录是/usr/lib64/libevent-2.0.so.5,所以我们在此处给它建立软链
sudo ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5然后再次查看
ldd /usr/local/bin/memcachedlinux-vdso.so.1 => (0x00007ffe00d15000)
libevent-2.0.so.5 => /lib64/libevent-2.0.so.5 (0x00007f2e71097000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2e70e7b000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2e70ab8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2e712e4000)
发现已经可以找到了,然后启动mc
memcached -d -u dunso -m 512m -p 11211 -P /tmp/11211.pidsudo yum install telnet-server
sudo yum install telnettelnet 127.0.0.1 11211Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
输入stats可查看相应信息,如pid