"How to install Redis in Linux"

Install Redis in Linux

http://www.redis.cn/download.html

Download the Redis installation package from the official website

Install Redis

1. Import the installation package in Linux and decompress it

Insert picture description here

我们使用的是MovaXtrem远程链接软件

After the installation package is imported into Linux, continue to install

工作目录: /usr/local/src
压缩命令: tar -xvf redis-5.0.4.tar.gz

Unzip

Insert picture description here

Successfully decompressed

Insert picture description here

The installation package can be deleted after successful decompression

    命令: rm -rf redis-5.0.4.tar.gz

successfully deleted

Insert picture description here

Change the name of the Redis root directory

    原名字: redis-5.0.4
    修改后: redis
    命令: mv redis-5.0.4 redis

Insert picture description here

2. Install Redis

说明:在redis根目录中执行如下命令

    命令: make
    命令: make install

Command explanation: make is an instruction in the C language, which means to compile

make command execution

Insert picture description here

After successful execution

make install command execution

After successful execution

Insert picture description here

Modify Redis configuration file

The Redis configuration file is named ridis.conf in the Redis directory and
enters the configuration file to modify the configuration

    命令:vim redis.conf

进去配置文件

1-Modify ip binding

Insert picture description here

Comment out the ip on line 69

Insert picture description here

2-Turn off protection mode

Insert picture description here

Change yes on line 88 to no

Insert picture description here

Turn on backend operation

Insert picture description here

Change no to yes on line 136

Insert picture description here

Redis server commands

    1.  启动 redis: redis-server redis.conf
    2.  进入客户端:  redis-cli -p 6379 exit 退出|quit|ctrl+c
    3.  关闭 redis:  redis-cli -p 6379 shutdown

Start Redis

Insert picture description here

Start and exit

Insert picture description here

Close Redis

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45103228/article/details/113749441