關(guān)于linux redis安裝及安裝遇到的問題
redis官方傳送門
Linux安裝Redis服務(wù)步驟:
獲取資源指定安裝目錄
[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
可能會因?yàn)榉?wù)器中g(shù)cc版本的問題報(bào)錯(cuò),如遇到報(bào)錯(cuò)就更新
make[1]: *** [server.o] 錯(cuò)誤 1
make[1]: 離開目錄“/usr/redis-6.0.1/src”
make: *** [all] 錯(cuò)誤 2
server.c:2402:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘a(chǎn)ssert_file'的成員
server.assert_file = "<no file>";
^
server.c:2403:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘a(chǎn)ssert_line'的成員
server.assert_line = 0;
^
server.c:2404:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘bug_report_start'的成員
server.bug_report_start = 0;
^
server.c:2405:11: 錯(cuò)誤:‘struct redisServer'沒有名為‘watchdog_period'的成員
server.watchdog_period = 0;
^
server.c:2411:11: 錯(cuò)誤:‘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 以上為臨時(shí)啟用,如果要長期使用gcc 9.1的話: [root@hadoop-master redis-6.0.5]# echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
再次執(zhí)行
#指定安裝的位置 [root@hadoop-master redis-6.0.5]# make install PREFIX=/mnt/redis
成功提示

執(zhí)行make test出錯(cuò)解決方案
[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出現(xiàn)的問題
src/redis-server
# warning 1 > 提示修改 linux內(nèi)核參數(shù)
# 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
# 云服務(wù)器要注意ip要寫對,端口要開放
# 虛擬機(jī)要注意防火墻要關(guān)閉 systemctl stop firewalld.service
正常啟動畫面

下面就可以盡情的去配置了。
到此這篇關(guān)于關(guān)于linux redis安裝及安裝遇到的問題的文章就介紹到這了,更多相關(guān)linux redis安裝內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- 虛擬機(jī)linux安裝redis實(shí)現(xiàn)過程解析
- Linux安裝Redis實(shí)現(xiàn)過程及報(bào)錯(cuò)解決方案
- Aliyun Linux 編譯安裝 php7.3 tengine2.3.2 mysql8.0 redis5的過程詳解
- Linux下redis5.0.5的安裝過程與配置方法
- Linux系統(tǒng)下安裝Redis數(shù)據(jù)庫過程
- Linux中Redis安裝部署的操作步驟
- Linux上安裝Redis詳細(xì)教程
- Linux服務(wù)器快速安裝Redis6.0步驟示例詳解
- Linux安裝redis后沒有redis-server的問題
- Linux(Centos7)安裝Mysql/Redis/MinIO方式
- Linux下安裝Redis 6.0.5的實(shí)現(xiàn)
相關(guān)文章
Redis遠(yuǎn)程連接Redis客戶端的實(shí)現(xiàn)步驟
本文主要介紹了Redis遠(yuǎn)程連接Redis客戶端的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-06-06
解決redis-cli報(bào)錯(cuò)Could not connect to Redis&
這篇文章主要介紹了解決redis-cli報(bào)錯(cuò)Could not connect to Redis at 127.0.0.1:6379: Connection refused,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2025-04-04
Govern Service 基于 Redis 的服務(wù)治理平臺安裝過程詳解
Govern Service 是一個(gè)輕量級、低成本的服務(wù)注冊、服務(wù)發(fā)現(xiàn)、 配置服務(wù) SDK,通過使用現(xiàn)有基礎(chǔ)設(shè)施中的 Redis 不用給運(yùn)維部署帶來額外的成本與負(fù)擔(dān),接下來通過本文給大家分享Govern Service 基于 Redis 的服務(wù)治理平臺的相關(guān)知識,感興趣的朋友一起看看吧2021-05-05
redis replication環(huán)形緩沖區(qū)算法詳解
這篇文章主要介紹了redis replication環(huán)形緩沖區(qū)算法的使用,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2025-04-04

