1

Since volume service is not yet available on Swisscom is it possible to do something like this with docker on Swisscom cloud foundry:

docker run -d --volume /mydata --name elastic-shared alpine echo My Data Container
docker run -d --volumes-from elastic-shared --name myelastic elasticsearch:latest

One container will be used as a volume for the other container running elasticseach as persistent data storage.

  • 1
    What are you trying to achieve? – Sandro Mathys Jan 26 '18 at 12:12
  • Share a --volume with an elasticsearch container, being able store data from the immutable elasticsearch container into the defined --volume – Aleksandar Nikolic Jan 26 '18 at 13:38
  • But why, what for? What's your end goal? Push an elasticsearch as an app and push another app that writes to it, or what? – Sandro Mathys Jan 27 '18 at 09:06
  • Since elasticsearch uses file system for storing it's data, I need a place to persist it outside of the container so it would be saved after container restart. I also need to use logstash with JDBC plugin which uses file system to store it's state. I thought about using an external file system service but that is not yet available on swisscom. – Aleksandar Nikolic Jan 30 '18 at 09:21
  • Second idea was to have a docker application which will be used only for it's volume and for other containers to store data in it. This container will not be restarted ever. So I will have a docker application with a volume, and other docker app with elasticsearch will use that volume to store data, and when elastciserach docker is restarted data will not be lost. – Aleksandar Nikolic Jan 30 '18 at 09:21

1 Answers1

1

Alright, I see what you're trying to do but there's sone major issue with it: All application containers MUST be stateless. Just saying "I'll never restart the app that serves as a persistent volume" isn't going to make it persistent. Your app can (and will!) be rescheduled or restarted by CF at any time for various reasons.

That's also one of the major reasons why there is no volume sharing between applications, meaning that no, there's no CF equivalent to docker's --volumes-from.

Obviously, this also means using logstash in a way where it stores its state in the local filesystem is a bad idea.

Since there's no NFS volumes available on the Swisscom Application Cloud, your best bet might be to somehow store the state in S3, but I'm not sure that can be achieved (other than storing snapshots).

Sandro Mathys
  • 474
  • 3
  • 7