microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.82k stars 5.38k forks source link

Installing Redis as Service Fails #588

Closed nathvi closed 6 years ago

nathvi commented 6 years ago

Context: OS: Windows 10

I can successfully run the command redis-server at the command line with admin rights. I canot run the command redis-server --service-install redis.windows-service.conf --loglevel verbose at the command line with admin rights. I get the following error when I try and run. Invalid argument during startup: Failed to open the .conf file: redis.windows-service.conf CWD=C:\WINDOWS\system32

tporadowski commented 6 years ago

Since your current working directory is c:\windows\system32 you'd have to have redis.windows-service.conf in there to succeed, but as the message says - the file is not there. Or am I missing something?

nathvi commented 6 years ago

I changed my cwd to the correct directory. When I run the same command, nothing happens. No confirmation that the install was successful happens.

nathvi commented 6 years ago

I do see a service named "Redis" but when I try and start via the command redis-server --service-start I get the following error with nothing else [15552] 05 Feb 14:15:31.473 # Redis service failed to start.

angelinai commented 6 years ago

@nathvi are you sure your service is not already running? Have you tried using Non-Sucking Service Manager to install services on windows? Check it out at https://nssm.cc.

You can the enable logging to the Windows EventLog. This will give you a bit more info on why you're getting strange startup errors. Take a look at your redis.windows.conf file commented out sections come with great directions.

I usually keep my redis instance under c:\redis_ver# folder and run it from there not from there. If you have your spread out files in C:\WINDOWS\system32, that may present an issue.

nathvi commented 6 years ago

My files are not in C:\WINDOWS\system32. I don't think I should have to compensate for the poor logging ability of this program in order to figure out what is going on. Redis service failed to start is very unhelpful and tells me nothing about why it failed to start. The only remotely helpful thing I found in the windows logs was

syslog-ident = redis Invalid argument during startup: unknown argument: redisservice1-start

nathvi commented 6 years ago

I tried installing Reids via the .msi installer. It seems to install and run correctly, but I can't find where any of the config files are for it...

angelinai commented 6 years ago

@nathvi Go to the windows services, find the Redis service instance(look in the name column), right click > Properties, General tab > "Path to executable" you can see where the MSI installed it.

nathvi commented 6 years ago

@angelinai , thank you. I found out that it also tells you where it is installing when you run the installer. Magical things happen when you pay attention.

angelinai commented 6 years ago

@nathvi awesome, good luck!