日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

如何在solaris下安装memcached

發布時間:2025/3/15 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何在solaris下安装memcached 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

準備工作

  • 查看solaris內核 使用 uname -a 命令即可
  • 查看gcc版本 使用 gcc -v 命令? (本次測試是 gcc version 3.4.6)
  • 下載 libevent:http://www.monkey.org/~provos/libevent/
  • 下載 memcached? :http://code.google.com/p/memcached/downloads/list
  • ?因此此次選擇了 libevent-1.4.12-stable.tar.gz? 以及 memcached-1.2.8.tar.gz

    ?

    準備安裝

  • ?solaris下安裝memcached,需要先編譯libevent,而編譯libevent,需要配置gcc和make
  • ?解壓??將2個文件上傳至服務器 /opt/kpiroot/zhenpei/libevent-1.4.12-stable.tar.gz???/opt/kpiroot/zhenpei/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的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。