Skip to content

Instantly share code, notes, and snippets.

@wkharold
Created January 26, 2015 21:13
Show Gist options
  • Save wkharold/094a37de336a18a34f2a to your computer and use it in GitHub Desktop.
Save wkharold/094a37de336a18a34f2a to your computer and use it in GitHub Desktop.
unit file for crate deployment in CoreOS Easy Development/Testing Cluster deployment
[Unit]
Description=crate
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=3600
ExecStartPre=/bin/bash -c "/usr/bin/docker rm %p || exit 0"
ExecStartPre=/usr/bin/mkdir -p /mnt/data1/crate
ExecStartPre=/usr/bin/docker pull crate:latest
ExecStart=/bin/bash -c '\
source /etc/profile.d/fleetctl.sh; \
HOSTS=$(fleetctl list-machines --fields=ip --no-legend \
| sed "s/$/:4300/" \
| paste -s -d","); \
/usr/bin/docker run \
--name %p \
--publish 4200:4200 \
--publish 4300:4300 \
--volume /mnt/data1/crate:/data \
--volume /tmp:/tmp \
--env CRATE_HEAP_SIZE=16g \
crate:latest \
/crate/bin/crate \
-Des.cluster.name=gce \
-Des.indices.store.throttle.max_bytes_per_sec=100mb \
-Des.indices.memory.index_buffer_size=30% \
-Des.indices.recovery.concurrent_streams=5 \
-Des.indices.recovery.max_bytes_per_sec=100mb \
-Des.multicast.enabled=false \
-Des.network.publish_host=%H \
-Des.discovery.zen.ping.unicast.hosts=$HOSTS'
ExecStop=/usr/bin/docker stop %p
ExecStop=/usr/bin/docker rm %p
[X-Fleet]
MachineMetadata=role=db
Conflicts=crate@*.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment