lnmp memcached.docx
- 文档编号:3005280
- 上传时间:2022-11-17
- 格式:DOCX
- 页数:23
- 大小:266.78KB
lnmp memcached.docx
《lnmp memcached.docx》由会员分享,可在线阅读,更多相关《lnmp memcached.docx(23页珍藏版)》请在冰豆网上搜索。
lnmpmemcached
一.安装memcached所需的软件libevent-2.0.21-stable.tar.gz
[root@node1/]#tar-zxvflibevent-2.0.21-stable.tar.gz
[root@node1libevent-2.0.21-stable]#./configure--help|less
[root@node1libevent-2.0.21-stable]#rpm-qa|greplibevent
libevent-1.4.13-1
[root@node1libevent-2.0.21-stable]#./configure--prefix=/usr/local/libevent
[root@node1libevent-2.0.21-stable]#make&&makeinstall
[root@node1memcached-1.4.5]#rpm-qa|grepsasl
cyrus-sasl-plain-2.1.22-5.el5_4.3
cyrus-sasl-lib-2.1.22-5.el5_4.3
cyrus-sasl-2.1.22-5.el5_4.3
二.安装memcached篇
[root@node1memcached-1.4.5]#yum-yinstallcyrus-sasl-devel
[root@node1memcached-1.4.5]#./configure--enable-sasl--prefix=/usr/local/memcached--with-libevent=/usr/local/libevent
[root@node1memcached-1.4.5]#make&&makeinstall
[root@localhostmemcached-1.4.5]#ldd/usr/local/memcached/bin/memcached#查看链接的文件
linux-vdso.so.1=>(0x00007fff76b36000)
libsasl2.so.2=>/usr/lib64/libsasl2.so.2(0x00007f56f7b6d000)
libevent-2.0.so.5=>notfound
libpthread.so.0=>/lib64/libpthread.so.0(0x00000035f9400000)
libc.so.6=>/lib64/libc.so.6(0x00000035f9000000)
libdl.so.2=>/lib64/libdl.so.2(0x00000035f8c00000)
libresolv.so.2=>/lib64/libresolv.so.2(0x00000035fb800000)
libcrypt.so.1=>/lib64/libcrypt.so.1(0x0000003604400000)
/lib64/ld-linux-x86-64.so.2(0x00000035f8800000)
libfreebl3.so=>/lib64/libfreebl3.so(0x0000003604000000)
报错解决方法:
#搜索libevent-2.0.so.5路径在哪里,安装的路径/usr/local/libevent/lib/libevent-2.0.so.5
[root@localhostmemcached-1.4.5]#LD_DEBUG=libs./memcached-v
479:
findlibrary=libsasl2.so.2[0];searching
479:
searchcache=/etc/ld.so.cache
479:
tryingfile=/usr/lib64/libsasl2.so.2
479:
479:
findlibrary=libevent-2.0.so.5[0];searching
479:
searchcache=/etc/ld.so.cache
479:
searchpath=/lib64/tls/x86_64:
/lib64/tls:
/lib64/x86_64:
/lib64:
/usr/lib64/tls/x86_64:
/usr/lib64/tls:
/usr/lib64/x86_64:
/usr/lib64(systemsearchpath)
479:
tryingfile=/lib64/tls/x86_64/libevent-2.0.so.5
479:
tryingfile=/lib64/tls/libevent-2.0.so.5
479:
tryingfile=/lib64/x86_64/libevent-2.0.so.5
479:
tryingfile=/lib64/libevent-2.0.so.5
479:
tryingfile=/usr/lib64/tls/x86_64/libevent-2.0.so.5
479:
tryingfile=/usr/lib64/tls/libevent-2.0.so.5
479:
tryingfile=/usr/lib64/x86_64/libevent-2.0.so.5
479:
tryingfile=/usr/lib64/libevent-2.0.so.5
479:
./memcached:
errorwhileloadingsharedlibraries:
libevent-2.0.so.5:
cannotopensharedobjectfile:
Error40
搜索路径为:
/lib64/usr/lib64
因此做一个软连接到/lib64目录下;
#ln-s/usr/local/libevent/lib/libevent-2.0.so.5/lib64/libevent-2.0.so.5
[root@localhostmemcached-1.4.5]#ldd/usr/local/memcached/bin/memcached
linux-vdso.so.1=>(0x00007fffc63ff000)
libsasl2.so.2=>/usr/lib64/libsasl2.so.2(0x00007fbc9aad2000)
libevent-2.0.so.5=>/lib64/libevent-2.0.so.5(0x00007fbc9a88d000)
libpthread.so.0=>/lib64/libpthread.so.0(0x00000035f9400000)
libc.so.6=>/lib64/libc.so.6(0x00000035f9000000)
libdl.so.2=>/lib64/libdl.so.2(0x00000035f8c00000)
libresolv.so.2=>/lib64/libresolv.so.2(0x00000035fb800000)
libcrypt.so.1=>/lib64/libcrypt.so.1(0x0000003604400000)
librt.so.1=>/lib64/librt.so.1(0x00000035f9800000)
/lib64/ld-linux-x86-64.so.2(0x00000035f8800000)
libfreebl3.so=>/lib64/libfreebl3.so(0x0000003604000000)
x8632位服务器,解决的方法:
把安装的libevent的路径下的libevent-2.0.so.5,链接到以我安装的为例:
libevent的路径/usr/local/libevent/lib/libevent-2.0.so.5
#[root@node1lib]#ln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/lib/libevent-2.0.so.5
[root@node1lib]#ldd/usr/local/memcached/bin/memcached
linux-gate.so.1=>(0x00db6000)
libsasl2.so.2=>/usr/lib/libsasl2.so.2(0x00845000)
libevent-2.0.so.5=>/usr/lib/libevent-2.0.so.5(0x001ca000)
libpthread.so.0=>/lib/libpthread.so.0(0x00cb2000)
libc.so.6=>/lib/libc.so.6(0x00b3b000)
libdl.so.2=>/lib/libdl.so.2(0x00cac000)
libresolv.so.2=>/lib/libresolv.so.2(0x008b9000)
libcrypt.so.1=>/lib/libcrypt.so.1(0x07f9e000)
librt.so.1=>/lib/librt.so.1(0x07996000)
/lib/ld-linux.so.2(0x00b18000)
三.启动memcached
1.memcached启动选项:
-p
11211)
-U
11211,0isoff)
-s
-a
0700)
-l
alladdresses)
-d启动一个守护进程
-r最大限度利用核心文件限制
-u
-m
64MB)
-M内存耗尽返回错误
-c
1024)
-k锁定所有分页内存
-v输出警告和错误信息
-vv同时打印客户端请求和返回信息
-vvv打印内部状态转换信息
-i打印memcached和libevent版本信息
-P
-f
1.25)
-n
48)
-L如何有效,尝试使用大内存页。
增加内存页大小可以减少失误的TLB数量,提高性能。
-D
"(colon).如果指定此选项,统计信息收集自动开启;
-t
4)
-R每个事件的最大请求数(default:
20)
-C禁止使用CAS
-b设置积压队列数限制(default:
1024)
-B绑定协议-oneofascii,binary
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- lnmp memcached