This commit is contained in:
Daniel Berteaud 2024-04-22 14:44:26 +02:00
parent a79eccc2f1
commit 5881f2330c
1 changed files with 5 additions and 10 deletions

View File

@ -6,11 +6,7 @@ job "[[ .instance ]]-brokers" {
group "broker" {
[[ $c := merge $c.broker $c ]]
count = [[ $c.count ]]
shutdown_delay = "6s"
[[ template "common/constraints" $c ]]
[[ template "common/group_start" $c ]]
network {
mode = "bridge"
@ -47,8 +43,8 @@ job "[[ .instance ]]-brokers" {
"-c",
"STATE=$(curl http://127.0.0.1:9404 | grep '^kafka_server_kafkaserver_brokerstate' | sed -r 's/.* (\\d+)\\.0/\\1/'); echo \"Broker state: ${STATE}\"; if [ \"${STATE}\" = \"3\" ]; then exit 0; else exit 1; fi"
]
interval = "30s"
timeout = "8s"
interval = "[[ $c.consul.check.interval ]]"
timeout = "[[ $c.consul.check.timeout ]]"
task = "kafka-broker"
}
@ -169,7 +165,7 @@ _EOT
}
[[- if conv.ToBool $c.prometheus.enabled ]]
[[- $c := merge .kafka.exporter $c ]]
[[- $c := merge .kafka.exporter $c ]]
group "exporter" {
network {
@ -189,8 +185,7 @@ _EOT
user = 9308
config {
image = "[[ $c.image ]]"
readonly_rootfs = true
[[ template "common/image" $c ]]
pids_limit = 100
command = "/local/kafka_exporter"
}