Create Systemctl

From Gejoreuy
Revision as of 09:54, 16 March 2020 by Gejor (talk | contribs)
Jump to navigation Jump to search

Create the unit file for zookeeper:

 sudo nano /etc/systemd/system/zookeeper.service

Enter the following unit definition into the file:

  [Unit]
  Requires=network.target remote-fs.target
  After=network.target remote-fs.target

  [Service]
  Type=simple
  User=kafka
  ExecStart=/home/kafka/kafka/bin/zookeeper-server-start.sh /home/kafka/kafka/config/zookeeper.properties
  ExecStop=/home/kafka/kafka/bin/zookeeper-server-stop.sh
  Restart=on-abnormal

  [Install]
  WantedBy=multi-user.target