Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register etcd as windows service is ok , but can not startup #3351

Closed
cloudtrends opened this issue Aug 21, 2015 · 13 comments
Closed

Register etcd as windows service is ok , but can not startup #3351

cloudtrends opened this issue Aug 21, 2015 · 13 comments

Comments

@cloudtrends
Copy link

hi,all

After using etcd on windows for a while , I decided that run etcd as a windows service .
I am using command : sc create myetcd binPath= ...... registered , it works.

But when I start the registered the service , the following error recorded by Event Logger :

The myetcd service failed to start due to the following error:

The service did not respond to the start or control request in a timely fashion.


Any suggestions?

Thanks in advance .

@xiang90
Copy link
Contributor

xiang90 commented Aug 22, 2015

None of the etcd team is window person... So I am afraid we cannot help you. I will mark this as window and want help for a while.

@cloudtrends
Copy link
Author

@xiang90

may be I have to dig it by myself .
thanks

@xiang90
Copy link
Contributor

xiang90 commented Aug 24, 2015

@cloudtrends Sorry! Maybe you can also send a pull request to faq.md to talk about how to run etcd as a windows service.

@judwhite
Copy link
Contributor

@cloudtrends It looks like it's currently not supported. There's another request in #1628.

I've had good experiences with https://github.com/kardianos/service and use it in production.

There's also https://godoc.org/golang.org/x/sys/windows/svc, I've not used it personally.

NSSM is another option, it'll host an exe as a service. I would prefer a code solution but NSSM apparently handles SIGTERM's and restarts properly.

@xiang90
Copy link
Contributor

xiang90 commented Aug 31, 2015

@cloudtrends Do you think @judwhite's answer solves your issue?

@judwhite
Copy link
Contributor

@xiang90 Would you mind taking a look at https://github.com/kardianos/service? NSSM is a less than ideal solution.

The last two commits in https://github.com/judwhite/nsq/commits/master show changes made to use kardianos in NSQ. Some of the changes (app to util, a few others) are unrelated to the Windows Service work and should have been made in another commit, TBH I never thought I'd be referencing it.

The only other production viable option is to run the process on startup through a scheduled task. Running as a Windows Service is the preferred approach for install, start, stop, monitoring, and other operations tasks.

@xiang90
Copy link
Contributor

xiang90 commented Aug 31, 2015

@judwhite If #1628 works, I would prefer this one. It introduces windows only dependency and does not change the code path on other platform.

@judwhite
Copy link
Contributor

@xiang90 Sounds fair. I'll look into the package and follow up within the week.

@xiang90
Copy link
Contributor

xiang90 commented Aug 31, 2015

@judwhite I will ping the original author of #1628. If both of you are interested in helping maintain windows service thing, we would be very confident and happy to accept the patch. Thanks!

@xiang90
Copy link
Contributor

xiang90 commented Aug 31, 2015

/cc @chai2010

@chai2010
Copy link

@xiang90 I will sent a new PR soon. Thanks.

@chai2010
Copy link

@xiang90 The new PR is here: #3410

@xiang90 xiang90 added this to the unplanned milestone May 10, 2016
@gyuho
Copy link
Contributor

gyuho commented May 2, 2018

Closing due to inactivity. Please create a new issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants