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.