install redis as windows service
Asked Answered
S

6

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 
Slaver answered 6/10, 2014 at 9:29 Comment(0)
D
35

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

Deneendenegation answered 26/12, 2014 at 19:57 Comment(3)
I ran the command. It says Redis installed successfully as a service but I am not able to start the service. Any pointers?Soekarno
Same here, it says the service started and then stopped because nothing was using itSilvanus
I had to look this over a few times before realizing there's a space between redis.windows.conf and --log-level.Placate
D
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.

Decomposed answered 1/11, 2015 at 21:47 Comment(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!Petes
FYI, MaxHeap isn't needed anymore in Redis 3.xOppenheimer
F
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.

Fatso answered 4/4, 2017 at 22:43 Comment(0)
U
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.

Undeceive answered 28/2, 2018 at 11:25 Comment(0)
P
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.

Pluton answered 13/2, 2021 at 8:53 Comment(0)
S
0

Refer to the below document and follow the steps,

  1. download Redis latest version .msi from here

  2. Follow the instruction mentioned here

Semiaquatic answered 10/6, 2023 at 5:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.