安装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.5.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg  redis-3.2.5  redis-3.2.5.tar.gz
[root@localhost ~]# cd redis-3.2.5
[root@localhost redis-3.2.5]# make

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

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

[root@localhost redis-3.2.5]# make
cd src && make all
make[1]: Entering directory `/root/redis-3.2.5/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[2]: Entering directory `/root/redis-3.2.5/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[2]: Leaving directory `/root/redis-3.2.5/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[2]: Entering directory `/root/redis-3.2.5/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[3]: Entering directory `/root/redis-3.2.5/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/root/redis-3.2.5/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/root/redis-3.2.5/deps'
make[1]: [persist-settings] Error 2 (ignored)CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/root/redis-3.2.5/src'
make: *** [all] Error 2
[root@localhost redis-3.2.5]# 

2.2.2会出现如下错误:

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

解决方法:[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=libcTo 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.5 sha=00000000:0 malloc=libc bits=64 build=a980a4204e401fc7
[root@localhost bin]# pwd
/usr/local/bin
[root@localhost bin]# 

 2.5 启动

./redis-server redis.conf

centos7安装redis3.2.5相关推荐

  1. centOS7 安装redis-3.2.6

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

  2. Centos7安装Redis3.0

    一.安装必要包 yum install gcc 二.linux下安装 #下载 wget http://download.redis.io/releases/redis-3.0.0.tar.gz tar ...

  3. linux es数据库 head,centos7安装Elasticsearch及Es-head插件详细教程(图文)

    懒惰了很久,今天来写一下Elasticsearch在centos7上安装教程以及安装过程中可能出现的报错解决方式,有不对的地方,烦请各位看官多多指教! 一.ES安装 1.环境检查 确保有java环境, ...

  4. SpringCloud(第 057 篇)CentOS7 安装 maven 编译工具

    2019独角兽企业重金招聘Python工程师标准>>> SpringCloud(第 057 篇)CentOS7 安装 maven 编译工具 一.大致介绍 1.maven 相信大家一点 ...

  5. centos7 nginx配置php7,centos7安装并配置nginx+php,centos7nginx

    centos7安装并配置nginx+php,centos7nginx centos7安装并配置nginx+php 安装nginx yum install nginx 设置nginx开启起动 syste ...

  6. centos7安装配置pgAgent

    centos7安装pgagent: 默认cmake已经安装 编译wxGTK https://excellmedia.dl.sourceforge.net/project/wxwindows/2.8.7 ...

  7. centos7 安装mysql php_Centos7安装mysql与php的方法

    本文主要和大家分享Centos7安装mysql与php的方法,希望能帮助到大家. 相关mysql视频教程推荐:<mysql教程> 官网下载安装mysql-server 依次使用下面三个命令 ...

  8. Centos7安装Apache和PHP,包含配置过程

    本文主要讲的是本人在迁移php网站相关软件的安装和配置过程,以及一下问题的解决步骤.通过阅读本文能够知道如何迁移php网站,如何配置httpd服务使得它能够解析php文件以及如何解决迁移过程中的异常问 ...

  9. LINUX CentOS7安装字体库

    LINUX CentOS7安装字体库 2017年12月26日 17:06:07 q260996583 阅读数:4866更多 个人分类: linux JAVA画图时常用到Font 类对象 这样的对象依赖 ...

最新文章

  1. Java 18 正式发布
  2. Linux 主机被入侵后的处理案例
  3. java图像处理之拉普拉斯锐化和一阶微分梯度锐化
  4. Html页面上输出不了PHP,在页面上直接输出未经解析的HTML源码
  5. 像数据科学家一样思考:12步指南(中)
  6. Numpy——浅拷贝与深拷贝
  7. MySQL group by语句用法
  8. 定时下载快速精密星历
  9. Swiper 参数说明
  10. 正点原子开发板 使用 mfgtool 上位机固化系统至emmc报错 mfgtool “Push“ error, file=“xxxxx“
  11. 乐高魔方机器人编程及图纸_LEGO 机器人魔方还原基本方法与过程
  12. 运营之光2.0 我的互联网运营方法论与自白
  13. LeetCode 6009. 使两字符串互为字母异位词的最少步骤数
  14. SSL双向认证和SSL单向认证的流程和区别
  15. 【网络编程实践--陈硕】2.4.4 procmon 程序的设计实现
  16. ROS2可视化利器---Foxglove Studio
  17. 我在51CTO微职位学软考——东隅已逝,桑榆非晚
  18. 建立统一标准的教育大数据
  19. Leecode 刷题归纳(Python——LeetCode 精选 TOP 面试题)
  20. 逐梦C++之五:string类型

热门文章

  1. python传递指针_使用Python / C API传递C指针
  2. SQLServer 存储过程
  3. autohold有什么弊端吗_自动驻车真的好用吗?很多车主不敢用,实车演示正确用法很简单...
  4. SpringBoot整合WebSocket
  5. 对于ESP8266-340模块改成MicroPytyhon模块
  6. 机械爪角度与距离之间的关系
  7. MPX2053DP压力传感器简单测量
  8. 使用数字示波器DS6104测量交流信号的幅值和相位
  9. linux系统支持游戏,3种方法让Linux系统支持游戏
  10. azkaban 与 java任务_Azkaban的任务类型分析35:JavaProcessJob的执行