Connecting to remote redis server

前端 未结 2 459
梦毁少年i
梦毁少年i 2021-02-04 00:23

I wanted to make some changes in redis.conf, so that whenever i type redis-cli it connects me to redis installed on remote server.

I know that we can connect to redis i

2条回答
  •  日久生厌
    2021-02-04 01:05

    there is no good reason to touch redis conf for this.

    just make a script that wraps redis-cli with the desired parameters to connect to the remote host

    eg. create a redis-cli-remotename.sh

    #!/bin/sh
    redis-cli -h remote.host_name
    

    and give it +x permissions (eg. chmod +x redis-cli-remotename.sh)

提交回复
热议问题