Detailed tutorial on online installation of Redis under Linux system

Online Redis Installation Tutorial under Linux

1. Install gcc dependencies

yum install -y gcc

2. Download and unzip the installation package

1. Create a redis folder and enter

mkdir /usr/local/redis && cd /usr/local/redis

2. Download the source code and unzip it

wget https://download.redis.io/releases/redis-6.2.6.tar.gz && tar -zxvf redis-6.2.6.tar.gz

3. Compile and install

1. Enter the redis decompression directory and execute make

cd redis-6.2.6 && make

2. Install to the specified directory (remove PREFIX=/usr/local/redis if not specified)

make install PREFIX=/usr/local/redis

4. Configuration

1. Copy the redis.conf file in the source code to the redis installation directory

cp /usr/local/redis/redis-6.2.6/redis.conf /usr/local/redis/bin/

2. Modify the redis.conf configuration file

cd /usr/local/redis/bin/ && vi redis.conf
bind 127.0.0.1 #只允许本地客户端访问
port 6379 #端口号
daemonize yes #设置为后台启动
protected-mode no #允许远程连接
requirepass 123456 #设置登录密码

Five, start

1. Specify the configuration file to start

cd /usr/local/redis/bin/ && ./redis-server redis.conf

2. View redis service

ps -ef|grep redis

Connect to redis and set a password (this step is very important, I didn’t set a password at the beginning, so the external redis connection tool Redis Desktop has been unable to connect)

./redis-cli -- connect to redis

config set requirepass your password -- set password

Redis Desktop tool connection test success success

 

Guess you like

Origin blog.csdn.net/qq_42350107/article/details/127002539