Linux 下安装Redis

http://jingyan.baidu.com/article/948f592401d172d80ff5f99a.html (最简单)html

http://blog.csdn.net/jy0902/article/details/19248299redis

http://www.cnblogs.com/moxiaoan/p/5724505.html测试

 

下载按照redis源码(官网有安装启动步骤):ui

wget http://download.redis.io/releases/redis-stable.tar.gz
tar xvf redis-2.8.19.tar.gz
cd redis-2.8.19.net

若安装make报错:
安装make ( sudo apt-get install make)server

安装build-essential(sudo apt-get install build-essential)htm

报错:fatal error: jemalloc/jemalloc.h: No such file or directory
make MALLOC=jemallocblog

若报错:fatal error: jemalloc/jemalloc.h: No such file or directory进程

make MALLOC=libcget

若报错:collect2: error: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/home/xinxin/downloads/redis-stable/src'
make: *** [all] Error 2

解决方法:编辑src/.make-settings里的OPT,改成OPT=-O2 -march=i686 

 

 

1,sudo su                     //进入root权限

二、mkdir download      //新建一个文件夹,名为“download”

三、cd download         //进入download文件夹,下载最新稳定版redis安装包

      wget http://download.redis.io/releases/redis-3.2.4.tar.gz

四、tar xvf redis-3.2.4.tar.gz   //解压

五、这时cd download文件夹,ls命令,能够看到,解压后的文件夹"redis-stable"

cd redis-stable  

make //编译

make成功后,会在src下生成6个可执行文件:

redis-server, redis-cli, redis-benchmark, redis-check-aof, redis-check-dump,redis-sentinel

安装redis成功后,可在/usr/local/redis看到一个bin目录,里面有以下文件:

redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server

sudo apt-get install tcl8.5

make test   //这句话仅用于测试

测试成功,OK
which redis-server  //看安装地址
/usr/local/bin/redis-server  //能够看到,redis安装在/usr/local/bin/目录下

 

接下来,启动redis:/usr/local/bin/redis-server

启动的端口为6379,能够在启动的时候指定具体的配置文件,在配置文件中指出启动的端口。

查看redis进程: ps - ef|grep redis

相关文章
相关标签/搜索