How can I run redis on a single server on different ports?

前端 未结 3 1597
眼角桃花
眼角桃花 2021-02-15 14:16

I\'m using kue which uses node_redis, but I\'m also already using node_redis for my sessions, so I\'d like to have kue create a server on a specific po

3条回答
  •  抹茶落季
    2021-02-15 14:44

    Launch redis-server and supply a different argument for 'port' which can be done on the command-line:

    edd@max:~$ redis-server -h
    Usage: ./redis-server [/path/to/redis.conf] [options]
           ./redis-server - (read config from stdin)
           ./redis-server -v or --version
           ./redis-server -h or --help
           ./redis-server --test-memory 
    
    Examples:
           ./redis-server (run the server with default conf)
           ./redis-server /etc/redis/6379.conf
           ./redis-server --port 7777
           ./redis-server --port 7777 --slaveof 127.0.0.1 8888
           ./redis-server /etc/myredis.conf --loglevel verbose
    
    Sentinel mode:
           ./redis-server /etc/sentinel.conf --sentinel
    edd@max:~$ 
    

    You can do this from, say, /etc/rc.local as well so that this happens at startup.

    But maybe you can also rethink your approach. Redis is so good at handling writes that you may just get by with a second database?

提交回复
热议问题