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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu14中 memcached安装与使用

發(fā)布時間:2025/5/22 Ubuntu 142 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu14中 memcached安装与使用 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

第一步,先安裝lib-event

下載lib-event ?的包http://libevent.org/


下載完之后,解壓安裝

  • ./configure?–prefix=/usr?(或?./configure?--program-prefix=/usr)??
  • make??
  • make?install?

  • 第二步,安裝memcached

    下載memcached的包http://www.memcached.org/downloads


    下載完之后。解壓安裝

    1、./configure

    2、make

    3、make install


    通過命令?ls -al /usr/local/bin/mem*檢測是否成功安裝


    默認(rèn)情況下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

    stats查看狀態(tài)。flush_all:清楚緩存 查看memcached狀態(tài)的基本命令,通過這個命令能夠看到例如以下信息: STAT pid 22459 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 進(jìn)程ID STAT uptime 1027046 ? ? ? ? ? ? ? ? ? ? ? ?server執(zhí)行秒數(shù) STAT time 1273043062 ? ? ? ? ? ? ? ? ? ? ? server當(dāng)前unix時間戳 STAT version 1.4.4 ? ? ? ? ? ? ? ? ? ? ? ? server版本號 STAT pointer_size 64 ? ? ? ? ? ? ? ? ? ? ? 操作系統(tǒng)字大小(這臺server是64位的) STAT rusage_user 0.040000 ? ? ? ? ? ? ? ? ?進(jìn)程累計用戶時間 STAT rusage_system 0.260000 ? ? ? ? ? ? ? ?進(jìn)程累計系統(tǒng)時間 STAT curr_connections 10 ? ? ? ? ? ? ? ? ? 當(dāng)前打開連接數(shù) STAT total_connections 82 ? ? ? ? ? ? ? ? ?曾打開的連接總數(shù) STAT connection_structures 13 ? ? ? ? ? ? ?server分配的連接結(jié)構(gòu)數(shù) STAT cmd_get 54 ? ? ? ? ? ? ? ? ? ? ? ? ? ?運行g(shù)et命令總數(shù) STAT cmd_set 34 ? ? ? ? ? ? ? ? ? ? ? ? ? ?運行set命令總數(shù) STAT cmd_flush 3 ? ? ? ? ? ? ? ? ? ? ? ? ? 指向flush_all命令總數(shù) STAT get_hits 9 ? ? ? ? ? ? ? ? ? ? ? ? ? ?get命中次數(shù) STAT get_misses 45 ? ? ? ? ? ? ? ? ? ? ? ? get未命中次數(shù) STAT delete_misses 5 ? ? ? ? ? ? ? ? ? ? ? delete未命中次數(shù) STAT delete_hits 1 ? ? ? ? ? ? ? ? ? ? ? ? delete命中次數(shù) STAT incr_misses 0 ? ? ? ? ? ? ? ? ? ? ? ? incr未命中次數(shù) STAT incr_hits 0 ? ? ? ? ? ? ? ? ? ? ? ? ? incr命中次數(shù) STAT decr_misses 0 ? ? ? ? ? ? ? ? ? ? ? ? decr未命中次數(shù) STAT decr_hits 0 ? ? ? ? ? ? ? ? ? ? ? ? ? decr命中次數(shù) STAT cas_misses 0 ? ? ? ? ? ? ? ? ? ? ? ? ?cas未命中次數(shù) STAT cas_hits 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ?cas命中次數(shù) STAT cas_badval 0 ? ? ? ? ? ? ? ? ? ? ? ? ?使用擦拭次數(shù) STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 15785 ? ? ? ? ? ? ? ? ? ? ?讀取字節(jié)總數(shù) STAT bytes_written 15222 ? ? ? ? ? ? ? ? ? 寫入字節(jié)總數(shù) STAT limit_maxbytes 1048576 ? ? ? ? ? ? ? ?分配的內(nèi)存數(shù)(字節(jié)) STAT accepting_conns 1 ? ? ? ? ? ? ? ? ? ? 眼下接受的鏈接數(shù) STAT listen_disabled_num 0 ? ? ? ? ? ? ? ? STAT threads 4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 線程數(shù) STAT conn_yields 0 STAT bytes 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 存儲item字節(jié)數(shù) STAT curr_items 0 ? ? ? ? ? ? ? ? ? ? ? ? ?item個數(shù) STAT total_items 34 ? ? ? ? ? ? ? ? ? ? ? ?item總數(shù) STAT evictions 0 ? ? ? ? ? ? ? ? ? ? ? ? ? 為獲取空間刪除item的總數(shù)


    啟動完之后,測試

    telenet ?127.0.0.1 10101

    連接成功后,能夠使用了


    關(guān)閉memcached服務(wù)時,先查看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詳細(xì)的使用。參照http://www.cnblogs.com/czh-liyu/archive/2010/04/27/1722084.html


    memcached 協(xié)議 ?點擊打開鏈接


    總結(jié)

    以上是生活随笔為你收集整理的ubuntu14中 memcached安装与使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。