-
If necessary, download and install ZooKeeper and ensure that it works properly on your system.
Formulate the command line that launches the application from a command prompt. This is what we'll run with AlwaysUp.
For this guide, we installed ZooKeeper in "C:\ZooKeeper" and this command works for us:
C:\ZooKeeper\bin\zkServer.cmd
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the command file that starts ZooKeeper, zkServer.cmd. It's the command that worked for us in step 1.
-
In the Start the application field, choose Automatically, but shortly after the computer boots.
This setting ensures that critical supporting services will be up and running before AlwaysUp launches ZooKeeper.
-
In the Name field, enter a name for this application in AlwaysUp.
We went with ZooKeeper but you can specify something else if you like:
-
Move to the Logon tab and enter the user name and password of the Windows account where you 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):
-
Next, switch to the Startup tab and check the Ensure that the Windows Networking components have started box.
This lets AlwaysUp know that ZooKeeper needs the TCP/IP networking stack to do its work:
-
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's not yet running and will be in the "Stopped" state:
-
To start ZooKeeper, choose Application > Start "ZooKeeper". The directory service will start in the background:
-
That's it! Next time your computer boots, ZooKeeper will start up immediately, before anyone logs on.
Now would be a good time to restart and confirm that ZooKeeper comes up automatically.
Finally, we encourage you to edit ZooKeeper in AlwaysUp and check out the many other settings that may be appropriate for your environment.
For example,
setup email notifications,
capture console output,
periodically restart the directory service to cure memory leaks,
and much more.