There are thousands of situations in which the connection fails, and I can't guarantee whether the situations I say below will solve the problems of the developers who read this blog.
Redis is installed on the Alibaba Cloud server, and the system is centos7
Connection tool: redis desktop manager. Program connection uses predis (of course, PHP is the best programming language in the world).
First close the binding:
vim /etc/redis.conf
Add a pound sign in front of bind xxxx#
Next, set the remote connection password:
requirepass xxxxxx
Protected mode is set to no (this mode is still not set well):
protected-mode
Setup is complete, restart redis
systemctl restart redis.service
If the connection fails, use the command: telnet xxxx 6379. If it fails, it is very likely that the Alibaba Cloud security group has not been set. Enter the management background and set the corresponding security group:
Address access terminal, please use Baidu ip
After the setup is complete, the firewall command should be typed:
Afterwards, if access is not allowed, remember to close:
Setup complete, connection test, done