• 安装redis,含安装步骤和安装中出现的详细错误分析


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

    2.解压文件

      tar -zxvf redis-2.8.13.tar.gz

    3.切换目录到 redis-2.8.13 目录下

      cd redis-2.8.13

    4.执行make命令

      执行此步可能报错:错误1: make: cc: Command not found make: *** [adlist.o] Error 127

                                    错误分析:linux中没有安装gcc环境

                                    解决方法:# yum  install  gcc  //安装gcc ;   # rpm -qa |grep gcc //验证gcc是否安装成功

                                   错误2:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory

                                              makezmalloc.h:55:2: error: #error "Newer version of jemalloc required"

                                    错误分析:关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。错误分析:

                                                  而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。

                                                  但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。

                                     解决办法:make MALLOC=libc

    5.执行make install命令,将可执行程序复制到/usr/local/bin下,以便以后执行程序可以不输入完整路径

    6.执行make test命令,测试编译是否正确

      执行此步可能报错:错误1:You need tcl 8.5 or newer in order to run the Redis test

                                   错误分析:make test脚本是tcl脚本,需要安装tcl解释器

                                    解决方法:1.wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz  

                                                  2.tar -xzvf tcl8.6.1-src.tar.gz

                                                  3. cd /tcl8.6.1/unix/ 

                                                  4 ./configure  

                                                  5. make

                                                  6. make install   

    7.添加密码验证

           在redis解压目录中,找到redis.conf文件,编辑这个文件,去掉#requirepass foobared之前的#号,改成自定义的密码如:requirepass test123;

         执行redis-cli shutdown、redis-server ./redis.conf。

         如果在启动时只用redis-server,不用redis-server ./redis.conf , 则在./redis.conf中配置的密码将失效。

     

                                                  

  • 相关阅读:
    Gym
    UVALive
    UVALive
    UVALive
    UVALive
    Codeforces Round #367 (Div. 2) D. Vasiliy's Multiset Trie
    HDU 5816 Hearthstone 概率dp
    欧几里德与扩展欧几里德算法(转)
    差分约束系统详解(转)
    2016年第七届蓝桥杯C/C++程序设计本科B组决赛
  • 原文地址:https://www.cnblogs.com/chengJAVA/p/5026644.html
Copyright © 2020-2023  润新知