简体   繁体   中英

Variable is not used in my zookeeper systemd service

I wanted to use Prometheus JMX exporter for Apache Zookeeper which was installed from Kafka package installation. I did according https://alex.dzyoba.com/blog/jmx-exporter/ so I use variable EXTRA_ARGS (+ I also set variable to /etc/enviroment):

export EXTRA_ARGS="-javaagent:/opt/jmx-exporter/jmx_prometheus_javaagent-0.16.1.jar=7070:/opt/jmx-exporter/zookeeper.yaml"

If I start zookeeper by command bellow I can see server listen on port 7070:

/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties

But when I tried to start zookeeper by systemd service server does not listen on port 7070. ExecStart is same as command which I started manually from command line.

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

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

[Install]
WantedBy=multi-user.target

Does anybody know what I do wrong and how to set properly?

Thanks, Roman

尝试

Environment="SERVER_JVMFLAGS=-javaagent:/opt/jmx-exporter/jmx_prometheus_javaagent-0.16.1.jar=7070:/opt/jmx-exporter/zookeeper.yaml"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM