CentOS7安裝Redis單實例

因爲環境差別,安裝過程可能遇到各類各樣的問題,不要慌,根據錯誤提示解決便可。redis

一、下載redis
下載地址在:redis.io
好比把Redis安裝到/usr/local/soft/ui

cd /usr/local/soft/
wget http://download.redis.io/releases/redis-5.0.5.tar.gz

二、解壓壓縮包url

tar -zxvf redis-5.0.5.tar.gz

三、安裝gcc依賴
Redis是C語言編寫的,編譯須要.net

yum install gcc

四、編譯安裝code

cd redis-5.0.5
make MALLOC=libc

將/usr/local/redis-5.0.5/src目錄下二進制文件安裝到/usr/local/binserver

cd src
make install

五、修改配置文件
默認的配置文件是/usr/local/redis-5.0.5/redis.conf
後臺啓動get

daemonize no

改爲io

daemonize yes

下面一行必須改爲 bind 0.0.0.0 或註釋,不然只能在本機訪問編譯

bind 127.0.0.1

若是須要密碼訪問,取消requirepass的註釋class

requirepass yourpassword

六、使用指定配置文件啓動Redis(這個命令建議配置alias)

/usr/local/soft/redis-5.0.5/src/redis-server /usr/local/soft/redis-5.0.5/redis.conf

七、進入客戶端(這個命令建議配置alias)

/usr/local/soft/redis-5.0.5/src/redis-cli

八、中止redis(在客戶端中)

redis> shutdown

ps -aux | grep redis
kill -9 xxxx

附贈一個Win7可用的Redis可視化客戶端(redis-desktop-manager-0.8.3.3850)
連接:https://pan.baidu.com/s/1m6QoUaU0AKLfiXGhSNDJww
提取碼:ewa0

轉載出處:https://gper.club/articles/7e7e7f7ff7g5egc4g6b

相關文章
相關標籤/搜索