ubuntu14中 memcached安装与使用
第一步,先安裝lib-event
下載lib-event ?的包http://libevent.org/
下載完之后,解壓安裝
第二步,安裝memcached
下載memcached的包http://www.memcached.org/downloads
下載完之后。解壓安裝
1、./configure
2、make
3、make install
通過命令?ls -al /usr/local/bin/mem*檢測是否成功安裝
默認情況下memcached安裝到/usr/local/bin下。
啟動memcached server。在安裝文件夾下啟動
?/usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 11211 -c 256 -P /tmp/memcached.pid
root@chiwei-VirtualBox:/home/chiwei/disk/service# ls
root@chiwei-VirtualBox:/home/chiwei/disk/service# ls -al /usr/local/bin/memcached?
-rwxr-xr-x 1 root root 495978 ?7月 23 16:16 /usr/local/bin/memcached
root@chiwei-VirtualBox:/home/chiwei/disk/service# cd /usr/local/bin/me
-su: cd: /usr/local/bin/me: 沒有那個文件或文件夾
root@chiwei-VirtualBox:/home/chiwei/disk/service# cd /usr/local/bin/
root@chiwei-VirtualBox:/usr/local/bin# ls
memcached
root@chiwei-VirtualBox:/usr/local/bin# ./memcached -d -c 1024 -l 127.0.0.1 -p 10101 -m 1024 -u root
root@chiwei-VirtualBox:/usr/local/bin# telnet 127.0.0.1 10101
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
stats
啟動完之后,測試
telenet ?127.0.0.1 10101
連接成功后,能夠使用了
關閉memcached服務時,先查看tmp目錄
root@chiwei-VirtualBox:~# ls
root@chiwei-VirtualBox:~# cd /tmp/
root@chiwei-VirtualBox:/tmp# ls
aptdaemon-WMCJDF ? ? ? ? ? ? ? ? ?qtsingleapp-chines-1a7c-3e8-lockfile
bjydJbU3Ux ? ? ? ? ? ? ? ? ? ? ? ?rpc%0049d%0043ache.data
deCgyLP7oi ? ? ? ? ? ? ? ? ? ? ? ?sms%0043ache.data
fcitx-socket-:0 ? ? ? ? ? ? ? ? ? sni-qt_chinese-calendar_2043-z3cOqS
hsperfdata_chiwei ? ? ? ? ? ? ? ? sni-qt_sogou-qimpanel_2248-fTSQLu
hsperfdata_root ? ? ? ? ? ? ? ? ? sogou-qimpanel:0.pid
indicator-china-weather-1000.pid ?sogou-qimpanelchiwei
jna ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ssh-Wcoq8f0CINjL
memcached.pid ? ? ? ? ? ? ? ? ? ? unity_support_test.1
qtsingleapp-chines-1a7c-3e8
有一個保存memcache的pid文件
kill `cat /tmp/memcached.pid` ? 鍵盤左上角的點符號
或者
root@chiwei-VirtualBox:~# ps -ef | grep memcached
root ? ? 24915 ?1584 ?0 16:36 ?
? ? ? ?00:00:00 ./memcached -d -c 1024 -l 127.0.0.1 -p 10101 -m 1024 -u root
root ? ? 25011 10370 ?0 16:41 pts/15 ? 00:00:00 grep --color=auto memcached
root@chiwei-VirtualBox:~# kill 24915
root@chiwei-VirtualBox:~# telnet 127.0.0.1 10101
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@chiwei-VirtualBox:~#?
memcached詳細的使用。參照http://www.cnblogs.com/czh-liyu/archive/2010/04/27/1722084.html
memcached 協議 ?點擊打開鏈接
總結
以上是生活随笔為你收集整理的ubuntu14中 memcached安装与使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Exchange 2013恢复已禁用用户
- 下一篇: 3.1 哈尔空间 V0