zoukankan      html  css  js  c++  java
  • 部署redis6.0 常见问题

    问题1:在make的时候,提示如下错误:

    server.c:5170:39: error: ‘struct redisServer’ has no member named ‘maxmemory’
    if (server.maxmemory > 0 && server.maxmemory < 1024*1024) {
                                      ^
    server.c:5171:176: error: ‘struct redisServer’ has no member named ‘maxmemory’
        serverLog(LL_WARNING,"WARNING: You specified a maxmemory value that is less than 1MB (current value is %llu bytes). Are you sure this is what you really want?", server.maxmemory);
                                                                                                                                                                               ^
    server.c:5174:31: error: ‘struct redisServer’ has no member named ‘server_cpulist’
    redisSetCpuAffinity(server.server_cpulist);
    

    解决办法:
    出现这种错误是由于gcc版本太低,升级gcc

    # 查看gcc版本是否在5.3以上,centos7.6默认安装4.8.5
    gcc -v
    # 升级gcc到5.3及以上,如下:
    升级到gcc 9.3:
    yum -y install centos-release-scl
    yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
    scl enable devtoolset-9 bash
    需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
    如果要长期使用gcc 9.3的话:
     
    echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
    这样退出shell重新打开就是新版的gcc了
    以下其他版本同理,修改devtoolset版本号即可
    

    原文借鉴:
    https://www.cnblogs.com/blackBlog/p/12924891.html

  • 相关阅读:
    3-8
    3-7
    3-5
    3-4
    3-3
    3-2
    3-1
    2-11
    2-10
    2-9
  • 原文地址:https://www.cnblogs.com/yjt1993/p/13496132.html
Copyright © 2011-2022 走看看