1

Hi didn't really knew if my question was more for serverfault or here, I hope devops won't mind me posting here.

I am working on a stack with mesos/marathon/docker/glusterfs, I feel tired with the lake of documentation.

I am looking for a sample marthon deployement file for deploying using glusterfs driver.

The author says that we should create the volume before, but he doesn't say anything about mounting it.

"container": {
 "type": "DOCKER",
 "docker": {
   "image": "kylemanna/openvpn:latest",
   "parameters": [
     {
       "key": "volume-driver",
       "value": "glusterfs"
     },
     {
       "key": "cap-add",
       "value": "NET_ADMIN"
     }
   ],
   "network": "BRIDGE",
   "portMappings": [
     {
       "containerPort": 1194
     } 
   ]
 },
 "volumes": [
   {
     "containerPath": "/etc/openvpn",
     "hostPath": "openvpn-data",
     "mode": "RW"
   }
 ]
}

My container keep restarting in marathon and logs says that /usr/local/bin/ovpn_run: line 16: /etc/openvpn/ovpn_env.sh: No such file or directory

On my gluster fileserver, I have these file present in /data/openvpn-data/ovpn_env.sh

I don't see any mount point in /mnt, I guess marathon did the mount itself, but because the container keep restarting, I dont see it.

I did a docker inspect to check where was stored the filesystem and I found that it is stored in /var/lib/docker-volumes/_glusterfs/openvpn-data

So here are my questions :

  • Is my marathon json file correct ?
  • Will the container wait for all data to be downloaded and should I configure something for that ?
  • Are the data erased when deleting a container on marathon?
  • Should I have my ovpn_env.sh in /data/myvolume/ovpn_env.sh or /data/myvolume/etc/openvpn/ovpn_env.sh
Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204

2 Answers2

0

Have a look at the folowing issue

and the docs at

Quote:

Docker volumes with plugin drivers is not available right now.

You'll have to create the volume/mount before you start the container, and map the host folder when you launch the app via Marathon (you do this already). I guess that's why it's currently called "persistent local volumes"...

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • Thanks @Tobi, I was looking at this : http://innerdot.com/containers/developing-a-stateful-application-on-mesos-and-docker and this : https://github.com/jmspring/mesos-stateful-example . Look fine for him. Where does your quote come from ? – Dimitri Kopriwa Apr 05 '16 at 05:34
  • It's the issue comment... (first link) – Tobi Apr 05 '16 at 10:49
  • @BigDong The article you posted uses additional arguments for the Docker daemon, and reaches persistence through other mechanisms then the persistent volumes outlined at [persistent-volumes](https://github.com/mesosphere/marathon/blob/bd076173b662b12d18e5dd568629a286b242ba91/docs/docs/persistent-volumes.md#create-an-application-with-persistent-local-volumes). With the mechanisms from the article, scaling of the application will get interesting I guess – Tobi Apr 05 '16 at 11:22
  • I want to do exactly what's in the article – Dimitri Kopriwa Apr 06 '16 at 14:04
-1

Define it in "parameters" part, like this:

  "parameters": [
    {
      "key": "volume-driver",
      "value": "glusterfs"
    },
    {
      "key": "volume",
      "value": "openvpn-data:/etc/openvpn"
    }
  ]
Jiang Jun
  • 5,245
  • 3
  • 16
  • 13
  • @BigDong Look carefully please...You define volume in marathon json's "volumes", however, I define that in "parameters". That is why my solution works. I have tested it. – Jiang Jun Jun 28 '16 at 03:06