Centos7下Redis3.2.8最新版本安裝教程
一、系統(tǒng)環(huán)境和版本說明
Redis的版本選取目前的官網(wǎng)版本redis-3.2.8。
二、Redis的安裝步驟
2.1在線下載Redis的安裝包
[root@localhost lzh]# wget http://download.redis.io/releases/redis-3.2.8.tar.gz --2017-04-18 09:37:12-- http://download.redis.io/releases/redis-3.2.8.tar.gz 正在解析主機(jī) download.redis.io (download.redis.io)... 109.74.203.151 正在連接 download.redis.io (download.redis.io)|109.74.203.151|:80... 已連接。 已發(fā)出 HTTP 請(qǐng)求,正在等待回應(yīng)... 200 OK 長度:1547237 (1.5M) [application/x-gzip] 正在保存至: “redis-3.2.8.tar.gz” 100%[=====================================================>] 1,547,237 315KB/s 用時(shí) 5.6s 2017-04-18 09:37:20 (268 KB/s) - 已保存 “redis-3.2.8.tar.gz” [1547237/1547237])
2.2 解壓下載Redis源碼壓縮包,生成新的目錄redis-3.2.8
$ tar xzf redis-3.2.8.tar.gz
2.3進(jìn)入目錄,執(zhí)行make編譯
$ cd redis-3.2.8
$ make
需要一段時(shí)間編譯,直到看到
[/code]
注意:make命令執(zhí)行完成編譯后,會(huì)在src目錄下生成6個(gè)可執(zhí)行文件,分別是
redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-rdb、redis-sentinel。
新版本redis-check-dump改成redis-check-rdb

三、Redis安裝配置
3.1 安裝Redis,執(zhí)行make install。會(huì)將make編譯生成的6個(gè)可執(zhí)行文件拷貝到/usr/local/bin目錄下;
[root@localhost redis-3.2.8]# make install cd src && make install make[1]: 進(jìn)入目錄“/home/lzh/redis-3.2.8/src” Hint: It's a good idea to run 'make test' ;) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL install make[1]: 離開目錄“/home/lzh/redis-3.2.8/src”
3.2 執(zhí)行./utils/install_server.sh配置Redis配置之后Redis能隨系統(tǒng)啟動(dòng)。執(zhí)行期間會(huì)讓你選擇端口,文件名稱等,我都選默認(rèn)。

3.3 查看開機(jī)啟動(dòng)列表
[root@localhost redis-3.2.8]# chkconfig --list 注意:該輸出結(jié)果只顯示 SysV 服務(wù),并不包含原生 systemd 服務(wù)。SysV 配置數(shù)據(jù)可能被原生 systemd 配置覆蓋。 如果您想列出 systemd 服務(wù),請(qǐng)執(zhí)行 'systemctl list-unit-files'。 欲查看對(duì)特定 target 啟用的服務(wù)請(qǐng)執(zhí)行 'systemctl list-dependencies [target]'。 netconsole 0:關(guān) 1:關(guān) 2:關(guān) 3:關(guān) 4:關(guān) 5:關(guān) 6:關(guān) network 0:關(guān) 1:關(guān) 2:開 3:開 4:開 5:開 6:關(guān) redis_6379 0:關(guān) 1:關(guān) 2:開 3:開 4:開 5:開 6:關(guān)
四、Redis服務(wù)查看、開啟、關(guān)閉
4.1通過ps -ef|grep redis命令查看Redis進(jìn)程
[root@localhost redis-3.2.8]# ps -ef|grep redis root 12831 1 0 10:21 ? 00:00:01 /usr/local/bin/redis-server 127.0.0.1:6379 root 13100 4090 0 10:29 pts/0 00:00:00 grep --color=auto redis
4.2 關(guān)閉Redis服務(wù)操作通過/etc/init.d/redis_6379 stop命令,也可通過(service redis_6379 stop)

4.3 開啟Redis服務(wù)操作通過/etc/init.d/redis_6379 start命令,也可通過(service redis_6379 start)

也可以用redis-server命令啟動(dòng)
$ src/redis-server
五、Redis測(cè)試
[root@localhost bin]# redis-cli 127.0.0.1:6379> flushdb --清空當(dāng)前選擇的數(shù)據(jù)庫 OK 127.0.0.1:6379> set testkey 2 OK 127.0.0.1:6379> get testkey "2"
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
redis啟動(dòng)redis-server.exe閃退問題解決
本文主要介紹了redis啟動(dòng)redis-server.exe閃退問題解決,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2025-02-02
解密Redis助力雙11背后電商秒殺系統(tǒng)(推薦)
這篇文章主要介紹了解密Redis助力雙11背后電商秒殺系統(tǒng),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-10-10
Jackson2JsonRedisSerializer和GenericJackson2JsonRedisSerializ
本文主要介紹了Jackson2JsonRedisSerializer和GenericJackson2JsonRedisSerializer區(qū)別,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-04-04
如何使用redis中的zset實(shí)現(xiàn)滑動(dòng)窗口限流
滑動(dòng)窗口限流是一種常見的流量控制方法,它限制了在一定時(shí)間窗口內(nèi)的請(qǐng)求數(shù)量,下面是使用Redis ZSet實(shí)現(xiàn)滑動(dòng)窗口限流的一個(gè)簡單示例,需要的朋友可以參考下2023-09-09
Redis實(shí)現(xiàn)會(huì)話管理和token認(rèn)證的示例代碼
會(huì)話管理和身份認(rèn)證是實(shí)現(xiàn)用戶登錄、權(quán)限管理等功能的基礎(chǔ),本文主就來介紹一下Redis實(shí)現(xiàn)會(huì)話管理和token認(rèn)證的示例代碼,具有一定的參考價(jià)值,感興趣的可以了解一下2025-04-04
redis cluster支持pipeline的實(shí)現(xiàn)思路
本文給大家介紹redis cluster支持pipeline的實(shí)現(xiàn)思路,在 cluster 上執(zhí)行 pipeline 可能會(huì)由于 redis 節(jié)點(diǎn)擴(kuò)縮容 中途 redirection 切換連接導(dǎo)致結(jié)果丟失,具體細(xì)節(jié)問題請(qǐng)參考下本文2021-06-06
RedisTemplate中boundHashOps的使用小結(jié)
redisTemplate.boundHashOps(key)?是 RedisTemplate 類的一個(gè)方法,本文主要介紹了RedisTemplate中boundHashOps的使用小結(jié),具有一定的參考價(jià)值,感興趣的可以了解一下2024-04-04

