1、libevent安装。为啥先安装它?因为不先装,memcached这座房子就没打地基:

yum install libevent-devel

  敲回车后出现:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB ::
epel | 4.7 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): epel/x86_64/updateinfo | kB ::
(/): updates//x86_64/primary_db | 2.5 MB ::
(/): epel/x86_64/primary_db | 6.6 MB ::
Resolving Dependencies
--> Running transaction check
---> Package libevent-devel.x86_64 :2.0.-.el7 will be installed
--> Processing Dependency: libevent = 2.0.-.el7 for package: libevent-devel-2.0.-.el7.x86_64
--> Processing Dependency: libevent_pthreads-2.0.so.()(64bit) for package: libevent-devel-2.0.-.el7.x86_64
--> Processing Dependency: libevent_openssl-2.0.so.()(64bit) for package: libevent-devel-2.0.-.el7.x86_64
--> Processing Dependency: libevent_extra-2.0.so.()(64bit) for package: libevent-devel-2.0.-.el7.x86_64
--> Processing Dependency: libevent_core-2.0.so.()(64bit) for package: libevent-devel-2.0.-.el7.x86_64
--> Processing Dependency: libevent-2.0.so.()(64bit) for package: libevent-devel-2.0.-.el7.x86_64
--> Running transaction check
---> Package libevent.x86_64 :2.0.-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
libevent-devel x86_64 2.0.-.el7 base k
Installing for dependencies:
libevent x86_64 2.0.-.el7 base k Transaction Summary
===================================================================================================================================
Install Package (+ Dependent package) Total download size: k
Installed size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
(/): libevent-devel-2.0.-.el7.x86_64.rpm | kB ::
(/): libevent-2.0.-.el7.x86_64.rpm | kB ::
-----------------------------------------------------------------------------------------------------------------------------------
Total 3.5 MB/s | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libevent-2.0.-.el7.x86_64 /
Installing : libevent-devel-2.0.-.el7.x86_64 /
Verifying : libevent-devel-2.0.-.el7.x86_64 /
Verifying : libevent-2.0.-.el7.x86_64 / Installed:
libevent-devel.x86_64 :2.0.-.el7 Dependency Installed:
libevent.x86_64 :2.0.-.el7 Complete!

  我们可以看到它自动把libevent-devel和libevent两个包一起安装好了。我们可以到安装包下看一看:

ls /usr/lib64 | grep libevent
libevent-2.0.so.5
libevent-2.0.so.5.1.9
libevent_core-2.0.so.5
libevent_core-2.0.so.5.1.9
libevent_core.so
libevent_extra-2.0.so.5
libevent_extra-2.0.so.5.1.9
libevent_extra.so
libevent_openssl-2.0.so.5
libevent_openssl-2.0.so.5.1.9
libevent_openssl.so
libevent_pthreads-2.0.so.5
libevent_pthreads-2.0.so.5.1.9
libevent_pthreads.so
libevent.so

  2、安装memcached:

yum install memcached

  敲完回车后:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package memcached.x86_64 :1.4.-.el7_3. will be installed
--> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
memcached x86_64 1.4.-.el7_3. base k Transaction Summary
===================================================================================================================================
Install Package Total download size: k
Installed size: k
Is this ok [y/d/N]: y
Downloading packages:
memcached-1.4.-.el7_3..x86_64.rpm | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : memcached-1.4.-.el7_3..x86_64 /
Verifying : memcached-1.4.-.el7_3..x86_64 / Installed:
memcached.x86_64 :1.4.-.el7_3. Complete!

  3、去官方网站(http://memcached.org)下载memcached最新版本的源码包:

wget http://memcached.org/latest

  敲完回车后:

---- ::--  http://memcached.org/latest
Resolving memcached.org (memcached.org)... 107.170.231.145
Connecting to memcached.org (memcached.org)|107.170.231.145|:... connected.
HTTP request sent, awaiting response... Moved Temporarily
Location: https://www.memcached.org/files/memcached-1.5.12.tar.gz [following]
---- ::-- https://www.memcached.org/files/memcached-1.5.12.tar.gz
Resolving www.memcached.org (www.memcached.org)... 107.170.231.145
Connecting to www.memcached.org (www.memcached.org)|107.170.231.145|:... connected.
HTTP request sent, awaiting response... OK
Length: (447K) [application/octet-stream]
Saving to: 鈥榣atest鈥 %[=========================================================================================>] , 153KB/s in .9s -- :: ( KB/s) - 鈥榣atest鈥saved [/]

  我们看到下载的最新源码包叫memcached-1.5.12.tar.gz,但wget命令却把包名叫成了latest,把下载包的名称改回去

mv latest memcached-1.5..tar.gz

  然后解压、配置、编译和安装

tar -zxvf memcached-1.5..tar.gz
cd memcached-1.5.12
 ./configure --prefix=/usr/local/memcached
make && make test
sudo make install

  此时已大功告成,接下来启动memcached:

/usr/local/memcached/bin/memcached -p  -m 64m -u root -d

  这里以root用户、端口号11211、并分配了64兆内存将memcached作为守护进程在后台启动了,可以看下进程:

ps -ef | grep memcached
root : ? :: /usr/local/memcached/bin/memcached -p -m 64m -u root -d

  最后连上memcached试一把:

telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
set foo
hello world
STORED
get foo
VALUE foo
hello world
END

linux(centOs)下memcached安装的更多相关文章

  1. Windows和Linux环境下Memcached安装与配置(转)

    一.memcached安装配置 windows平台安装 1.memcached-1.2.6-win32-bin.zip下载地址: http://code.jellycan.com/memcached/ ...

  2. Linux centos下php安装cphalcon扩展的方法

    说明: 操作系统:CentOS php安装目录:/usr/local/php php.ini配置文件路径:/usr/local/php/etc/php.ini 1.安装cphalcon cd /usr ...

  3. 在Linux CentOS下如何安装tar.gz和RPM软件包

    1.安装tar.gz软件包: 在Linuxr(Centos下)如何安装tar.gz软件包,该方式实质上就是源代码安装方式,具体如下: 在Linux中使用wget命令下载要安装的文件,命令格式如下:wg ...

  4. Linux Centos下编译安装Redis

    需要安装 tcl 8.5 wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz //直接下载 sudo tar xzvf tcl8 ...

  5. centos下memcached安装

    memcached是一款高速.分布式的内存缓存系统.其官方主页在http://www.danga.com/memcached/ 1.安装前的准备 要安装memcached,需要有libevent的支持 ...

  6. Linux(CentOS)下编译安装apache

    Centos7.6系统 已经安装lnmp一键环境 想装个apache跑php7 (php7的安装以及与apache的交互在这里: https://www.cnblogs.com/lz0925/p/11 ...

  7. linux(Centos)下编译安装gcc4.8.2

    欢迎转载.转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/46811159 近期要用到c++ 11,所以没办法仅仅得把那台ce ...

  8. Thrift在Windows及Linux平台下的安装和使用示例

    本文章也同时发表在个人博客Thrift在Windows及Linux平台下的安装和使用示例上. thrift介绍 Apache Thrift 是 Facebook 实现的一种高效的.支持多种编程语言的R ...

  9. Linux下memcached安装和启动方法

    Linux下memcached安装和启动方法 1. 首先下载memcached 和 libevent 包. Memcached用到了libevent这个库用于Socket的处理.下面是下载的两个包文件 ...

随机推荐

  1. 前端学习笔记之css清除浮动float的七种常用方法总结和兼容性处理

    在清除浮动前我们要了解两个重要的定义: 浮动的定义:使元素脱离文档流,按照指定方向发生移动,遇到父级边界或者相邻的浮动元素停了下来. 高度塌陷:浮动元素父元素高度自适应(父元素不写高度时,子元素写了浮 ...

  2. 一些常用的JavaScript正则表达式

    1.正数,最多n位小数 /^(([1-9]\d*(\.\d{1,n})?)|(0\.\d{1,n}))$/ 2.手机号码 /^1[34578]\d{9}$/

  3. NOIP2016 “西湖边超萌小松鼠” 模拟赛

    总的来说,这套题的难度比较接近近些年来Day1的真实难度,认为非常值得一打 GotoAndPlay 题目大意 询问这个图上是否存在一种跳法,能跳到这个图上的每一个点 题目解析 犯了个低级错误,双向边忘 ...

  4. package 'orocos-bfl' not found

    -- ==> add_subdirectory(bp_fusion) -- checking for module 'orocos-bfl' -- package 'orocos-bfl' no ...

  5. Builder(建造者)

    意图: 将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示. 适用性: 当创建复杂对象的算法应该独立于该对象的组成部分以及它们的装配方式时. 当构造过程必须允许被构造的对象有不同 ...

  6. Java 字节的常用封装

    一. Java 的字节 byte (字节) 是 Java 中的基本数据类型,一个 byte 包含8个 bit(位),byte 的取值范围是-128到+127. byte 跟 Java 其他基本类型的关 ...

  7. [Mybatis]resultMap的使用总结

    resultMap是Mybatis最强大的元素,它可以将查询到的复杂数据(比如查询到几个表中数据)映射到一个结果集当中. resultMap包含的元素的相关属性解释如下: <!--column不 ...

  8. vim with space-vim

    space-vim https://github.com/liuchengxu/space-vim macOS # homebrew /usr/bin/ruby -e "$(curl -fs ...

  9. Java中字符串比较的注意点

    Java中必须使用string1.equals(string2)来进行判断 补充如果: string s1=new String("Hello"); string s2=new S ...

  10. nodejs 前端工具总结

    htmlhint https://github.com/yaniswang/HTMLHint 使用 var HTMLHint = require("htmlhint").HTMLH ...