musium
musium

Reputation: 3072

MSOpenTech Redis – Multiple instances on same machine

I’m using the windows redis port form Microsoft (GitHub).
How can I run multiple instances of redis on the same machine?
Can I use the same binaries and configure a port per instance or do I need to install the binaries (in a different directory) for each instance?

Upvotes: 7

Views: 4980

Answers (2)

musium
musium

Reputation: 3072

Ok this is how it works:

  • Make a copy of the existing config file "C:\Program Files\Redis\redis.windows-service.conf" named "C:\Program Files\Redis\redis.windows-service-new.conf"
  • Change the port and other settings like logfile and syslog-ident
  • Run the following command to create a new service:

Command:

sc create Redis2 obj= "NT AUTHORITY\NetworkService" start= auto DisplayName= "Redis2" binPath= "\"C:\Program Files\Redis\redis-server.exe\" --service-run \"C:\Program Files\Redis\redis.windows-service-new.conf\" 

Upvotes: 11

Matías Fidemraizer
Matías Fidemraizer

Reputation: 64933

You can run the same executable multiple times starting redis-server with different configurations, either using a file or by giving parameters. Obviously, the ports must be also different.

Upvotes: 3

Related Questions