2012年5月9日水曜日

install memcached on CentOS5



※this text from livedoor blog 2010/1/4<br />
<br />


RPMforgeレポジトリをインストール
i386の場合
$ sudo rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

x86_64の場合
$ sudo rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

RPMforgeレポジトリを有効にする
$ emacs  /etc/yum.repos.d/rpmforge.repo
enabled = 1

memcachedをインストール
$ sudo yum install memcached

configファイルを編集
$ emacs  /etc/sysconfig/memcached
PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1"

memcachedをスタート
$ sudo /etc/init.d/memcached start

接続テスト
$ telnet localhost 11211
telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
stats
STAT pid 15033
STAT uptime 5
STAT time 1262583936
STAT version 1.2.6
STAT pointer_size 32
STAT rusage_user 0.000000
STAT rusage_system 0.000000
STAT curr_items 0
STAT total_items 0
STAT bytes 0
STAT curr_connections 5
STAT total_connections 6
STAT connection_structures 6
STAT cmd_get 0
STAT cmd_set 0
STAT get_hits 0
STAT get_misses 0
STAT evictions 0
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 67108864
STAT threads 4
END
quit
Connection closed by foreign host.