Created
February 12, 2015 15:49
-
-
Save cgswong/8544e150d189a609f473 to your computer and use it in GitHub Desktop.
Elasticsearch discovery Fleet service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=ElasticSearch discovery service | |
BindsTo=elasticsearch@%i.service | |
[Service] | |
EnvironmentFile=/etc/environment | |
ExecStart=/bin/bash -c '\ | |
while true; do \ | |
curl -f ${COREOS_PRIVATE_IPV4}:9200; \ | |
if [ "$?" = "0" ]; then \ | |
etcdctl set /services/logging/es/${COREOS_PRIVATE_IPV4} \'{"http_port": 9200, "transport_port": 9300}\' --ttl 60; \ | |
else \ | |
etcdctl rm /services/logging/es/${COREOS_PRIVATE_IPV4}; \ | |
fi; \ | |
sleep 45; \ | |
done' | |
ExecStop=/usr/bin/etcdctl rm /services/logging/es/${COREOS_PRIVATE_IPV4} | |
[X-Fleet] | |
MachineOf=elasticsearch@%i.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment