一.工具準備
- VMware 15(centos 7)
鏈接:
https://pan.baidu.com/s/1f5xW2d18vSHHhpz3KsZIHA
提取碼:gpf7
- Xftp 5 & Xshell 5
鏈接:
https://pan.baidu.com/s/1gqe_M1fKQtIAT5BaNhj2BQ
提取碼:utar
- redis安裝包
下載地址:
https://download.redis.io/releases/
二.安裝Redis
2.1 查看linux ip地址
[root@localhost ~]# ifconfig
2.2 Xshell連接Linux
2.3 Xftp連接linux
2.4 安裝Redis
2.4.1 使用Xftp將Redis傳輸到Linux中
[root@localhost data]# cd program/
[root@localhost program]# ls
redis-3.2.11.tar.gz
2.4.2 解壓Redis
[root@localhost program]# tar -zxvf redis-3.2.11.tar.gz
redis-3.2.11/
redis-3.2.11/.gitignore
2.4.3 進入到Redis目錄下,編譯Redis
[root@localhost program]# cd redis-3.2.11
[root@localhost redis-3.2.11]# ls
00-RELEASENOTES CONTRIBUTING deps Makefile README.md runtest runtest-sentinel srcutils
BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster sentinel.conf tests
[root@localhost redis-3.2.11]# make
2.4.4 通過make test測試編譯狀態
[root@localhost redis-3.2.11]# make test
出現這段文字說明測試通過
o/ All tests passed without errors!
2.4.5 通過make install 完成安裝
[root@localhost program]# mkdir redis
[root@localhost program]# cd redis-3.2.11
[root@localhost redis-3.2.11]# make install PREFIX=/whm/data/program/redis
安裝完成后會有以下文件
[root@localhost redis-3.2.11]# cd ../redis
[root@localhost redis]# ls bin/
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
2.4.6 將redis.conf拷貝到redis目錄下
[root@localhost redis-3.2.11]# cp redis.conf ../redis/redis.conf
[root@localhost redis-3.2.11]# cd ../redis
[root@localhost redis]# ls
bin redis.conf
2.4.7 啟動redis
[root@localhost redis]# cd bin/
[root@localhost bin]# ./redis-server ../redis.conf
2.4.8 配置以后臺進程啟動redis
將 redis.conf 的daemonize參數設置為yes
[root@localhost bin]# vim ../redis.conf
配置完后啟動redis
[root@localhost bin]# ./redis-server ../redis.conf
2.4.9 關閉redis
[root@localhost bin]# ./redis-cli shutdown
到這里Redis就安裝完成了