Difference between revisions of "Create Systemctl"
Jump to navigation
Jump to search
(Created page with "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...") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | Create the unit file | + | Create the unit file : |
| + | |||
| + | <pre> | ||
| + | $ sudo vi /etc/systemd/system/zookeeper.service | ||
| + | </pre> | ||
| − | |||
Enter the following unit definition into the file: | Enter the following unit definition into the file: | ||
| + | <pre> | ||
| + | [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 | |
| + | </pre> | ||
Latest revision as of 09:54, 16 March 2020
Create the unit file :
$ sudo vi /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