Skip to content

Instantly share code, notes, and snippets.

@celaus
Created February 4, 2016 13:55
Show Gist options
  • Save celaus/07ea1f54cb4e6be8c003 to your computer and use it in GitHub Desktop.
Save celaus/07ea1f54cb4e6be8c003 to your computer and use it in GitHub Desktop.
[Unit]
Description=crate
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=3600
ExecStart=/bin/bash -c '\
HOSTS=$(fleetctl list-machines --fields=ip --no-legend \
| sed "s/$/:4300/" \
| paste -s -d","); \
/usr/bin/docker run \
--publish 4200:4200 \
--publish 4300:4300 \
--volume /data/crate:/data \
--volume /tmp:/tmp \
--env CRATE_HEAP_SIZE=8g \
--name nucla-crate-io \
crate/crate:latest \
/bin/bash -c "\
/crate/bin/crate \
-Des.http.cors.enabled=true \
-Des.http.cors.allow-credentials=true \
-Des.http.cors.allow-origin=* \
-Des.cluster.name=nuc-crate-io \
-Des.indices.recovery.concurrent_streams=6 \
-Des.gateway.expected_nodes=4 \
-Des.gateway.recover_after_nodes=4 \
-Des.multicast.enabled=false \
-Des.network.publish_host=%H \
-Des.discovery.zen.minimum_master_nodes=3 \
-Des.udc.enabled=false \
-Des.discovery.zen.ping.unicast.hosts=$HOSTS"'
ExecStop=/bin/bash -c "docker stop nucla-crate-io"
ExecStopPost=/bin/bash -c "docker rm nucla-crate-io"
[X-Fleet]
Global=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment