zoukankan      html  css  js  c++  java
  • linux下下载redis,并且编译

    1:下载、解压、编译
    $ wget http://download.redis.io/releases/redis-3.0.6.tar.gz $ tar xzf redis-3.0.6.tar.gz $ cd redis-3.0.6 $ make
    2:结果显示很多error,127,1,2之类的,然后我参考了这个网站https://www.cnblogs.com/hyit/articles/5061439.html但是显示错误信息如下

    后来才知道make geohash-int hiredis jemalloc linenoise lua是要写在deps下面的,

    3:然后我在deps目录下执行了make geohash-int hiredis jemalloc linenoise lua命令,再切换到redis-3.2.3目录下,执行make问题解决。

    4:但是显示leaving ------src这类字样,需要切换到src目录下执行make install,即可。

     5:在src下面make test发现出现了一个error,

    错误提示是

    you need tcl8.5 or newer in   order to run make test

    make ****test error 1可参考http://www.cnblogs.com/xyinjie/p/9444280.html,写的很详细。

    解决问题方式一:去下载tcl 然后安装

    wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
    
    sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
    
    cd /usr/local/tcl8.6.1/unix/
    
    sudo ./configure
    
    sudo make
    
    sudo make install

    方式二:直接用yum安装
    [root@localhost src]# yum -y install tcl
    [root@localhost src]# make test

    显示All tests pass without error
     

    6:找到redis的配置文件redis.conf,复制reids.conf文件,最好不要在原来的配置文件上修改

    7:在/etc下放配置修改后的文件redis.conf

    9:修改redis.conf配置文件 在=====GENERAL=======下的

       daemonize no 修为为 daemonize yes    [按下i可以对文件进行编辑,编辑之后,按下esc键,然后强制保存 :wq!]还可改密码

    10: 查看后台的redis服务是否启动

    ps -ef|grep redis

    显示 root 8408 8257 12:31 pts/1 00:00:00 grep redis字样证明启动成功了

    11: 启动redis的服务

    启动的位置 /usr/local/bin

    11.1 redis-server /etc/redis.conf [注意,要启动的是自己修改过的redis配置文件,而不应该是redis自己默认的redis.conf配置文件]

    11.2 启动redis客户端的服务: redis-cli -p 6379  [启动成功标志:127.0.0.16379 > ping ] 输入ping之后,会返回pong,说明成功

    12: redishello world

    设置key1HelloWorld  set key1 helloWorld

    取出来key1            get key1

     以上是我第一次安装的整个过程。

    想要一次性直接安装成功可参考https://blog.csdn.net/typa01_kk/article/details/81436845




    2:二进制文件是编译完成后在src目录下. 运行如下:
    http://www.redis.net.cn/download/
    http://www.redis.net.cn/download/
    https://www.cnblogs.com/hyit/articles/5061439.html
    https://www.cnblogs.com/mophy/p/6955849.html
  • 相关阅读:
    CF553C Love Triangles
    CF875C National Property
    【UOJ #210】【UER #6】寻找罪犯
    ICPC南昌网络赛I题Yukino With Subinterval
    进阶式-日志打印-构建器模式
    Java 对象类型
    mqtt 消息重传
    Java 关键字 final 知识点巩固
    MQTT 5.0 新特性
    emqx 认证详细
  • 原文地址:https://www.cnblogs.com/wth21-1314/p/9756361.html
Copyright © 2011-2022 走看看