Run ZooKeeper as a Windows Service with AlwaysUp

How to Run Apache ZooKeeper 24/7 as a Windows Service with AlwaysUp

Automatically start ZooKeeper as soon as your server boots, without having to log in. Survive crashes, accidental shutdowns and other failures!

Apache ZooKeeper provides directory service support for distributed applications.

To install ZooKeeper as a windows service with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Start AlwaysUp.

  3. Select Application > Add to open the Add Application window:

    Add Application

  4. On the General tab:

    • In the Application field, enter the full path to the command file that starts ZooKeeper, zkServer.cmd. This should be found in the bin folder in your ZooKeeper installation directory.

      Since we have installed ZooKeeper in C:\ZooKeeper, we'll enter C:\ZooKeeper\bin\zkServer.cmd.

      Note 1: Please ensure that running this command file from a prompt (or from Windows Explorer) will start ZooKeeper as you expect. If not, then running it here with AlwaysUp will not work either!

      Note 2: zkServer.cmd invokes java to start the server without specifying the full path to the java executable. We recommend editing the zkServer.cmd to specify the full path, to avoid any potential confusion that may arise when there are multiple versions of java installed on the server.

    • In the Name field, enter a name for this application in AlwaysUp. We have used ZooKeeper but you can specify something else if you like.

    ZooKeeper Windows Service: General Tab

  5. Click over to the Logon tab and enter the user name and password of the windows account where you normally run ZooKeeper's zkServer.cmd file. Running in this context will ensure that ZooKeeper will find your java installation (and any other settings you may have configured in this account).

    ZooKeeper Windows Service: Logon Tab

  6. Next, switch to the Startup tab and check the Ensure that the Windows Networking components have started box. This informs AlwaysUp that ZooKeeper needs the TCP/IP networking stack to start and operate properly.

    ZooKeeper Windows Service: Startup Tab

  7. We're now done configuring ZooKeeper to run as a windows service, so click the Save button. In a couple of seconds, an application called ZooKeeper will show up in the AlwaysUp window. It is not yet running though (as evidenced by the Stopped state):

    ZooKeeper Windows Service: Created

  8. To start ZooKeeper, choose Application > Start "ZooKeeper":

    ZooKeeper Windows Service: Running

  9. That's it! Next time your computer boots, ZooKeeper will start up immediately, before anyone logs on.

    We encourage you to edit ZooKeeper in AlwaysUp and check out the many other settings that may be appropriate for your environment. For example, capture the output from the console to a file, hide the console, boost priority and much more.



ZooKeeper not working properly as a Windows Service?

  • Consult the AlwaysUp Troubleshooter - our online tool that can help you resolve the most common problems encountered when running an application as a windows service.
  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and ZooKeeper. The AlwaysUp Event Log Messages page explains all the messages.
  • Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.5 New!

8.0 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!