Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Record an unsuccessful redis visit

Shulou Source: shulou.com Published: 2022-06-03 05:43:51 11月24日 Update

Install redis on the virtual machine and write a unit test class to access the kv using spring-data-redis on the local machine. It was originally a very simple demo experiment, but it turned out to be a lot of tricks. In the past, we used to connect and test the redis installed by others, or the redis installed by ourselves uses redis-cli to connect, but we have never done the complete construction, but after doing it this time, we still know.

The first pit, the installed redis, after the basic configuration, you need to comment out the bind attribute in the conf file, so that any ip can be accessed. No comment is limited to those ip access. By default, bind 127.0.0.1 only allows local access.

In the second pit, you need to set password access to redis and change the requirepass password in the configuration file; protected-mode is set to yes, or if you do not need to give a password, protected-mode is set to no.

Redis default protected-mode is yes

The third pit, you need to turn off the firewall of Windows, just turn it off in the control panel.

The fourth pit, you need to turn off the firewall of linux. I use centos7. The command to turn off the firewall is as follows: directly close the firewall, systemctl stop firewalld.service; forbids the firewall to start systemctl disable firewalld.service.

After completing the above four pits, the redis on the virtual machine can finally be accessed.

Tags: Firewall fire protection password file comment native machine installed test configuration three unit command basic configuration namely properties results or panels access experiments Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia vpn MySQL Apple