Memcached安裝(CentOS 7)

Memcached安裝(CentOS 7)緩存

參考:http://memcached.org/downloads memcached

1、安裝所需軟件包google

 yum install libevent.x86_64
 yum install libevent-devel.x86_64

2、安裝memcachedspa

wget http://www.memcached.org/files/memcached-1.4.24.tar.gz
tar -zxvf memcached-1.4.24.tar.gz
cd memcached-1.4.24
./configure && make && sudo make install

3、啓動memcachedcode

/usr/local/bin/memcached -d -m 1024 -u root -l 192.168.80.12 -p 11211 -L -P /tmp/memcached.pid

    參數參考:https://code.google.com/p/memcached/wiki/NewConfiguringServer#Commandline_Argumentsorm

-m 告訴memcached最多使用多少內存來存放緩存數據(單位M).
xml

-d  告訴memcached後臺運行ip

-u 運行memcached的用戶內存

-l 是memcached監聽的ipget

-p 是memcached監聽的端口,默認端口是11211

-P 是設置memcache的pid文件

-L 嘗試使用大內存頁(若是可用的話)。提升內存頁尺寸能夠減小"頁表緩衝(TLB)"丟失次數,提升運行效率


4、使用telnet鏈接memcached

# telnet localhost 11211

#stats (打印memcached統計信息)

5、設置爲開機啓動

 echo "/usr/local/bin/memcached -d -m 1024 -u root -l 192.168.80.12 -p 11211 -L -P /tmp/memcached.pid">>/etc/rc.local

6、中止 memcached

     kill `cat /tmp/memcached.pid`

相關文章
相關標籤/搜索