memcached安裝
memcached安裝
關鍵字: memcached安裝memcached安裝
1. 下載, memcached需要先安裝libevent
memcached的下載地址:memcached/download.bml
libevent的下載地址 :~provos/libevent/
2. 安裝libevent
- # tar xzvf libevent-1.3c.tar.gz
- # cd libevent-1.3c
- # ./configure --prefix=/home/mahaibo/install
- # make
- # make install
檢查是否安裝成功:
#cd /home/mahaibo/install/lib
如果有libevent-1.3c.so.1 libevent-1.3c.so.1.0.3 libevent.a libevent.la libevent.so
這幾個檔案存在,說明安裝成功
3.安裝memcached
- # tar xzvf memcached-1.2.2.tar.gz
- # cd memcached-1.2.2
- # ./configure --with-libevent=/home/mahaibo/install --prefix=/home/mahaibo/installmemcache
- # make
- # make install
檢查是否安裝成功:
#cd /home/mahaibo/installmemcache/bin
如果memcached memcached-debug這2個檔案存在,說明安裝成功
4.執行
- #cd /home/mahaibo/installmemcache/bin
- # ./memcached -h
如果出現:
- memcached 1.2.2
- -p
TCP port number to listen on (default: 11211) - -U
UDP port number to listen on (default: 0, off) - -s
unix socket path to listen on (disables network support) - -l
interface to listen on, default is INDRR_ANY - -d run as a daemon
- -r maximize core file limit
- -u
assume identity of (only when run as root) - -m
max memory to use for items in megabytes, default is 64 MB - -M return error on memory exhausted (rather than removing items)
- -c
max simultaneous connections, default is 1024 - -k lock down all paged memory
- -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
- -b run a managed instanced (mnemonic: buckets)
- -P
save PID in , only used with -d option - -f
chunk size growth factor, default 1.25 - -n
minimum space allocated for key+value+flags, default 48
說明安裝成功,並且路徑配置正確。
有可能會出現:
- memcached: error while loading shared libraries: libevent-1.3c.so.1: cannot open shared object file: No such file or directory
說明 沒有找到檔案:libevent-1.3c.so.1
解決辦法:
第一步. 檢視下lib路徑:
- LD_DEBUG=libs /home/mahaibo/installmemcache/bin/memcached -v
結果為:
- 27515: find library=libevent-1.3c.so.1 [0]; searching
- 27515: search path=tls/i686/sse2:tls/i686:tls/sse2:tls:i686/sse2:i686:sse2::/usr/local/lib/tls/i686/sse2:/usr/local/lib/tls/i686:/usr/local/lib/tls/sse2:/usr/local/lib/tls:/usr/local/lib/i686/sse2:/usr/local/lib/i686:/usr/local/lib/sse2:/usr/local/lib:/usr/local/BerkeleyDB.4.3/lib/tls/i686/sse2:/usr/local/BerkeleyDB.4.3/lib/tls/i686:/usr/local/BerkeleyDB.4.3/lib/tls/sse2:/usr/local/BerkeleyDB.4.3/lib/tls:/usr/local/BerkeleyDB.4.3/lib/i686/sse2:/usr/local/BerkeleyDB.4.3/lib/i686:/usr/local/BerkeleyDB.4.3/lib/sse2:/usr/local/BerkeleyDB.4.3/lib:/opt/Ice-3.1/lib/tls/i686/sse2:/opt/Ice-3.1/lib/tls/i686:/opt/Ice-3.1/lib/tls/sse2:/opt/Ice-3.1/lib/tls:/opt/Ice-3.1/lib/i686/sse2:/opt/Ice-3.1/lib/i686:/opt/Ice-3.1/lib/sse2:/opt/Ice-3.1/lib (LD_LIBRARY_PATH)
- 27515: trying file=tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=tls/i686/libevent-1.3c.so.1
- 27515: trying file=tls/sse2/libevent-1.3c.so.1
- 27515: trying file=tls/libevent-1.3c.so.1
- 27515: trying file=i686/sse2/libevent-1.3c.so.1
- 27515: trying file=i686/libevent-1.3c.so.1
- 27515: trying file=sse2/libevent-1.3c.so.1
- 27515: trying file=libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/tls/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/lib/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/tls/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/local/BerkeleyDB.4.3/lib/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/tls/sse2/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/i686/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/opt/Ice-3.1/lib/libevent-1.3c.so.1
- 27515: search path=/usr/lib/tls/i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/usr/lib/sse2:/usr/lib (system search path)
- 27515: trying file=/usr/lib/tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/tls/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/libevent-1.3c.so.1
- 27515: search cache=/etc/ld.so.cache
- 27515: search path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/lib:/usr/lib/tls/i686:/usr/lib/tls:/usr/lib/sse2:/usr/lib (system search path)
- 27515: trying file=/lib/tls/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/lib/tls/sse2/libevent-1.3c.so.1
- 27515: trying file=/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/lib/i686/sse2/libevent-1.3c.so.1
- 27515: trying file=/lib/i686/libevent-1.3c.so.1
- 27515: trying file=/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/lib/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/tls/i686/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/tls/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/sse2/libevent-1.3c.so.1
- 27515: trying file=/usr/lib/libevent-1.3c.so.1
- 27515:
- /home/mahaibo/installmemcache/bin/memcached: error while loading shared libraries: libevent-1.3c.so.1: cannot open shared object file: No such file or directory
第二步. 將libevent-1.3c.so.1複製到任何一個列出的lib 下就可以了。
或者 軟連結
- ln -s /Data/libevent/lib/libevent-1.3b.so.1 /usr/lib/libevent-1.3c.so.1
或者 修改vi /etc/profile檔案。
- export LIBRARY_PATH=:/usr/local/lib:"/usr/local/BerkeleyDB.4.3/lib":/usr/local/lib:/opt/Ice-3.1/lib:/usr/lib:/home/mahaibo/install/lib
其實還有一辦法,用find查詢該so檔案,將存在的路徑加在 LIBRARY_PATH後面就可以的!
啟動服務 :
- ./memcached -d -m 10 -u root -l 192.168.40.4 -p 12000 -c 256 -P /tmp/memcached.pid
引數說明:
-d選項是啟動一個守護程式
-m是分配給Memcache使用的記憶體數量,單位是MB,我這裡是10MB
-u是執行Memcache的使用者,我這裡是root
-l是監聽的伺服器IP地址
-p是設定Memcache監聽的埠,最好是1024以上的埠
-c選項是最大執行的併發連線數,預設是1024,按照你伺服器的負載量來設定
-P是設定儲存Memcache的pid檔案
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7916042/viewspace-1003542/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 安裝 Memcached
- memcached 安裝
- Ubuntu 安裝 MemcachedUbuntu
- ubuntu安裝memcachedUbuntu
- memcached 安裝配置
- memcached安裝測試
- centos下安裝memcachedCentOS
- 安裝python-memcachedPython
- 安裝和使用memcached(windows)Windows
- memcached安裝和php擴充套件memcache安裝PHP套件
- Memcached安裝與使用例項
- 安裝和使用memcached(linux)Linux
- Memcached安裝及啟動指令碼指令碼
- memcached安裝及.NET中的Memcached.ClientLibrary使用詳解client
- memcached安裝及開啟SASL驗證
- Centos7編譯安裝Memcached教程。CentOS編譯
- memcache與memcached的區別與安裝
- 在Linux上安裝Memcached服務Linux
- centos7 安裝memcached以及擴充套件CentOS套件
- 編譯安裝memcached擴充套件記要編譯套件
- Linux下安裝配置MemCached(以及libevent)Linux
- Ubuntu 20.04系統編譯安裝Memcached教程。Ubuntu編譯
- Ubuntu 18.04系統編譯安裝Memcached教程。Ubuntu編譯
- 原始碼安裝memcached和php memcache擴充套件原始碼PHP套件
- TP3.2安裝Memcached擴充套件-安裝及遇到的問題-以完成套件
- Debian11系統編譯安裝Memcached教程。編譯
- Centos8 stream系統編譯安裝Memcached教程。CentOS編譯
- 手動為php安裝memcached擴充套件模組薦PHP套件
- Memcached筆記——(一)安裝&常規錯誤&監控筆記
- centos7下安裝php+memcached簡單記錄CentOSPHP
- macOS Sierra系統下PHP5.6安裝memcached擴充套件MacPHP套件
- Linux下給php7安裝memcached擴充套件的步驟LinuxPHP套件
- Memcached 編譯安裝部署、LRU 演算法、分散式演算法剖析編譯演算法分散式
- 阿里雲Linux下安裝libevent+Memcached伺服器端阿里Linux伺服器
- Memcached
- MemCached Cache Java Client封裝優化歷程Javaclient封裝優化
- Memcached筆記——(三)Memcached使用總結筆記
- codis安裝 (java 安裝 + zookeeper 安裝 + go 安裝 + codis 安裝JavaGo