Install and configure Radis on the cloud server, configure remote connection, and simply test

Written in front: blogger server system CentOS7

Used in this blog:

The radis installation package is in my network disk

radis visualization tool in my network disk

Link: https://pan.baidu.com/s/1biKKTpkgp3peEWFyQDgWTA
extraction code: nljg

1. Download and upload the installation package

Insert picture description here

2. Unzip the installation package

tar zxvf redis-5.0.8.tar.gz -C ./

Insert picture description here

3. Enter the folder and compile

cd redis-5.0.8
make && make install

Insert picture description here

4. Enter utils to execute the installation script

 cd utils
./install_server.sh

Insert picture description here
The script execution will ask you to configure. Click Enter directly to use the default configuration. If you have special needs, you can replace it. If not, it is recommended to use the default.
Insert picture description here
Insert picture description here

5. Service commonly used commands

Check service status

systemctl status redis_6379.service

start up

systemctl start redis_6379.service

termination

systemctl stop redis_6379.service

Reboot

systemctl restart redis_6379.service

Normal operating state
Insert picture description here

6. Local test, start redis-cli client

 redis-cli 

Insert picture description here
Then there is the syntax of Radis, which is stored in key-value

set test helloworld

取key-value

get test

Insert picture description here
So far, the local test is over

7. Configure remote connection

1. Edit the configuration file of redis

vim /etc/redis/6379.conf

Modify bind 127.0.0.1 to bind 0.0.0.0

Insert picture description here
Insert picture description here
2. Set the access password
Find the #requirepass foobared line content, remove the #, you can search with vim if you can't find it, (/string can be searched)
set your own password
Insert picture description here

Insert picture description here
Save and restart Radis service
3. Open port 6379 on the server console
Insert picture description here

8. Test the remote connection

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41170600/article/details/108716538