zoukankan      html  css  js  c++  java
  • CentOS6.10安装redis6.0.6

    1、下载安装包:http://redis.io

    2、安装依赖

    [root@centos6 ~] yum install -y cpp binutils glibc glibc-kernheaders glibc-common glibc-devel gcc make tcl

    3、解压安装

    [root@centos6 ~] tar -zxvf redis-6.0.6.tar.gz
    [root@centos6 ~] cd redis-6.0.6
    [root@centos6 ~] make
    [root@centos6 ~] make test
    [root@centos6 ~] make install

    出现问题:error: unrecognized command line option "-std=c11"

    原因是gcc版本低,默认安装的是4.4.7,而redis6需要更高的版本 >=4.9 

    可到到官网 http://ftp.gnu.org/gnu/gcc/ 下载4.9.4版本,手动安装。

    注意安装gcc4.9.4版本还需要mpc、mpfr、gmp等依赖(MPFR=mpfr-2.4.2;GMP=gmp-4.3.2;MPC=mpc-0.8.1),请自行安装。

    [root@centos6 ~] tar -xzf gcc-4.9.4.tar.gz
    [root@centos6 ~] cd gcc-4.9.4
    [root@centos6 gcc-4.9.4] ./configure --prefix=/usr/local/gcc --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
    [root@centos6 gcc-4.9.4] make && make install

    调整gcc相关命令:

    [root@centos6 ~] mv /usr/bin/gcc /usr/bin/gcc-4.4.7
    [root@centos6 ~] ln -s /usr/local/gcc/bin/gcc /usr/bin/gcc
    [root@centos6 ~] /usr/bin/gcc -v
    [root@centos6 ~] mv /usr/bin/g++ /usr/bin/g++-4.4.7
    [root@centos6 ~] ln -s /usr/local/gcc/bin/g++ /usr/bin/g++
    [root@centos6 ~] mv /usr/bin/c++ /usr/bin/c++-4.4.7
    [root@centos6 ~] ln -s /usr/local/gcc/bin/c++ /usr/bin/c++

    4、继续安装redis6,安装完成后修改配置文件

    [root@centos6 ~]# vim redis.conf  #修改配置文件
    protected-mode no # 关闭保护模式
    daemonize yes     # 守护进程模式开启
    bind 127.0.0.1    # 绑定IP按需修改
    port 6379         # 端口按需修改

    5、启动

    [root@centos6 redis6.0.6]# ./src/redis-server redis.conf   #启动服务命令
    [root@centos6 redis6.0.6]# netstat -tunpl | grep 6379     #查看6379端口是否占用
  • 相关阅读:
    c#线程带参数
    svn自动update到指定目录
    204. 计数质数
    178. 分数排名
    387. 字符串中的第一个唯一字符
    374. 猜数字大小
    371. 两整数之和
    350. 两个数组的交集 II
    326. 3的幂
    219. 存在重复元素 II
  • 原文地址:https://www.cnblogs.com/hunttown/p/13496414.html
Copyright © 2011-2022 走看看