Redis open port under Ubuntu

After redis is installed in ubuntu, it only has local access by default. If other ip is needed to access, we need to modify the configuration file of redis.

1. dpkg -L redis-server

This command we can see that the installed files of redis are in those directories


. 2. After that, we will Modify the configuration file

sudo vim /etc/redis/redis.conf


This is what I changed. The default is 127.0.0.1

. Here I changed it to 0.0.0.0, which means that any ip can be accessed. Of course, multiple ip access can also be configured. Just separate multiple ips with spaces, just

save them. As for how to save vim, I don’t need to tell you.

After that, restart the service. Service redis-server restart If it doesn’t work, restart the system and it’s

done!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326723342&siteId=291194637