念念不忘
必有回响

在CentOS上安装Memcached

一、前期准备

  • Centos6.8
  • Memcached最新版
  • libevent-2.1.8-stable.tar

二、安装依赖

因为官方网站说了,memcached依赖于libevent :

yum方式的安装:

# Redhat/Centos
yum install libevent-devel

源码方式的安装:
1. 源码安装:

wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz

2. 解压

tar -zxvf libevent-2.1.8-stable.tar.gz

3. 配置

cd libevent-2.1.8-stable
./configure --prefix=/usr/local/libevent

4. 安装

make && make install

三、安装memcached

1. 下载

wget http://memcached.org/files/memcached-1.4.36.tar.gz

2. 解压

tar -zxvf memcached-1.4.36.tar.gz

3. 编译

./configure --prefix=/usr/local/memcached  --with-libevent=/usr/local/libevent/

4. 安装

make && make install

5. 检测

ll /usr/local 
drwxr-xr-x   5 root     root         4096 May 25 15:15 libevent
drwxr-xr-x   5 root     root         4096 May 25 15:18 memcached

6. 启动

/usr/local/memcached/bin/memcached -u nobody -m 4096 -d -p 11211 -P /var/tmp/memcached1.pid
netstat -ltnp |grep 11211
tcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      959/memcached       
tcp        0      0 :::11211                    :::*                        LISTEN      959/memcached

 

赞(0) 打赏
未经允许不得转载:码农志 » 在CentOS上安装Memcached
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏