memcache的安装

本文介绍了在CentOS7环境下,如何安装和使用Memcached。首先,文章提到了Memcached作为高性能的分布式内存对象缓存系统,用于减少数据库负载。接着,详细阐述了在系统中安装libevent库,然后编译和安装Memcached守护进程的过程。此外,还提供了启动、查看服务状态和停止服务的方法。最后,通过安装telnet进行远程测试,以验证Memcached的运行情况。
摘要由CSDN通过智能技术生成

 

Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态、数据库驱动网站的速度。Memcached基于一个存储键/值对的hashmap。其守护进程(daemon )是用C写的,但是客户端可以用任何语言来编写,并通过memcached协议与守护进程通信。

实验环境:

在centos7环境下

jdk版本:1.8

因为是基于libevent的事件处理,所以先安装libevent

yum -y install gcc libevent libevent-devel
已加载插件:fastestmirror, langpacks
base                                                                                   | 3.6 kB  00:00:00     
extras                                                                                 | 3.4 kB  00:00:00     
mysql-connectors-community                                                             | 2.5 kB  00:00:00     
mysql-tools-community                                                                  | 2.5 kB  00:00:00     
mysql57-community                                                                      | 2.5 kB  00:00:00     
updates                                                                                | 3.4 kB  00:00:00     
(1/4): mysql-connectors-community/x86_64/primary_db                                    |  20 kB  00:00:00     
(2/4): mysql-tools-community/x86_64/primary_db                                         |  41 kB  00:00:00     
(3/4): mysql57-community/x86_64/primary_db                                             | 144 kB  00:00:00     
(4/4): updates/7/x86_64/primary_db                                                     | 6.9 MB  00:00:05     
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirror.bit.edu.cn
 * updates: mirrors.aliyun.com
软件包 libevent-2.0.21-4.el7.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 libevent-devel.x86_64.0.2.0.21-4.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==============================================================================================================
 Package                       架构                  版本                           源                   大小
==============================================================================================================
正在安装:
 libevent-devel                x86_64                2.0.21-4.el7                   base                 85 k

事务概要
==============================================================================================================
安装  1 软件包

总下载量:85 k
安装大小:357 k
Downloading packages:
libevent-devel-2.0.21-4.el7.x86_64.rpm                                                 |  85 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libevent-devel-2.0.21-4.el7.x86_64                                                        1/1 
  验证中      : libevent-devel-2.0.21-4.el7.x86_64                                                        1/1 

已安装:
  libevent-devel.x86_64 0:2.0.21-4.el7                                                                        

完毕!

 安装memcached缓存服务器

wget http://memcached.org/files/memcached-1.5.7.tar.gz
tar -zxvf memcached-1.5.7.tar.gz
cd memcached-1.5.7
./configure --prefix=/data/soft/memcached && make &&  make install

  编译安装过程如下

./configure --prefix=/data/soft/memcached && make && make install
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether mak
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值