30

I've just installed redis on windows with MSOpenTech port. Everything is fine but the windows service. In order to run cmd, I need to create Redis command line arguments which I don't know how to achieve.

How can I solve this problem?

This is the instruction:

Running Redis as a Service

In order to better integrate with the Windows Services model, new command line arguments have been introduced to Redis. These service arguments require an elevated user context in order to connect to the service control manager. If these commands are invoked from a non-elevated context, Redis will attempt to create an elevated context in which to execute these commands. This will cause a User Account Control dialog to be displayed by Windows and may require Administrative user credentials in order to proceed.

Installing the Service

--service-install

This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit.

This command does not start the service.

For instance:

redis-server --service-install redis.windows.conf --loglevel verbose

Uninstalling the Service

--service-uninstall 

6 Answers 6

36

In dir where you installed redis instead of

redis-server --service-install redis.windows.conf--loglevel verbose

do

redis-server --service-install redis.windows.conf --loglevel verbose

(i.e. Add a space before "--loglevel")

3
  • 1
    I ran the command. It says Redis installed successfully as a service but I am not able to start the service. Any pointers? Commented May 28, 2015 at 5:47
  • 1
    Same here, it says the service started and then stopped because nothing was using it Commented Aug 17, 2015 at 14:18
  • I had to look this over a few times before realizing there's a space between redis.windows.conf and --log-level. Commented Feb 27, 2018 at 19:57
3

Similar to starting redis from command line, before installing the service you will need to specify the maxheap parameter. Open the redis.windows.conf file and find the line which comments out maxheap; specify a suitable size in bytes.

Then run redis-server --service-install redis.windows.conf --loglevel verbose

You will need to manually start the service after you install it or just restart windows.

2
  • I had a problem that after installing the service would auto start and then stop directly. Setting the maxheap as suggested above fixed this problem!
    – ranieuwe
    Commented Jan 27, 2016 at 14:31
  • 2
    FYI, MaxHeap isn't needed anymore in Redis 3.x
    – Tim P.
    Commented Feb 17, 2016 at 22:27
1

The simplest way is,

run command prompt as an administrator and than open redis directory and write

redis-server --service-install redis.windows.conf --loglevel verbose

the service will successfully installed.

1

For me as mentioned here, Redis doesn't start as windows service on Windows7 by installing the service with --service-name parameter runs the service magically without any issue.

0

The Microsoft Redis Open Tech project has been abandoned and no longer supported.
Memurai is a Windows port of Redis that derives from that Open Tech project (see here).
It is actively maintained and supported.
Take a look.

0

Refer to the below document and follow the steps,

  1. download Redis latest version .msi from here

  2. Follow the instruction mentioned here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.