Open Redis port for remote connections

后端 未结 10 2043
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 10:00

I can ping pong Redis on the server:

# redis-cli ping
PONG

But remotely, I got problems:

$ src/redis-cli -h REMOTE.IP ping
         


        
10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 10:40

    Another possibly helpful note.

    Redis can be bound to multiple IPs - that's very helpful when you don't want to open it to entire world (0.0.0.0) but only make it accessible in local networks.

    1. sudo nano /etc/redis/redis.conf
    2. add your local network IP to the end of bind setting:

    bind 127.0.0.1 10.0.0.1

    1. restart the service: sudo service redis-server restart

    Now you can easily access redis from other computers in same network, e.g. redis-cli -h 10.0.0.1

提交回复
热议问题