redis官方传送门
Linux安装Redis服务步骤:
获取资源指定安装目录
[root@hadoop-master mnt]# mkdir reids [root@hadoop-master redis]# cd redis [root@hadoop-master redis]# wget http://download.redis.io/releases/redis-6.0.5.tar.gz [root@hadoop-master redis# tar xzf redis-6.0.5.tar.gz [root@hadoop-master redis]# cd redis-6.0.5 [root@hadoop-master redis-6.0.5]# make install PREFIX=/mnt/redis
可能会因为服务器中gcc版本的问题报错,如遇到报错就更新
make[1]: *** [server.o] 错误 1 make[1]: 离开目录“/usr/redis-6.0.1/src” make: *** [all] 错误 2 server.c:2402:11: 错误:‘struct redisServer'没有名为‘assert_file'的成员 server.assert_file = "<no file>"; ^ server.c:2403:11: 错误:‘struct redisServer'没有名为‘assert_line'的成员 server.assert_line = 0; ^ server.c:2404:11: 错误:‘struct redisServer'没有名为‘bug_report_start'的成员 server.bug_report_start = 0; ^ server.c:2405:11: 错误:‘struct redisServer'没有名为‘watchdog_period'的成员 server.watchdog_period = 0; ^ server.c:2411:11: 错误:‘struct redisServer'没有名为‘lua_always_replicate_commands'的成员 server.lua_always_replicate_commands = 1;
解决方案
[root@hadoop-master redis-6.0.5]# gcc -v # 查看gcc版本 [root@hadoop-master redis-6.0.5]# yum -y install centos-release-scl # 升级到9.1版本 [root@hadoop-master redis-6.0.5]# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils [root@hadoop-master redis-6.0.5]# scl enable devtoolset-9 bash 以上为临时启用,如果要长期使用gcc 9.1的话: [root@hadoop-master redis-6.0.5]# echo "source /opt/rh/devtoolset-9/enable" /etc/profile
再次执行
#指定安装的位置 [root@hadoop-master redis-6.0.5]# make install PREFIX=/mnt/redis
成功提示
执行make test出错解决方案
[root@localhost redis-6.0.5]# yum install tcl [root@localhost redis-6.0.5]# make test
启动redis
[root@hadoop-master redis]# cd /mnt/redis/bin/ #指定配置文件 [root@hadoop-master bin]# ./redis-server ../redis-6.0.5/redis.conf
可能遇到的遇到的警告提示
# 启动server出现的问题 src/redis-server # warning 1 > 提示修改 linux内核参数 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. echo 1024 >/proc/sys/net/core/somaxconn # warn 2 > 提示如下 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. echo "vm.overcommit_memory = 1" /etc/sysctl.conf sysctl vm.overcommit_memory=1 # warning 3 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled echo never > /sys/kernel/mm/transparent_hugepage/enabled # 云服务器要注意ip要写对,端口要开放 # 虚拟机要注意防火墙要关闭 systemctl stop firewalld.service
正常启动画面
下面就可以尽情的去配置了。
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
暂无评论...
更新日志
2024年05月20日
2024年05月20日
- 出发吧麦芬噩兆降临之谷试炼怎么过 噩兆降临之谷阵容打法攻略
- 《黑神话:悟空》定价268元,8月20日同步上线WeGame!
- 博主称《七龙珠:电光炸裂!ZERO》或将在10月发售
- 《星期一的丰满》:新角色“热波师”变阿黑颜!?
- 张琍敏1986-群星会29[台湾版][WAV+CUE]
- 张宇《雨一直下》台首版[WAV整轨]
- 叶蕴仪1990-原宿[日本版][WAV+CUE]
- 看《庆余年2》腾讯SVIP被指VIP套娃 客服:所有用户都有广告的
- 刘畊宏脚踝受伤坐轮椅:暂时不能带大家跳操了
- 《燕云十六声》优美舞蹈幕后揭秘 国家级大师助力呈现
- 群星《2005香港高级视听展纪念大碟 SACD 》[DFF][1.9G]
- 王杰《同名精选辑》引进首版 首创[WAV+CUE][826M]
- 群星《爱情101情歌101延续篇 牵动心灵的情歌》6CD[WAV+CUE][4.2G]
- 【原神】璃月特产“人间美味”绝云椒椒的收集(58)
- 无相之草BOSS怎么打?无相草打法攻略