關于linux redis安裝及安裝遇到的問題
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] 錯誤 1make[1]: 離開目錄“/usr/redis-6.0.1/src”make: *** [all] 錯誤 2server.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 disabledecho never > /sys/kernel/mm/transparent_hugepage/enabled # 云服務器要注意ip要寫對,端口要開放# 虛擬機要注意防火墻要關閉 systemctl stop firewalld.service
正常啟動畫面
下面就可以盡情的去配置了。
到此這篇關于關于linux redis安裝及安裝遇到的問題的文章就介紹到這了,更多相關linux redis安裝內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!
相關文章:
1. Fedora系統外觀怎么設置? Fedora Linux外觀主題設置技巧2. Freebsd 雙硬盤無法啟動的解決辦法3. 去掉系統快捷方式箭頭的途徑——修改注冊表4. 支持深色 / 淺色模式,微軟 Win11 Build 25281 為“產品密鑰”窗口啟用新界面5. mac程序沒反應怎么辦 mac強制關閉程序的方法6. 世界上最流行的操作系統不是Linux或者Windows,而是MINIX7. YunDetectService.exe是什么進程?YunDetectService.exe禁止使用的方法8. Win11Beta預覽版22621.1180和22623.1180發布 附KB5022363內容匯總9. rsync結合 inotfiy 實現實時備份的問題10. Mac版steam錯誤代碼118怎么解決?Mac版steam錯誤代碼118解決教程