-1

I want to run multiple ExecStart in one service.

I configure like this,

[Unit]
Description=Apache Kafka Server
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service

[Service]
Type=oneshot
Environment="JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64"
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server-1.properties
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server-2.properties
ExecStop=/usr/local/kafka/bin/kafka-server-stop.sh

[Install]
WantedBy=multi-user.target

But, When I run, It execute first ExecStart. It does not execute the next two ExecStart.

How do I achieve it?

RamS
  • 49
  • 8
  • Why didnt you just install Confluent Platform with apt get and that comes with SystemD scripts? https://docs.confluent.io/current/installation/scripted-install.html – OneCricketeer Apr 10 '20 at 05:41
  • @cricket_007 Can you please more details about what you tell? – RamS Apr 10 '20 at 06:26
  • You are using Ubuntu. You use Apt to install with Ubuntu. Why don't you do that? Confluent is company started by the original developers of Kafka. – OneCricketeer Apr 11 '20 at 11:43

1 Answers1

1

You cannot. You could use multiple systemd scripts that depend on each other or wrap all three in one command (for example, docker-compose -f kafka-cluster.yaml up)

FWIW, in no way is this fault tolerant, or really a good idea unless you have at least 18G memory (giving 6G RAM each) and at least a factor of 3 available mechanical HDDs on that machine (three or more pools of JBOD for log.dirs) and at least 3 separate CPU.

Note: ExecStop is also only stopping one of the broker processes

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245