redis官网

https://redis.io/download

安装

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

启动

src/redis-server

make时候可能报错

xx command not found

CentOS7默认没有安装gcc,这会导致我们无法make成功。使用yum安装:

yum -y install gcc

error: jemalloc/jemalloc.h: No such file or directory

原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。

make MALLOC=libc

make之后,会出现一句Hint提示

Hint: To run 'make test' is a good idea ;)
但是不测试,通常是可以使用的。若我们运行make test ,会有如下提示

$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: ***[test] Error_1

解决办法是用yum安装tcl8.5(或去tcl的官方网站http://www.tcl.tk/下载8.5版本,并参考官网介绍进行安装)

yum install tcl

安装完之后再次执行测试

$ make test
.......
\o/ All tests passed without errors! Cleanup: may take some time... OK
make[1]: Leaving directory `/usr/local/redis-5.0.4/src'

redis设置密码

临时生效

# ./redis-cli
127.0.0.1:6379> config set requirepass 123456
OK
127.0.0.1:6379>

永久生效

需更改redis.conf配置文件
requirepass passwoord
重启redis后生效

Centos7 安装Redis,报错[adlist.o] Error jemalloc/jemalloc.h: No such file or directory的更多相关文章

  1. CentOS安装Redis报错[server.o] Error 1

    原因 准备安装的Redis服务版本为6.0.8, gcc的版本为4.8.5,可能是gcc版本过低到导致的 解决办法 安装低版本Redis或者安装高版本gcc

  2. window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error

    window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error 解决: 如果没有配置环境,在安 ...

  3. Windows安装redis报错处理(转!)

    要谈则谈,要打便打! ---2019.5.9,贸易战 转自:http://www.yayihouse.com/yayishuwu/chapter/1297 安装redis报错信息 [9204] 15 ...

  4. mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file

    mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...

  5. Mac下idea启动H5报错:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve

    1. 执行“ xcodebuild -showsdks ”,报错如下“xcode-select: error: tool 'xcodebuild' requires Xcode, but active ...

  6. lua.c:82:10: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h>

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

  7. 全志TinaLinux编译错误fatal error: unicode/ucnv.h: No such file or directory

    今天开始正式干活了 拿到一个全志Tina的板子还有一个SDK压缩包,要求我这周(只剩一天半...)就要把sdk编译通过并且把板子跑起来. 还特别跟我说他们试了下这个sdk编译没法通过,会报错... 竟 ...

  8. fatal error: openssl/sha.h: No such file or directory 解决方案

    出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries, ...

  9. 误mlogc.c:32:23: error: curl/curl.h: No such file or directory

    出现以下错误: mlogc.c:32:23: error: curl/curl.h: No such file or directory mlogc.c:1091: error: expected ' ...

  10. ubuntu16.04 编译出错:fatal error: SDL/SDL.h: No such file or directory

    在ubuntu 16.04编译神经网络代码时候,遇到了这样一种错误? fatal error: SDL/SDL.h: No such file or directory 原因是SDL库没有安装,根据你 ...

随机推荐

  1. vue锚点

    第一种: router.js中添加 mode: 'history', srcollBehavior(to,from,savedPosition){ if(to.hash){ return { sele ...

  2. [iOS]UIButton内、外边距设置

    - (void)viewDidLoad {        [super viewDidLoad];        /*         UIButton设置对应的边距image跟title的边距属性  ...

  3. Linux(一):Linux基础

    1. Linux入门 1.1. Linux概述 Linux是一套免费使用和自由传播的类Unix操作系统.Unix操作系统是上世纪70年代在贝尔实验室诞生的一个强大的多用户.多任务操作系统. Linux ...

  4. Android笔记(五) Activity的启动模式

    Android中Activity是由返回栈来管理的,在默认情况下,每当启动一个新的Activity,它都会在返回栈中入栈,并且出于栈的顶端.但是有些时候Activity已经在栈的顶端了,也就不需要再启 ...

  5. 用js刷剑指offer(二叉树中和为某一值的路径)

    题目描述 输入一颗二叉树的根节点和一个整数,打印出二叉树中结点值的和为输入整数的所有路径.路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径.(注意: 在返回值的list中,数组长度大 ...

  6. 胡搞-强化版的light oj-1055-的思路-AI版的6重暴力For循环的BFS

    新题目大意: 三个棋子按照先后顺序,可以随意方向合法地走到空位置上(而不是像原题light oj-1055中的一样三个棋子每次走的方向都一致),当三个棋子全部走进目标地点,就结束:求需要指挥的最少次数 ...

  7. P2P system: FastTrack and BitTorrent

    FastTrack FastTrack来源于Gnutella,是Gnutella 和 Napster的杂交体 有些node承担了更重要的责任,这些nodes称为supernodes,因为这些改进,它比 ...

  8. Selenium常用API的使用java语言之17-文件上传

    对于通过input标签实现的上传功能,可以将其看作是一个输入框,即通过sendKeys()指定本地文件路径的方式实现文件上传. 创建upfile.html文件,代码如下: <html> & ...

  9. Http 请求头 响应体 详解

    Referrer Policy 是什么? 我们知道,在页面引入图片.JS 等资源,或者从一个页面跳到另一个页面,都会产生新的 HTTP 请求, 浏览器一般都会给这些请求头加上表示来源的 Referre ...

  10. Python3连接MySQL数据库实战

    Python3连接MySQL数据库实战 第三方库 :pymysql 数据库连接 def connect(): try: #建立数据库连接,从左至右参数依次为 # ip地址 我用的是云端数据库 如果为本 ...