Skip to content

Instantly share code, notes, and snippets.

@ca0abinary
Created March 27, 2015 14:50
Show Gist options
  • Save ca0abinary/a38e84bd99444ddd49fb to your computer and use it in GitHub Desktop.
Save ca0abinary/a38e84bd99444ddd49fb to your computer and use it in GitHub Desktop.
CoreOS (Mesos + Marathon + Zookeeper)
[Unit]
Description=Zookeeper service
After=docker-flannel.service
ConditionFileNotEmpty=/etc/zookeeper-release
ConditionFileNotEmpty=/etc/zookeeper-environment
[Service]
EnvironmentFile=/etc/environment
EnvironmentFile=/etc/zookeeper-release
EnvironmentFile=/etc/zookeeper-environment
ExecStartPre=/usr/bin/mkdir -p /data/zookeeper
ExecStart=/bin/bash -xc "exec /usr/bin/docker run --name zookeeper --hostname zookeeper-$(hostname) --publish 2181:2181 --publish 2888:2888 --publish 3888:3888 --publish 11099:10099 --volume /data/zookeeper:/data/zookeeper $( cat /etc/zookeeper-environment | sed -e 's/^/-e /' )quay.io/signalfuse/zookeeper:${ZOOKEEPER_RELEASE}"
ExecStop=/usr/bin/docker stop zookeeper
ExecStop=/usr/bin/docker rm zookeeper
Restart=on-failure
TimeoutSec=300
RestartSec=10
[X-Fleet]
Conflicts=zookeeper@*.service
MachineMetadata=role=services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment