CentOS6.4 安裝Redis 教程詳解
按照下面步驟依次執(zhí)行
1.檢查依賴,安裝依賴
[root@ecs-3c46 ~]# whereis gcc gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz [root@ecs-3c46 ~]# whereis tc tc: /sbin/tc /usr/lib64/tc /usr/share/tc /usr/share/man/man8/tc.8.gz [root@ecs-3c46 ~]# whereis wget wget: /usr/bin/wget /usr/share/man/man1/wget.1.gz [root@ecs-3c46 ~]# yum -y install tcl
2.進(jìn)入/user/local/src/
[root@ecs-3c46 ~]# cd /user/local/src/
3.wget下載redis
[root@ecs-3c46 src]# wget http://download.redis.io/releases/redis-3.0.7.tar.gz
4.解壓
[root@ecs-3c46 src]tar zxvf redis-3.0.7.tar.gz
5.將文件轉(zhuǎn)存到/usr/local/redis
[root@ecs-3c46 src]mkdir /usr/local/redis [root@ecs-3c46 src]mv redis-3.0.7 /usr/local/redis [root@ecs-3c46 src]ll /usr/local/redis
6.編譯安裝
[root@ecs-3c46 src]cd /usr/local/redis [root@ecs-3c46 redis]make && make install
7.在etc目錄下創(chuàng)建redi文件夾并創(chuàng)建配置文件,并修改配置文件
[root@ecs-3c46 redis]mkdir -p /etc/redis [root@ecs-3c46 redis]pwd [root@ecs-3c46 redis]cp -fr /usr/local/redis/redis.conf /etc/redis/
8.vim編輯/etc/redis/redis.conf,修改daemonize屬性為yes
[root@ecs-3c46 redis]# vim /usr/local/redis/redis.conf # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize yes
9.執(zhí)行/usr/loal/bin/redis-server /etc/redis/redis.conf來啟動redis服務(wù)器
[root@ecs-3c46 redis]# /usr/loal/bin/redis-server /etc/redis/redis.conf -bash: /usr/loal/bin/redis-server: No such file or directory [root@ecs-3c46 redis]# /usr/local/bin/redis-server /etc/redis/redis.conf 73449:M 13 May 10:56:00.839 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.7 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 73449
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
10.再打開一個終端,切換至redis的安裝目錄執(zhí)行redis-cli
[root@ecs-3c46 bin]# redis-cli 127.0.0.1:6379> keys * (empty list or set) 127.0.0.1:6379>
以上所述是小編給大家介紹的CentOS6.4 安裝Redis 教程,希望對大家有所幫助!
相關(guān)文章
Quarkus集成redis操作Redisson實(shí)現(xiàn)數(shù)據(jù)互通
這篇文章主要為大家介紹了Quarkus集成redis操作Redisson實(shí)現(xiàn)數(shù)據(jù)互通的示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步2022-02-02基于redis實(shí)現(xiàn)的點(diǎn)贊功能設(shè)計思路詳解
點(diǎn)贊是我們現(xiàn)在經(jīng)常見到的一個效果,如朋友圈、微博都有點(diǎn)贊的效果,下面這篇文章主要跟大家分享了基于redis實(shí)現(xiàn)的點(diǎn)贊功能設(shè)計思路的相關(guān)資料,文中介紹的非常詳細(xì),對大家實(shí)現(xiàn)點(diǎn)贊功能具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起看看吧。2017-05-05Redis實(shí)現(xiàn)Session持久化的示例代碼
Redis是內(nèi)存數(shù)據(jù)庫,數(shù)據(jù)都是存儲在內(nèi)存中,為了避免服務(wù)器斷電等原因?qū)е翿edis進(jìn)程異常退出后數(shù)據(jù)的永久丟失,本文主要介紹了Redis實(shí)現(xiàn)Session持久化的示例代碼,感興趣的可以了解一下2023-09-09利用Redis的有序集合實(shí)現(xiàn)排行榜功能實(shí)例代碼
這篇文章主要給大家介紹了關(guān)于如何利用Redis的有序集合實(shí)現(xiàn)排行榜功能的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者使用Redis具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-03-03windows下使用redis requirepass認(rèn)證不起作用的解決方法
今天小編就為大家分享一篇windows下使用redis requirepass認(rèn)證不起作用的解決方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-05-05redis集群實(shí)現(xiàn)清理前綴相同的key
這篇文章主要介紹了redis集群實(shí)現(xiàn)清理前綴相同的key,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-10-10