日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Redis Linux 安装运行实战全记录

發布時間:2025/3/8 linux 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Redis Linux 安装运行实战全记录 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

下載Redis

去Redis官網下載最新的Linux包,Redis官方沒有Windows版的下載。

https://redis.io/

下載后把包上傳到Linux服務器。

安裝Redis

1、解壓Redis包

> tar -zxvf redis-4.0.2.tar.gz

2、切換到Redis解壓目錄

> cd redis-4.0.2

3、編譯Redis

> make

如報錯按以下錯誤解決。

make: cc:命令未找到

make: *** [adlist.o] 錯誤 127

> yum install gcc

collect2: ld returned 1 exit status

make[1]: *** [redis-server] Error 1

make[1]: Leaving directory `/usr/local/redis/src'

make: *** [all] Error 2

> vi src/.make-settings,修改OPT=-O2 -march=x86-64

4、編譯測試

> make test

報錯解決。

make[1]: Entering directory /home/test/redis-4.0.2/src'<br/>CC Makefile.dep<br/>make[1]: Leaving directory/home/test/redis-4.0.2/src'
make[1]: Entering directory /home/test/redis-4.0.2/src'<br/>You need tcl 8.5 or newer in order to run the Redis test<br/>make[1]: *** [test] Error 1<br/>make[1]: Leaving directory/home/test/redis-4.0.2/src'

> wget http://downloads.sourceforge.net/tcl/tcl8.6.7-src.tar.gz> tar -zxvf tcl8.6.7-src.tar.gz> cd tcl8.6.7/unix/> ./configure> make> make install

5、安裝

切換到redis目錄執行安裝。

> make install

啟動Redis

啟動redis src目錄下的redis-server命令來啟動Redis服務。

> ./redis-server ../redis.conf

啟動成功畫面:

6651:C 17 Nov 09:24:43.145 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 6651:C 17 Nov 09:24:43.145 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=6651, just started 6651:C 17 Nov 09:24:43.145 # Configuration loaded 6651:M 17 Nov 09:24:43.147 # You requested maxclients of 10000 requiring at least 10032 max file descriptors. 6651:M 17 Nov 09:24:43.147 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted. 6651:M 17 Nov 09:24:43.147 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'._._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 4.0.2 (00000000/0) 64 bit.-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379| `-._ `._ / _.-' | PID: 6651`-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' 6651:M 17 Nov 09:24:43.157 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 6651:M 17 Nov 09:24:43.158 # Server initialized 6651:M 17 Nov 09:24:43.158 # 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. 6651:M 17 Nov 09:24:43.158 # 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. 6651:M 17 Nov 09:24:43.158 * Ready to accept connections

連接Redis

啟動redis src目錄下的redis-cli命令來連接到Redis服務。

> ./redis-cli

連接成功:

127.0.0.1:6379>

另外推薦使用客戶端連接工具:redis desktop manager。

https://redisdesktop.com/download

關注下面的微信公眾號,回復 “答案” 獲取全套Redis面試題及答案。

轉載于:https://blog.51cto.com/honly/2167526

總結

以上是生活随笔為你收集整理的Redis Linux 安装运行实战全记录的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。