28

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 
Lloyd
  • 27,966
  • 4
  • 78
  • 91
user3925697
  • 549
  • 2
  • 7
  • 16

6 Answers6

32

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")

Bigman74066
  • 309
  • 1
  • 10
Zri
  • 372
  • 3
  • 11
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.

Shujaat
  • 644
  • 4
  • 16
  • 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 Jan 27 '16 at 14:31
  • 2
    FYI, MaxHeap isn't needed anymore in Redis 3.x – Tim P. Feb 17 '16 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.

SimonFarron
  • 142
  • 4
-1

just run this command: redis-server --service-install

and then restart your pc and then run redis-cli it works fine