title: How can I run Cassandra on a CoreOS virtual machine?
body: <p>I'm trying to install Cassandra on a CoreOS virtual machine. I have read that before launching the Cassandra docker container, I have to start the Cassandra service on CoreOS, through a Cassandra.service file located in /etc/systemd/system folder of the virtual machine.</p>
  
  <p>I have tried the following configuration for the Cassandra.service file</p>
  
  <pre><code>[Unit]
  Description=cassandra 
  After=docker.service 
  Requires=docker.service
  
  [Service]
  Environment=CASSANDRA_CLUSTERNAME=cluster
  CASSANDRA_SSL_STORAGE_PORT=7002 
  EnvironmentFile=-/etc/environment
  ExecStartPre=-/usr/bin/docker kill %p-%i
  ExecStartPre=-/usr/bin/docker rm %p-%i
  ExecStartPre=/usr/bin/docker pull endocode/%p
  ExecStartPre=/usr/bin/bash -c "echo $${COREOS_PUBLIC_IPV4:-$$(hostname - i)} | /usr/bin/etcdctl set /cassandra_%i"
  ExecStartPre=/usr/bin/bash -c "while [[ ! $$(/usr/bin/etcdctl get /cassandra_1) ]]; do echo 'Waiting for Cassandra Seed node'; sleep 1; done; echo 'Cassandra Seed node is UP'; /usr/bin/etcdctl get /cassandra_1"
  ExecStart=/usr/bin/bash -c "BROADCAST_ADDR=$${COREOS_PUBLIC_IPV4:- $$(hostname -i)} &amp;&amp; CASSANDRA_SEEDS=$(/usr/bin/etcdctl get /cassandra_1 | /usr/bin/tr -d '\n') &amp;&amp; exec /usr/bin/docker run --rm --name %p-%i
  -e CASSANDRA_CLUSTERNAME=${CASSANDRA_CLUSTERNAME}
  -e CASSANDRA_SEEDS=\"$CASSANDRA_SEEDS\"
  -e BROADCAST_ADDR=$BROADCAST_ADDR
  -e CASSANDRA_SSL_STORAGE_PORT=$CASSANDRA_SSL_STORAGE_PORT --publish 7000:7000 --publish 
  $CASSANDRA_SSL_STORAGE_PORT:$CASSANDRA_SSL_STORAGE_PORT -- publish 9160:9160 --publish 9042:9042 --publish 7199:7199 endocode/%p" 
  ExecStop=/usr/bin/docker stop %p-%i
  ExecStopPost=/usr/bin/etcdctl rm /cassandra_%i
  TimeoutStartSec=900s
  
  [X-Fleet] 
  Conflicts=%p@*.service
  </code></pre>
  
  <p>But when I execute </p>
  
  <blockquote>
    <p>sudo systemctl enable Cassandra.service</p>
  </blockquote>
  
  <p>or </p>
  
  <blockquote>
    <p>sudo systemctl start Cassandra.service</p>
  </blockquote>
  
  <p>I get a <strong>bad unit file setting result</strong> that no gives any useful information.</p>
  
  <p>I was wondering what is wrong in my configuration or if there is any one simplier that could work.</p>
  
  <p>Thank you.</p>