linux(centOs)下memcached安装
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安装的更多相关文章
- Windows和Linux环境下Memcached安装与配置(转)
一.memcached安装配置 windows平台安装 1.memcached-1.2.6-win32-bin.zip下载地址: http://code.jellycan.com/memcached/ ...
- Linux centos下php安装cphalcon扩展的方法
说明: 操作系统:CentOS php安装目录:/usr/local/php php.ini配置文件路径:/usr/local/php/etc/php.ini 1.安装cphalcon cd /usr ...
- 在Linux CentOS下如何安装tar.gz和RPM软件包
1.安装tar.gz软件包: 在Linuxr(Centos下)如何安装tar.gz软件包,该方式实质上就是源代码安装方式,具体如下: 在Linux中使用wget命令下载要安装的文件,命令格式如下:wg ...
- Linux Centos下编译安装Redis
需要安装 tcl 8.5 wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz //直接下载 sudo tar xzvf tcl8 ...
- centos下memcached安装
memcached是一款高速.分布式的内存缓存系统.其官方主页在http://www.danga.com/memcached/ 1.安装前的准备 要安装memcached,需要有libevent的支持 ...
- Linux(CentOS)下编译安装apache
Centos7.6系统 已经安装lnmp一键环境 想装个apache跑php7 (php7的安装以及与apache的交互在这里: https://www.cnblogs.com/lz0925/p/11 ...
- linux(Centos)下编译安装gcc4.8.2
欢迎转载.转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/46811159 近期要用到c++ 11,所以没办法仅仅得把那台ce ...
- Thrift在Windows及Linux平台下的安装和使用示例
本文章也同时发表在个人博客Thrift在Windows及Linux平台下的安装和使用示例上. thrift介绍 Apache Thrift 是 Facebook 实现的一种高效的.支持多种编程语言的R ...
- Linux下memcached安装和启动方法
Linux下memcached安装和启动方法 1. 首先下载memcached 和 libevent 包. Memcached用到了libevent这个库用于Socket的处理.下面是下载的两个包文件 ...
随机推荐
- php时间戳函数mktime()
在项目开发中,偶尔会遇到跨周期.跨月的的时间操作.PHP为我们提供了一个很方便的函数->mktime,可以很简单的获取制定日期的时间戳了. mktime(hour,minute,second,m ...
- 微信小程序:本地资源图片无法通过 WXSS 获取,可以使用网络图片或者 base64或者使用image标签
微信小程序:本地资源图片无法通过 WXSS 获取,可以使用网络图片或者 base64或者使用image标签 一.问题 报错信息: VM696:2 pages/user/user.wxss 中的本地资源 ...
- Kali2018.1
目录 制作U盘启动盘 安装 Kali Linux 之后的事 更新源 配置 Zsh 配置 Vim 修改 Firefox 语言为中文 安装 Gnome 扩展 美化 安装 Google 拼音输入法 安装常用 ...
- ThinkPHP开发博客系统笔记之一
1.前后台搭建 开发的第一步是搭建前后台系统.搭建前台系统的时候新建了LoginController控制器和登录界面View/Login/index.tpl.模板文件中需要引入js和css文件,这里想 ...
- Ubuntu 安装Docker
参考:官网 安装依赖包: $ sudo apt-get update $ sudo apt-get install -y --no-install-recommends \ linux-image-e ...
- install ros-indigo-laser-geometry
-- Using these message generators: gencpp;genlisp;genpy CMake Warning at /opt/ros/indigo/share/catki ...
- 设计点滴&css效果点滴
走向设计师的第一步, 做一个自由的设计师. 优秀的移动端设计的:http://www.cnblogs.com/coding4/p/6842849.html 一些好的设计图片的收藏,一些好的设计理念,一 ...
- 通过git-bash一句话获得当前目录的全部csproj文件绝对路径
#!/usr/bin/env bash %.sh}.txt 保存为 csprojfilelist.sh,注意换行符使用LF,如果git-bash关联了sh文件,直接双击就可以得到csprojfilel ...
- 网路防火墙iptables
linux操作系统自身可以充当交换机,还可以当路由器,也就是说linux多网卡之间拥有互相转发数据包的能力,这种能力的实现主要依靠的是防火墙的功能进行数据包的转发和入站. 路由选择点,就是在一个点分辨 ...
- bzoj1075
题意: 给你一个地图,问从x1,y1->x2,y2,要走的路最短,问 耗油和速度 题解: 首先把他们转到左下角->右上角 然后只能往上或往下 考虑到可能有小数 所以都乘上他们的公倍数 然后 ...