I have created a simple batch file to start my redis node.
@echo off
start cmd.exe /k "cd C:\Users\cmguser\Desktop\7000 & redis-server ./redis.conf"
This batch file is working fine, if I am running it in cmd as administrator. I am creating this bat file as a windows service, through NSSM, but the service is giving following error: "windows could not start the service on local computer the service did not return an error." Referred this link.
Do I have to mentioned run as administrator in my batch file, or there is any other issue through above mentioned method?
Also I have tried creating service through following command but it threw the 1053 error :
sc create service_name binpath=C:\Users\user\Desktop\redis_config_7000 start= auto
The correct way to install redis as a service in windows:
redis-server --service-install --service-name "[your desired service name]" "[full path to your redis conf]"
As others have suggested the redis.conf must contain at least the minimum parameters. Try it with the default config and get more specific by including the default config in an instance specific config file per include
Another way is by using the sc create
command correctly:
SC CREATE [your desired service name] binpath= "\"C:\Program Files\Redis\redis-server.exe\" --service-run \"[full path to your config]\""
Please note the whitespace after binpath=
!