memcached1.6源码安装

memcached1.6源码安装

1.下载memcached和libevent

memcached安装依赖libevent,所以需要先安装libevent

https://libevent.org/

https://www.memcached.org/

[root@localhost ~]# wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
[root@localhost ~]# wget http://www.memcached.org/files/memcached-1.6.19.tar.gz

2.先安装libevent

[root@localhost ~]# tar -xvf libevent-2.1.12-stable.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/libevent-2.1.12-stable/
[root@localhost libevent-2.1.12-stable]# ./configure --prefix=/usr/        (如配置报错 需 yum -y install openssl  openssl-devel)
[root@localhost libevent-2.1.12-stable]# make && make install

测试libevent是否安装成功

[root@localhost ~]# ls -al /usr/lib | grep libevent
lrwxrwxrwx. 1 root root 21 Feb 7 16:09 libevent-2.1.so.7 -> libevent-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 1327800 Feb 7 16:09 libevent-2.1.so.7.0.1
-rw-r--r--. 1 root root 2455942 Feb 7 16:09 libevent.a
lrwxrwxrwx. 1 root root 26 Feb 7 16:09 libevent_core-2.1.so.7 -> libevent_core-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 843984 Feb 7 16:09 libevent_core-2.1.so.7.0.1
-rw-r--r--. 1 root root 1565814 Feb 7 16:09 libevent_core.a
-rwxr-xr-x. 1 root root 988 Feb 7 16:09 libevent_core.la
lrwxrwxrwx. 1 root root 26 Feb 7 16:09 libevent_core.so -> libevent_core-2.1.so.7.0.1
lrwxrwxrwx. 1 root root 27 Feb 7 16:09 libevent_extra-2.1.so.7 -> libevent_extra-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 507480 Feb 7 16:09 libevent_extra-2.1.so.7.0.1
-rw-r--r--. 1 root root 890202 Feb 7 16:09 libevent_extra.a
-rwxr-xr-x. 1 root root 995 Feb 7 16:09 libevent_extra.la
lrwxrwxrwx. 1 root root 27 Feb 7 16:09 libevent_extra.so -> libevent_extra-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 953 Feb 7 16:09 libevent.la
lrwxrwxrwx. 1 root root 29 Feb 7 16:09 libevent_openssl-2.1.so.7 -> libevent_openssl-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 117704 Feb 7 16:09 libevent_openssl-2.1.so.7.0.1
-rw-r--r--. 1 root root 214274 Feb 7 16:09 libevent_openssl.a
-rwxr-xr-x. 1 root root 1024 Feb 7 16:09 libevent_openssl.la
lrwxrwxrwx. 1 root root 29 Feb 7 16:09 libevent_openssl.so -> libevent_openssl-2.1.so.7.0.1
lrwxrwxrwx. 1 root root 30 Feb 7 16:09 libevent_pthreads-2.1.so.7 -> libevent_pthreads-2.1.so.7.0.1
-rwxr-xr-x. 1 root root 24016 Feb 7 16:09 libevent_pthreads-2.1.so.7.0.1
-rw-r--r--. 1 root root 21982 Feb 7 16:09 libevent_pthreads.a
-rwxr-xr-x. 1 root root 1016 Feb 7 16:09 libevent_pthreads.la
lrwxrwxrwx. 1 root root 30 Feb 7 16:09 libevent_pthreads.so -> libevent_pthreads-2.1.so.7.0.1
lrwxrwxrwx. 1 root root 21 Feb 7 16:09 libevent.so -> libevent-2.1.so.7.0.1

3.安装memcached,同时需要安装中指定libevent的安装位置

[root@localhost ~]# tar -xvf memcached-1.6.19.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/memcached-1.6.19/
[root@localhost memcached-1.6.19]# ./configure --with-libevent=/usr/
[root@localhost memcached-1.6.19]# make && make install

安装完成后会把memcached放到 /usr/local/bin/memcached

测试是否成功安装memcached

[root@localhost ~]# ls -al /usr/local/bin/mem*
-rwxr-xr-x. 1 root root 963640 Feb 7 16:15 /usr/local/bin/memcached

4.启动

使用memcached用户启动

[root@localhost ~]# useradd -r memcached -s /sbin/nologin
[root@localhost ~]# memcached -d -m 1024 -u memcached -d -U 0 -l 172.16.1.252 -p 11211 -c 4096 -t 64
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值