zoukankan      html  css  js  c++  java
  • Redis安装异常解决办法

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

    (1)若出现如下提示,则说明未安装gcc,使用命令安装gcc:yum install gcc

    [root@localhost redis-4.0.11]# make
    cd src && make all
    make[1]: Entering directory `/root/redis-4.0.11
    /src‘ CC adlist.o /bin/sh: cc: command not found make[1]: *** [adlist.o] Error 127 make[1]: Leaving directory `/root/redis-2.8.17/src‘ make: *** [all] Error 2

    (2)若出现如下提示,则将make改为make MALLOC=libc,推测是因为编译库的问题。

    [root@localhost redis-4.0.11]# make
    cd src && make all
    make[1]: Entering directory `/root/redis-2.8.17/src‘
        CC adlist.o
    In file included from adlist.c:34:
    zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
    zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
    make[1]: *** [adlist.o] Error 1
    make[1]: Leaving directory `/root/redis-2.8.17/src‘
    make: *** [all] Error 2

    5. 安装编译后的文件:make install,redis可执行文件将被复制到/usr/local/bin/,但没有配置,手动复制配置:cp redis.conf /usr/local/bin

    6. 设置Redis密码,编辑刚刚复制的配置文件:vi redis.conf,解除requirepass参数的注释,并设置值,例如:requirepass  123456

    7. 使用配置文件启动Redis数据库:./redis-server redis.conf

    如果看到如下的界面,那么恭喜你,Redis已安装成功

    更改redis.conf文件中daemonize为yes 后台启动

    回到/usr/local/binm目录下

    执行./redis-cli  启动redis客户端

    然后密码登录   auth 后面加设置的密码  登录成功

  • 相关阅读:
    Django框架 之 logging配置
    Django框架 之 中间件
    Django框架 之 form组件
    Django框架 之 Ajax
    Django框架 之 Pagination分页实现
    3张图带你看懂扩展KMP(EXKMP)
    [TJOI2018]游园会(状压dp+LCS)
    [BZOJ 2959] 长跑(LCT+并查集)
    [NAIPC2016]Jewel Thief(决策单调性+分治)
    [BZOJ 1563] [NOI 2009] 诗人小G(决策单调性)
  • 原文地址:https://www.cnblogs.com/moxiaotao/p/9594116.html
Copyright © 2011-2022 走看看