Here is the Marathon JSON used to deploy Riak on Mesos backed by Flocker and Calico Docker Networking
{
"id": "marathon-demo-riak",
"apps": [{
"id": "riak1",
"container": {
"type": "DOCKER",
"docker": {
"image": "wallnerryan/riak-calico-mesos",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 8098,
"hostPort": 0,
"servicePort": 18098,
"protocol": "tcp"
}, {
"containerPort": 8087,
"hostPort": 0,
"servicePort": 18087,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
}, {
"key": "volume",
"value": "riak00001:/var/lib/riak"
}, {
"key": "volume",
"value": "riak00001-log:/var/log/riak"
}, {
"key": "net",
"value": "net2"
}, {
"key": "ip",
"value": "172.168.2.50"
}]
},
"forcePullImage": true
},
"env": {
"DOCKER_RIAK_CLUSTER_SIZE": "5",
"DOCKER_RIAK_AUTOMATIC_CLUSTERING": "0",
"DOCKER_RIAK_BACKEND": "bitcask"
},
"constraints": [
["environment", "CLUSTER", "production"]
],
"labels": {
"HAPROXY_GROUP": "internal"
},
"ports": [
18098, 18087
],
"instances": 1,
"cpus": 0.5,
"mem": 512,
"maxLaunchDelaySeconds": 3600,
"requirePorts": false
}, {
"id": "riak2",
"container": {
"type": "DOCKER",
"docker": {
"image": "wallnerryan/riak-calico-mesos",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 8098,
"hostPort": 0,
"servicePort": 28098,
"protocol": "tcp"
}, {
"containerPort": 8087,
"hostPort": 0,
"servicePort": 28087,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
}, {
"key": "volume",
"value": "riak00002:/var/lib/riak"
}, {
"key": "volume",
"value": "riak00002-log:/var/log/riak"
}, {
"key": "net",
"value": "net2"
}, {
"key": "ip",
"value": "172.168.2.52"
}]
},
"forcePullImage": true
},
"env": {
"DOCKER_RIAK_CLUSTER_SIZE": "5",
"DOCKER_RIAK_AUTOMATIC_CLUSTERING": "1",
"DOCKER_RIAK_BACKEND": "bitcask",
"SEED_PORT_8098_TCP_ADDR": "172.168.2.50"
},
"constraints": [
["environment", "CLUSTER", "production"]
],
"labels": {
"HAPROXY_GROUP": "internal"
},
"ports": [
28098, 28087
],
"dependencies": ["riak1"],
"instances": 1,
"cpus": 0.5,
"mem": 512,
"maxLaunchDelaySeconds": 3600,
"requirePorts": false
}, {
"id": "riak3",
"container": {
"type": "DOCKER",
"docker": {
"image": "wallnerryan/riak-calico-mesos",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 8098,
"hostPort": 0,
"servicePort": 38098,
"protocol": "tcp"
}, {
"containerPort": 8087,
"hostPort": 0,
"servicePort": 38087,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
}, {
"key": "volume",
"value": "riak00003:/var/lib/riak"
}, {
"key": "volume",
"value": "riak00003-log:/var/log/riak"
}, {
"key": "net",
"value": "net2"
}, {
"key": "ip",
"value": "172.168.2.53"
}]
},
"forcePullImage": true
},
"env": {
"DOCKER_RIAK_CLUSTER_SIZE": "5",
"DOCKER_RIAK_AUTOMATIC_CLUSTERING": "1",
"DOCKER_RIAK_BACKEND": "bitcask",
"SEED_PORT_8098_TCP_ADDR": "172.168.2.50"
},
"constraints": [
["environment", "CLUSTER", "production"]
],
"labels": {
"HAPROXY_GROUP": "internal"
},
"ports": [
38098, 38087
],
"dependencies": ["riak1"],
"instances": 1,
"cpus": 0.5,
"mem": 512,
"maxLaunchDelaySeconds": 3600,
"requirePorts": false
}, {
"id": "riak4",
"container": {
"type": "DOCKER",
"docker": {
"image": "wallnerryan/riak-calico-mesos",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 8098,
"hostPort": 0,
"servicePort": 48098,
"protocol": "tcp"
}, {
"containerPort": 8087,
"hostPort": 0,
"servicePort": 48087,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
}, {
"key": "volume",
"value": "riak00004:/var/lib/riak"
}, {
"key": "volume",
"value": "riak00004-log:/var/log/riak"
}, {
"key": "net",
"value": "net2"
}, {
"key": "ip",
"value": "172.168.2.54"
}]
},
"forcePullImage": true
},
"env": {
"DOCKER_RIAK_CLUSTER_SIZE": "5",
"DOCKER_RIAK_AUTOMATIC_CLUSTERING": "1",
"DOCKER_RIAK_BACKEND": "bitcask",
"SEED_PORT_8098_TCP_ADDR": "172.168.2.50"
},
"constraints": [
["environment", "CLUSTER", "production"]
],
"labels": {
"HAPROXY_GROUP": "internal"
},
"ports": [
48098, 48087
],
"dependencies": ["riak1"],
"instances": 1,
"cpus": 0.5,
"mem": 512,
"maxLaunchDelaySeconds": 3600,
"requirePorts": false
}, {
"id": "riak5",
"container": {
"type": "DOCKER",
"docker": {
"image": "wallnerryan/riak-calico-mesos",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 8098,
"hostPort": 0,
"servicePort": 58098,
"protocol": "tcp"
}, {
"containerPort": 8087,
"hostPort": 0,
"servicePort": 58087,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
}, {
"key": "volume",
"value": "riak00005:/var/lib/riak"
}, {
"key": "volume",
"value": "riak00005-log:/var/log/riak"
}, {
"key": "net",
"value": "net2"
}, {
"key": "ip",
"value": "172.168.2.55"
}]
},
"forcePullImage": true
},
"env": {
"DOCKER_RIAK_CLUSTER_SIZE": "5",
"DOCKER_RIAK_AUTOMATIC_CLUSTERING": "1",
"DOCKER_RIAK_BACKEND": "bitcask",
"SEED_PORT_8098_TCP_ADDR": "172.168.2.50"
},
"constraints": [
["environment", "CLUSTER", "production"]
],
"labels": {
"HAPROXY_GROUP": "internal"
},
"ports": [
58098, 58087
],
"dependencies": ["riak1"],
"instances": 1,
"cpus": 0.5,
"mem": 512,
"maxLaunchDelaySeconds": 3600,
"requirePorts": false
}]
}