Linux下安裝MemCached

來源:互聯網
上載者:User

標籤:memcached   cache   分布式緩衝   

前提準備:


    1. MemCached目前最新版本為:1.4.22,可以從官網下載到。


    2. MemCached依賴libevent,因此在安裝MemCached之前需要先安裝libevent。


    2.1 運行下面命令,查看系統是否已安裝libevent。


[[email protected] ~]# rpm -qa|grep libeventlibevent-headers-1.4.13-4.el6.noarchlibevent-1.4.13-4.el6.x86_64libevent-doc-1.4.13-4.el6.noarchlibevent-devel-1.4.13-4.el6.x86_64


安裝過程:

 

    3.  將下載下來的檔案上傳到/opt/favccxx,運行下面命令進行解壓。


[[email protected] favccxx]# tar -zxvf memcached-1.4.22.tar.gz


   

    4. 運行 [[email protected]ck favccxx]# cd memcached-1.4.22 ,切換到memcached目錄下。


    5. 運行 [[email protected] memcached-1.4.22]# ./configure && make && make test && sudo make install ,一鍵完成安裝。


    6. 運行[email protected] bin]# ./memcached -u root, 啟動MemCached。MemCached預設啟動連接埠為:11211。也可以通過[[email protected] bin]# ./memcached -p 12306 -u root,更改預設的連接埠號碼啟動。如果想要在關閉視窗的情況下memcache進程仍然啟動並執行話,需要在命令後面加上 -d,表示以守護進程啟動。


    7. MemCached的常用命令可以通過[[email protected] bin]# ./memcached  -h 查看。下面是一些常用的命令。


-d :啟動一個守護進程,-m:分配給Memcache使用的記憶體數量,單位是MB,預設是64MB,-u :運行Memcache的使用者-l  :監聽的伺服器IP地址-p :設定Memcache監聽的連接埠,預設是11211    註:-p(p為小寫)-c :設定最大並發串連數,預設是1024


    8. 至此,MemCached安裝完畢,接下來就可以體驗MemCached了。

本文出自 “這個人的IT世界” 部落格,請務必保留此出處http://favccxx.blog.51cto.com/2890523/1626776

Linux下安裝MemCached

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.