如何在solaris下安装memcached
準備工作
?因此此次選擇了 libevent-1.4.12-stable.tar.gz? 以及 memcached-1.2.8.tar.gz
?
準備安裝
?? ?gzip -d libevent-1.4.12-stable.tar.gz
??? tar xvf libevent-1.4.12-stable.tar
?? ?gzip -d memcached-1.2.8.tar.gz
??? tar? xvf memcached-1.2.8.tar
?
?????????
?
?
???安裝libevent
??? 切換至root賬號
# cd opt/kpiroot/zhenpei/libevent-1.4.12-stable??????
# ./configure --prefix= /opt/kpiroot/libevent??????????????? (準備安裝到的地址--自己某個用戶下的地址)?????
# make??????
# make install??
檢查是否安裝成功:
進入
# cd /opt/kpiroot/libevent/lib
如果有:
?? libevent-1.4.so.2?
?? libevent-1.4.so.2.0.0?
?? libevent.a?
?? libevent.la?
?? libevent.so
?? 這幾個文件存在,說明安裝成功
?
安裝 memcached
?
? 切換至root賬號
# cd memcached-1.4.2????
# ./configure --with-libevent=/opt/kpiroot/libevent? --prefix=/opt/kpiroot/memcached????
# make??????
# make install?
#cd /opt/kpiroot/memcached
#memcached -h
如果報錯 如 memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
解決方法是
第一步:找到libevent-1.4.so.2 用 find / -name libevent-1.4.so.2
第二步:#LD_DEBUG=libs ./memcached -v
?????????? 此時會打出很多東西 找到報libevent-1.4.so.2真正指向的地址
第三步:#ln -s /opt/kpiroot/libevent/lib/libevent-1.4.so.2? /usr/lib/libevent-1.4.so.2?? (我機器上是這個地址,服務器不同地址可能不同)
第四步:#memcached -h? 如還有報錯,則重復上述過程? 正確時是:
????? memcached 1.2.8
-p <num>????? TCP port number to listen on (default: 11211)
-U <num>????? UDP port number to listen on (default: 11211, 0 is off)
-s <file>???? unix socket path to listen on (disables network support)
-a <mask>???? access mask for unix socket, in octal (default 0700)
-l <ip_addr>? interface to listen on, default is INDRR_ANY
-d??????????? run as a daemon
-r??????????? maximize core file limit
-u <username> assume identity of <username> (only when run as root)
-m <num>????? max memory to use for items in megabytes, default is 64 MB
-M??????????? return error on memory exhausted (rather than removing items)
-c <num>????? max simultaneous connections, default is 1024
-k??????????? lock down all paged memory.? Note that there is a
????????????? limit on how much memory you may lock.? Trying to
????????????? allocate more than that would fail, so be sure you
????????????? set the limit correctly for the user you started
????????????? the daemon with (not for -u <username> user;
????????????? under sh this is done with 'ulimit -S -l NUM_KB').
-v??????????? verbose (print errors/warnings while in event loop)
-vv?????????? very verbose (also print client commands/reponses)
-h??????????? print this help and exit
-i??????????? print memcached and libevent license
-P <file>???? save PID in <file>, only used with -d option
-f <factor>?? chunk size growth factor, default 1.25
-n <bytes>??? minimum space allocated for key+value+flags, default 48
-L??????????? Try to use large memory pages (if available). Increasing
????????????? the memory page size could reduce the number of TLB misses
????????????? and improve the performance. In order to get large pages
????????????? from the OS, memcached will allocate the total item-cache
????????????? in one large chunk.
-R??????????? Maximum number of requests per event
????????????? limits the number of requests process for a given con nection
????????????? to prevent starvation.? default 20
-b??????????? Set the backlog queue limit (default 1024)
?
?
?
??
總結
以上是生活随笔為你收集整理的如何在solaris下安装memcached的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: clickhouse数据手动迁移
- 下一篇: weblogic 的域信任问题