Zookeeper is installed and run as a Windows service, and zookeeperwindows

Source: Internet
Author: User

Zookeeper is installed and run as a Windows service, and zookeeperwindows

1. The downloaded Zookeeper is run by the. cmd Batch Processing Command. By default, no windows Service Running solution is provided.

2.Download prunsrv

3.Decompress the package and copy the file.

64-bit machines with amd64/prunsrv.exe
A. Copy commons-daemon-1.0.15-bin-windows/amd64/prunsrv.exe to zookeeper-3.4.8 \ bin directory
This is the service execution program.
B. Copy the commons-daemon-1.0.15-bin-windows/prunmgr.exe TO THE zookeeper-3.4.8 \ bin directory
Monitoring Service configuration and running programs

4. Configure Environment Variables

Add two environment variables: ZOOKEEPER_SERVICE and ZOOKEEPER_HOME.

ZOOKEEPER_SERVICE: Service name (not Chinese)

ZOOKEEPER_HOME: Set to zookeeper-3.4.8 directory

5. Generate zoo. cfg

Copy A zoo_sample.cfg file under the zookeeper-3.4.8 \ conf directory and rename it to zoo. cfg

6. Add a zkServerStop. cmd file under the zookeeper-3.4.8 \ bin directory

The content is as follows:

@ Echo offsetlocalTASKLIST/svc | findstr/c: "% ZOOKEEPER_SERVICE %"> % ZOOKEEPER_HOME % \ zookeeper_svc.pidFOR/F "tokens = 2 delims =" % g in (% ZOOKEEPER_HOME % \ zookeeper_svc.pid) DO (@ set zkPID = % G) taskkill/PID % zkPID %/T/Fdel % ZOOKEEPER_HOME %/zookeeper_svc.pidendlocal7. create a batch Installation File: install. the bat content is as follows:
Prunsrv.exe "// IS // % ZOOKEEPER_SERVICE %" ^ -- DisplayName = "Zookeeper (% ZOOKEEPER_SERVICE %)" ^ -- Description = "Zookeeper (% ZOOKEEPER_SERVICE %) "^ -- Startup = auto -- StartMode = exe ^ -- StartPath = % ZOOKEEPER_HOME % ^ -- StartImage = % ZOOKEEPER_HOME % \ bin \ zkServer. cmd ^ -- StopPath = % ZOOKEEPER_HOME % \ ^ -- StopImage = % ZOOKEEPER_HOME % \ bin \ zkServerStop. cmd ^ -- StopMode = exe -- StopTimeout = 5 ^ -- LogPath = % ZOOKEEPER_HOME % -- L OgPrefix = zookeeper-wrapper ^ -- PidFile = zookeeper. pid -- LogLevel = Info -- StdOutput = auto -- StdError = auto and then run install. bat as an administrator in cmd.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.