Redis service failed to start

6,040 views
Skip to first unread message

Kevin Burton

unread,
Jan 21, 2015, 4:28:53 PM1/21/15
to redi...@googlegroups.com
I am working with a Windows Redis server. I issue the following commands:

.\redis-server.exe --service-install --service-name master .\redis.conf
.\redis-server.exe --service-start --service-name master

And they execute just fine. However when I want to start the slave with similar commands:

.\redis-server.exe --service-install --service-name slave .\redis.conf
.\redis-server.exe --service-start --service-name slave

I get an error that the "Redis service failed to start". I tried just running

.\redis-server.exe .\redis.conf

so the output comes to the screen and there doesn't seem to be a problem:

                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 2.8.17 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6380
 |    `-._   `._    /     _.-'    |     PID: 4880
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

[4880] 21 Jan 15:27:23.446 # Server started, Redis version 2.8.17
[4880] 21 Jan 15:27:23.446 * DB loaded from disk: 0.000 seconds
[4880] 21 Jan 15:27:23.446 * The server is now ready to accept connections on po
rt 6380
[4880] 21 Jan 15:27:23.462 * Connecting to MASTER 127.0.0.1:6379
[4880] 21 Jan 15:27:23.462 * MASTER <-> SLAVE sync started
[4880] 21 Jan 15:27:23.462 * Non blocking connect for SYNC fired the event.
[4880] 21 Jan 15:27:23.462 * Master replied to PING, replication can continue...

[4880] 21 Jan 15:27:23.462 * Partial resynchronization not possible (no cached m
aster)
[4880] 21 Jan 15:27:23.462 * Full resync from master: 5db466f41fd699e34282fddc3d
f48bf82a441bf4:995
[4880] 21 Jan 15:27:23.823 * MASTER <-> SLAVE sync: receiving 18 bytes from mast
er
[4880] 21 Jan 15:27:23.823 * MASTER <-> SLAVE sync: Flushing old data
[4880] 21 Jan 15:27:23.823 * MASTER <-> SLAVE sync: Loading DB in memory
[4880] 21 Jan 15:27:23.823 * MASTER <-> SLAVE sync: Finished with success

So why is the service version of the slave failing?

Ideas?

Thank you.

Kevin

Matt Palmer

unread,
Jan 21, 2015, 5:34:58 PM1/21/15
to redi...@googlegroups.com
On Wed, Jan 21, 2015 at 01:28:52PM -0800, Kevin Burton wrote:
> I am working with a Windows Redis server. I issue the following commands:
>
> .\redis-server.exe --service-install --service-name master .\redis.conf
> .\redis-server.exe --service-start --service-name master
>
> And they execute just fine. However when I want to start the slave with
> similar commands:
>
> .\redis-server.exe --service-install --service-name slave .\redis.conf
> .\redis-server.exe --service-start --service-name slave
>
> I get an error that the "Redis service failed to start".

Given that you're running two redis instances with the same config, you're
probably trying to listen on the same port, which is going to cause
problems. Try having two different config files, with different ports.

Also, you may wish to ask on a Windows-specific Redis list (if there is
one), about how to get access to whatever logging is available on Windows.
That may give you more specific information about what is *actually* wrong
when the slave runs as a service.

- Matt


--
There's a term for those who fantasize that the world works in precisely the
way that produces maximum convenience for them, despite years of evidence to
the contrary. The term is "Morons".
-- Greg Andrews, in the Monastery

kevin....@kaplan.com

unread,
Jan 21, 2015, 5:40:29 PM1/21/15
to redi...@googlegroups.com
The file name is the same but the invocation is in different folders/directories. It is different ports. Like I said when started not as a service everything seems to be OK. I have included the output on a earlier thread

Alexis Campailla

unread,
Jan 22, 2015, 7:44:07 AM1/22/15
to redi...@googlegroups.com

I suspect that you are hitting #181

This has been fixed in recent releases, though they haven't been published to nuget/chocolatey yet. Could you try https://github.com/MSOpenTech/redis/releases/tag/win-2.8.17.3 ? You'll have to download the .zip file and extract the binaries.


Thanks,

Alexis (MS Open Tech)

Kevin Burton

unread,
Jan 22, 2015, 10:33:20 AM1/22/15
to redi...@googlegroups.com
Thank you. I have taken a great leap forward. But, I am now stuck on starting up the sentinel. I get the error:

[4284] 22 Jan 09:26:06.552 # Sentinel runid is 532fc6ab06aae3c18ca088bf02161d060
1ec9361
[4284] 22 Jan 09:26:06.552 # Sentinel config file C:\Projects\RedisTest\RedisSer
ver\sentinel1/C:\Projects\RedisTest\RedisServer\sentinel1\redis.conf is not writ
able: Invalid argument. Exiting...

I install the sentinel service as

>.\redis-server.exe --service-install --service-name sentinel1 C:\Projects\RedisTest\RedisServer\sentinel1\redis.conf --sentinel

It is almost like I shouldn't put the full path to the configuration file?

Kevin

--
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/aRaMDSNuhj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Alexis Campailla

unread,
Jan 22, 2015, 12:16:26 PM1/22/15
to redi...@googlegroups.com
You need to invoke the service installation command from the same directory as redis-server.exe, and pass the config file as a relative path. This is a known limitation, and on my list of things to fix.

Kevin Burton

unread,
Jan 22, 2015, 3:03:12 PM1/22/15
to redi...@googlegroups.com
Not just for sentinel but master and slave services also?

Alexis Campailla

unread,
Jan 23, 2015, 8:26:39 AM1/23/15
to redi...@googlegroups.com
1) Absolute config paths work for masters/slaves but not for sentinel.
2) If you pass the config file as a relative path, it will be relative to the current directory when you run the –service-install command, but when the service is started, the current directory is set to the directory where redis-server.exe resides. If those two directories are not the same, the service won't start.

So for masters/slaves you should be able to use absolute config paths.

Kevin Burton

unread,
Jan 23, 2015, 9:36:18 AM1/23/15
to redi...@googlegroups.com
Thank you that is what I found.
Reply all
Reply to author
Forward
0 new messages