• Linux下安装Redis


    首先去官网下载redis安装包:[下载redis] 1

    准备安装

    运行命令:

    tar zxvf redis-3.0.4.tar.gz
    

    进入解压后的文件夹:

    cd redis-3.0.4
    

    编译源码:

    make
    

    出错

    如果出现下面错误:

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

    则需要安装gcc

    如果出现下面错误:

    [root@localhost redis-3.0.4]# make
    cd src&& make all
    make[1]: Entering directory `/root/redis-3.0.4/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 1make[1]: Leaving directory `/root/redis-3.0.4/src‘
    make: *** [all] Error 2
    

    则更改make命令,为 make MALLOC=libc

    安装

    安装完成后,执行make install,执行文件被复制到了/usr/local/bin中,
    需要手动复制配置文件'

    cp redis.conf /usr/local/bin
    

    启动服务器:

    ./redis-server redis.conf
    

    启动客户端:

    ./redis-cli
    

  • 相关阅读:
    docker基本指令
    Process API
    Go的Context用法
    golang的可空类型和零值
    动态编程(DynamicObject、ExpandoObject)
    git clean
    SQL Server Join
    公用表表达式 Common Table Expression
    ubuntu安装mysql
    asp.net core-使用Nlog和log4net
  • 原文地址:https://www.cnblogs.com/xing901022/p/4875409.html
Copyright © 2020-2023  润新知