Skip to content

Instantly share code, notes, and snippets.

@ca0abinary
Created March 27, 2015 14:53
Show Gist options
  • Save ca0abinary/9ff98c4ef4af55304b15 to your computer and use it in GitHub Desktop.
Save ca0abinary/9ff98c4ef4af55304b15 to your computer and use it in GitHub Desktop.
CoreOS (Mesos + Marathon + Zookeeper)
[Unit]
Description=MesosSlave
After=docker.service
Requires=docker.service
[Service]
Restart=on-failure
RestartSec=20
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill mesos_slave
ExecStartPre=-/usr/bin/docker rm mesos_slave
ExecStartPre=/usr/bin/docker pull mesosphere/mesos-slave:0.20.1
ExecStart=/usr/bin/sh -c "/usr/bin/docker run --name=mesos_slave --net=host --privileged -v /sys:/sys -v /usr/bin/docker:/usr/bin/docker:ro -v /var/run/docker.sock:/var/run/docker.sock -v /lib64/libdevmapper.so.1.02:/lib/libdevmapper.so.1.02:ro mesosphere/mesos-slave:0.20.1 --ip=$(/usr/bin/ip -o -4 addr list enp3s0 | grep global | awk \'{print $4}\' | cut -d/ -f1) --containerizers=docker --master=zk://zookeeper.local:2181/mesos --work_dir=/var/lib/mesos/slave --log_dir=/var/log/mesos/slave"
ExecStop=/usr/bin/docker stop mesos_slave
[Install]
WantedBy=multi-user.target
[X-Fleet]
Conflicts=mesos-slave@*.service
MachineMetadata=role=worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment