安装redis

1官方介绍

Installation

Download, extract and compile Redis with:

$ wget http://download.redis.io/releases/redis-3.2.5.tar.gz
$ tar xzf redis-3.2.5.tar.gz
$ cd redis-3.2.5
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server

You can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
2 我的安装流程
2.1下载http://redis.io/见官网
2.2解压、编译(make)
[root@localhost ~]# tar xzf redis-3.2..tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg redis-3.2. redis-3.2..tar.gz
[root@localhost ~]# cd redis-3.2.
[root@localhost redis-3.2.]# make

2.2.1最小化安装的centos,默认没装gcc。

会有如下错误:   安装gcc即可  [root@localhost redis-3.2.5]#yum install -y gcc

[root@localhost redis-3.2.]# make
cd src && make all
make[]: Entering directory `/root/redis-3.2./src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[]: Entering directory `/root/redis-3.2./deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[]: Leaving directory `/root/redis-3.2./deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -O2 -g -ggdb -I../deps/geohash-int -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua geohash-int jemalloc)
make[]: Entering directory `/root/redis-3.2./deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[]: Entering directory `/root/redis-3.2./deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
make[]: gcc: Command not found
make[]: *** [net.o] Error
make[]: Leaving directory `/root/redis-3.2./deps/hiredis'
make[]: *** [hiredis] Error
make[]: Leaving directory `/root/redis-3.2./deps'
make[]: [persist-settings] Error (ignored)
CC adlist.o
/bin/sh: cc: command not found
make[]: *** [adlist.o] Error
make[]: Leaving directory `/root/redis-3.2./src'
make: *** [all] Error
[root@localhost redis-3.2.]#

2.2.2会出现如下错误:

[root@localhost redis-3.2.]# make
cd src && make all
make[]: Entering directory `/root/redis-3.2./src'
CC adlist.o
In file included from adlist.c:::
zmalloc.h::: fatal error: jemalloc/jemalloc.h: No such file or directory
#include <jemalloc/jemalloc.h>
^
compilation terminated.
make[]: *** [adlist.o] Error
make[]: Leaving directory `/root/redis-3.2./src'
make: *** [all] Error

解决方法:[root@localhost redis-3.2.5]# make MALLOC=libc

原因分析:readme内容

Allocator
--------- Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc. To force compiling against libc malloc, use: % make MALLOC=libc To compile against jemalloc on Mac OS X systems, use: % make MALLOC=jemalloc

2.2.3会出现如下错误:

其他可能问题:

如果提示couldn’t execute tcl : no such file or dicrectory,请自行安装tcl;

如果提示#error "Newer version of jemalloc required",请执行make distclean,然后再make

2.3 make install

[root@localhost ~]# cd /usr/local/bin
[root@localhost bin]# ls
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server

会安装到 系统默认路径/usr/local/bin下。当然,也可以自行拷贝他们到该路径!

2.4 安装结果验证

[root@localhost bin]# redis-server -v
Redis server v=3.2. sha=: malloc=libc bits= build=a980a4204e401fc7
[root@localhost bin]# pwd
/usr/local/bin
[root@localhost bin]#

 2.5 启动

./redis-server redis.conf

centos7安装redis3.2.5的更多相关文章

  1. centos7安装redis3.0和phpredis扩展详细教程(图文)

    整理一下centos7安装redis3.0和phpredis扩展的过程,有需要的朋友可以拿去使用. 一.安装redis3.0 1.安装必要的包 yum install gcc 2.centos7安装r ...

  2. Centos7 安装redis3.2.3 过程

    1:安装wget: yum install wget2:安装pip:    1:sudo yum -y install epel-release    2:sudo yum -y install py ...

  3. Centos7安装Redis3.2.8

    一.系统环境和版本说明 Redis的版本选取目前的官网版本redis-3.2.8. 二.Redis的安装步骤      2.1 在线下载Redis的安装包 [root@localhost lzh]# ...

  4. centOS7 安装redis-3.2.6

    0.下载tar.gz包并解压到某个位置,然后cd进入解压后的目录(redis-3.2.6)下 1.安装 make MALLOC=libc 关于为什么这样做,参考redis-3.2.6目录下的READM ...

  5. centos7安装redis3.2.5集群

    安装参照     https://blog.csdn.net/mingliangniwo/article/details/54600640  https://blog.csdn.net/u013820 ...

  6. Centos7安装Redis3.X

    本文只是简单搭建Redis,为了整合ELK用,后面会详细写. Redis:REmote DIctionary Server(远程字典服务器) 是完全开源免费的,用C语言编写的,遵守BSD协议,是一个高 ...

  7. centos7安装redis3.2.12

    1.准备安装包,放在/usr/local/src/ 2.解压安装包,解压到/usr/local/ tar zxf redis-3.2.12.tar.gz -C /usr/local/ 3.cd /us ...

  8. centos7安装PHP7的redis扩展

    前言: 在本篇博客中,我将给大家介绍如何在Centos7上安装PHP-Redis扩展,关于如何在Centos上安装redis的,可以参考另外一篇博客:Centos7安装redis 想要在php中操作r ...

  9. HP服务器 hp 360g5 centos7安装问题

    HP服务器  hp 360g5 centos7安装问题 一 :启动盘无法识别硬盘 1.进入安装光盘,用上下键选择安装centos--Install Centos7(注意不可按Enter键),如图: 2 ...

随机推荐

  1. VC++ LoadLibrary失败,错误126(找不到指定的模块)

    在VS中调用一个资源模块dll,LoadLibrary返回值为NULL,没有加载成功.GetLastError后原因为"找不到指定的模块"!代码如下: HINSTANCE hIns ...

  2. Mysql 基础2

    创建数据库:     create  database/*条件*/+ text3/*数据库名称*/ 创建数据库  步骤:查询   创建查询  查询编辑器 (写代码) 删除数据库: drop datab ...

  3. August 8th 2016, Week 33rd Monday

    Everything is going on, but don't give up trying. 万事随缘,但不要放弃努力. Every time when I want to give up, y ...

  4. linux rpm问题:怎样查看rpm安装包的安装路径

      x rpm问题:怎样查看rpm安装包的安装路径 2010-07-12 21:19:15 标签:rpm linux 路径 休闲 职场 rpm -qpl xxxxxx.rpm 1.如何安装rpm软件包 ...

  5. cf378C(模拟)

    题目链接:http://codeforces.com/contest/733/problem/C 思路:模拟 因为数组b里的元素是顺序对应a数组元素的和,可以开个c数组储存b数组元素对应的a数组元素区 ...

  6. UVA 10405最长公共子序列

    裸最长公共子序列,直接贴代码 #include<cstdio> #include<iostream> #include<algorithm> #include< ...

  7. **代码审查:Phabricator命令行工具Arcanist的基本用法

    Phabricator入门手册 http://www.oschina.net/question/191440_125562 Pharicator是FB的代码审查工具,现在我所在的团队也使用它来进行代码 ...

  8. 无废话Android之activity的生命周期、activity的启动模式、activity横竖屏切换的生命周期、开启新的activity获取他的返回值、利用广播实现ip拨号、短信接收广播、短信监听器(6)

    1.activity的生命周期 这七个方法定义了Activity的完整生命周期.实现这些方法可以帮助我们监视其中的三个嵌套生命周期循环: (1)Activity的完整生命周期 自第一次调用onCrea ...

  9. 重温WCF之群聊天程序(十)

    完成的效果图: 服务器端代码: using System; using System.Collections.Generic; using System.Linq; using System.Serv ...

  10. Log4Net配置以及使用

    跟踪程序代码,及时发现程序的运行状态,是每个成熟的软件所必不可少的一个环节,网站发布到真实的环境之后,对于程序的运行状态,我们并不能想开发环境那也,点击调试.日志记录显示就尤为重要,在.NET中记录日 ...