Linux install redis based on Alibaba Cloud

1. Download the installation package https://redis.io/download

Insert picture description here


2. Import the redis compressed package into the /opt directory

Insert picture description here


3. Unzip the installation package

tar -zxvf  安装包 例如:tar -zxvf redis-6.2.3.tar.gz
Insert picture description here


4. Modify the file name, this step is arbitrary.

mv 修改前的名称  修改后的名称,例如:mv redis-6.2.3  redis6
Insert picture description here


5. Check the gcc version, if not, install gcc

yum install gcc-c++
Insert picture description here


6. Install the configuration file

进入到 redis目录下执行 make 等待安装完成
Insert picture description here


Execute make again and see the following picture to indicate that the installation is complete.

Insert picture description here


Finally confirm the configuration and installation

make install
Insert picture description here


6. Find the installation path, the installation program defaults to the /usr/local/bin directory

Insert picture description here


7. Copy the redis configuration file to the current directory

 首先创建文件夹  mkdir 文件夹名称 例如: mkdir myconfig
Insert picture description here
cp /opt/redis6/redis.conf  文件夹名称  把文件复制到指定目录,例如:cp /opt/redis6/redis.conf  myconfig
Insert picture description here


7. Modify the configuration file of redis, because redis is not started in the background by default.

vim redis.conf 进入配置文件
Insert picture description here


Find daemonize and change no to yes. After the

Insert picture description here


modification is complete, press esc to exit the editing, shift+: enter wq and press Enter to save and exit.

8. Start redis

redis-server myconfig/redis.conf

Check the startup status

ps -ef|grep redis
Insert picture description here


Test link status

redis-cli 进入客户端 输入ping 如果出现PONG则启动成功
Insert picture description here


9. Close redis

shutdown 确保进入redis-cli 再执行shutdown,否则你shutdown就是你的云服务
Insert picture description here


end