1. Download the compressed package
Link: https://pan.baidu.com/s/1IvXq-xxZI3YckPHxXFwH9w
Extraction code: hghj
2. Turn on the master node and take a snapshot first
1. Configure Alibaba Cloud yum source and download the configuration file
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2. Generate cache
yum makecache
3. Install redis
1. Installation depends on
yum install -y gcc-c++ gcc tcl
2. Upload the compressed package and decompress
tar -xvf redis-3.0.0.tar.gz
A. First go to the place where the installation package is stored
B. Upload the compressed package through xftp
C. Unzip
3. Compile
cd redis-3.0.0
make
# make test test, there is no need
Create the installation directory
mkdir -p /usr/local/soft/redis
install
make PREFIX=/usr/local/soft/redis install
4. Copy the configuration file
cp /usr/local/module/redis-3.0.0/redis.conf /usr/local/soft/redis/bin/
5. Configure the environment variable
vim /etc/profile
to add
export REDIS_HOME=/usr/local/soft/redis/
Add $REDIS_HOME/bin after PATH
6. Make environment variables take effect
source /etc/profile
4. Start redis
1. Background start
Go to the directory and start
cd /usr/local/soft/redis/bin
redis-server
displayed on the console
nohup redis-server redis.conf &
Displayed in the nohup.out file
2. Close redis
ps -aux | grep redis
kill -9
5. Connect redis
redis-cli
Insert a piece of data
set key1 value1
query data
get key1
Six, redis visual client
1. Download the visual client installation package redis-desktop-manager-0.8.3.3850, start the installation, and proceed to the next step
2. Connect