react 前端框架如何驱动企业数字化转型与创新发展
846
2022-11-29
Shell Redis单机版本部署
Reids编译安装出错
make PREFIX=/usr/local/redis install
[root@mmjredis redis-6.0.1]# make PREFIX=/usr/local/redis install
出现错误如下:
serverLog(LL_NOTICE,"The server is now ready to accept connections at %s", server.unixsocket); ^server.c:5103:19: error: ‘struct redisServer’ has no member named ‘supervised_mode’ if (server.supervised_mode == SUPERVISED_SYSTEMD) { ^server.c:5104:24: error: ‘struct redisServer’ has no member named ‘masterhost’ if (!server.masterhost) { ^server.c:5117:15: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 1024*1024) { ^server.c:5117:39: error: ‘struct redisServer’ has no member named ‘maxmemory’ if (server.maxmemory > 0 && server.maxmemory < 1024*1024) { ^server.c:5118: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: In function ‘hasActiveChildProcess’:server.c:1476:1: warning: control reaches end of non-void function [-Wreturn-type] } ^server.c: In function ‘allPersistenceDisabled’:server.c:1482:1: warning: control reaches end of non-void function [-Wreturn-type] } ^server.c: In function ‘writeCommandsDeniedByDiskError’:server.c:3747:1: warning: control reaches end of non-void function [-Wreturn-type] } ^server.c: In function ‘iAmMaster’:server.c:4914:1: warning: control reaches end of non-void function [-Wreturn-type] } ^make[1]: *** [server.o] Error 1make[1]: Leaving directory `/usr/src/redis-6.0.1/src'make: *** [install] Error 2
解决办法:
# 查看gcc版本是否在5.3以上,centos7.6默认安装4.8.5gcc -v# 升级gcc到5.3及以上,如下:升级到gcc 9.3:yum -y install centos-release-sclyum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutilsscl enable devtoolset-9 bash需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。如果要长期使用gcc 9.3的话: echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile这样退出shell重新打开就是新版的gcc了以下其他版本同理,修改devtoolset版本号即可。
Reids安装脚本
要使用redis安装脚本安装redis先要手动将gcc升级,因为执行scl enable devtoolset-9 bash升级会跳出shell脚本,所以先要手动升级,这一点比较麻烦!gcc -vyum install centos-release-scl devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils -yecho "source /opt/rh/devtoolset-9/enable" >>/etc/profilescl enable devtoolset-9 bash[root@localhost ~]# cat redis_install.sh #!/bin/bashneed_packages="wget gcc gcc-c++ tcl"redis_ver="stable"redis_install_dir="/usr/local/redis"yum install $need_packages -ycd /usr/src/if [ ! -f redis-${redis_ver}.tar.gz ];thenecho -e "\033[32mDownloading redis please wait................................\033[0m"wget -c xf redis-${redis_ver}.tar.gzcd redis-${redis_ver}echo -e "\033[32mStart to install redis please wait.........\033[0m"make PREFIX=$redis_install_dir installif [ $? -ne 0 ];then echo -e "\033[32mInstall redis-${redis_ver} failed please check!!!\033[0m" exit 1else echo -e "\033[32mInstall redis-${redis_ver} succeded.\033[0m"ficat >>/etc/profile<
[root@localhost ~]# cat redis_check.sh #!/bin/bash#/bin/bashecho -e "\033[32m-------------------------------------redis log info---------------------------------\033[0m"tail -n 20 /usr/local/redis/redis_6379.logecho -e "\033[32m-------------------------------------redis RDB AOF info------------------------------\033[0m"echo $(grep appendonly /usr/local/redis/6379.conf | head -n 1)echo $(du -sh /usr/local/redis/6379/*)echo latest_fork_usec values nu/s:$(/usr/local/redis/bin/redis-cli info | grep latest_fork_usec) echo rdbcompression values:$(/usr/local/redis/bin/redis-cli info | grep rdbcompression) echo -e "\033[32m-------------------------------------redis repliaction info---------------------------------\033[0m" /usr/local/redis/bin/redis-cli info replicationecho -e "\033[32m------------------------------------------------redis replication agrs value --------------------------\033[0m"echo repl-disabletcp-nodelay values: $(grep repl-disabletcp-nodelay /usr/local/redis/6379.conf)echo repl-timeout values:$(grep repl-timeout /usr/local/redis/6379.conf)
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~