您好,登錄后才能下訂單哦!
memcached 分布式內存對象緩存系統;
內存緩存;把所取對象或數據緩存在內存中;內存中緩存的這些數據通過API的方式被存取;
數據就像是一張HASH表,以key-value對的方式存在。
用來減輕數據庫的壓力,提高網站的響應速度,構建快速可擴展的web應用。
內置內存管理方式;使用LUR自動刪除不使用的存儲,重用過期數據的內存空間。
所以重啟機器之后緩存數據會丟失。
下載依賴 libevent
也可以 yum安裝
# yum install libevent
源碼
# https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
# tar -xf libevent-2.0.22-stable.tar.gz
# cd libevent-2.0.22-stable
# ./configure
# make &&make install
memcached 下載安裝;
# wget https://memcached.org/latest
[you might need to rename the file] 默認是最新版本;
# tar -zxf memcached-1.x.x.tar.gz
# cd memcached-1.x.x
# ./configure --prefix=/usr/local/memcached
# make && make test && sudo make install
啟動失敗?
[root@Ansible memcached-1.4.30]# /usr/local/bin/memcached
/usr/local/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
[root@Ansible memcached-1.4.30]# find / -name libevent-2.0.so.5
/opt/memcached/libevent-2.0.22-stable/.libs/libevent-2.0.so.5
/usr/local/lib/libevent-2.0.so.5
編輯 /etc/ld.so.conf 添加以上;
[root@Ansible memcached-1.4.30]# vi /etc/ld.so.conf
[root@Ansible memcached-1.4.30]# ldconfig
啟動:指定root 或者切換非root
[root@Ansible memcached-1.4.30]# /usr/local/bin/memcached -m 32m -p 11211 -d -u root
# yum install telnet
[root@Ansible memcached-1.4.30]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
查看狀態:
stats
管理工具
memcached-tool
yum install memcached-tool
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。