server.c:5166:39: error: ‘struct redisServer’ has no member named ‘maxmemory’
環境
阿里雲CentOS 7 Linux version 3.10.0-1062.18.1.el7.x86_64 redis:redis-6.0.6安定版
1、エラー例
makeタイムズエラー:
server.c:5151:94: error: ‘struct redisServer’ has no member named ‘unixsocket’ serverLog(LL_NOTICE,“The server is now ready to accept connections at %s”, server.unixsocket); ^ server.c:5152:19: error: ‘struct redisServer’ has no member named ‘supervised_mode’ if (server.supervised_mode == SUPERVISED_SYSTEMD) { ^ server.c:5153:24: error: ‘struct redisServer’ has no member named ‘masterhost’ if (!server.masterhost) { ^ server.c:5166:15: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 10241024) { ^ server.c:5166:39: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 10241024) { ^ server.c:5167: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:5170:31: error: ‘struct redisServer’ has no member named ‘server_cpulist’ redisSetCpuAffinity(server.server_cpulist);
2、エラーの原因
gccバージョンの問題、新しいバージョンの.redis6.0以上
これは私が使用できるバージョン情報です:[root@iZuf6dmgl1ay07mnslvfn5Z redis-6.0.6]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper Target: x86_64-redhat-linux Configured with: …/configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
3、解決方法
5.3以降にアップグレード
4、再インストール
次にインストール操作を継続することは、ここでは説明しない.
変換元:https://blog.csdn.net/xixiyuguang/article/details/106612841
阿里雲CentOS 7 Linux version 3.10.0-1062.18.1.el7.x86_64 redis:redis-6.0.6安定版
1、エラー例
makeタイムズエラー:
server.c:5151:94: error: ‘struct redisServer’ has no member named ‘unixsocket’ serverLog(LL_NOTICE,“The server is now ready to accept connections at %s”, server.unixsocket); ^ server.c:5152:19: error: ‘struct redisServer’ has no member named ‘supervised_mode’ if (server.supervised_mode == SUPERVISED_SYSTEMD) { ^ server.c:5153:24: error: ‘struct redisServer’ has no member named ‘masterhost’ if (!server.masterhost) { ^ server.c:5166:15: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 10241024) { ^ server.c:5166:39: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 10241024) { ^ server.c:5167: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:5170:31: error: ‘struct redisServer’ has no member named ‘server_cpulist’ redisSetCpuAffinity(server.server_cpulist);
2、エラーの原因
gccバージョンの問題、新しいバージョンの.redis6.0以上
gcc -v# gcc
これは私が使用できるバージョン情報です:[root@iZuf6dmgl1ay07mnslvfn5Z redis-6.0.6]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper Target: x86_64-redhat-linux Configured with: …/configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
3、解決方法
5.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 , xshell gcc 。
# , :
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
4、再インストール
# make ,
rm -rm redis-6.0.6
tar -zxvf redis-6.0.6.tar.gz
# make
cd redis-6.0.6
make
次にインストール操作を継続することは、ここでは説明しない.
変換元:https://blog.csdn.net/xixiyuguang/article/details/106612841