Reputation: 541
I am using Cassandra framework on Mesosphere which is launching Cassandra nodes on Mesos containers.
I run the following command to install
dcos package install --options=cassandra.json cassandra
Can I limit the deployment on specific nodes rather than mesosphere deploying randomly? I am aware we can do it with docker container using the parameter constraints in the JSON file, but when I use the same for mesos it says constraints is an invalid parameter.
Am I doing something wrong? or is there a way around?
My cassandra.json looks like
{
"service" : {
"name": "cassandra-test",
"cpus": 1,
"mem": 512,
"heap": 256
},
"constraints" : {
{
"hostname",
"CLUSTER",
"10.2.1.81,10.2.1.89,10.2.1.74,10.2.1.72"
}
},
"nodes": {
"cpus": 2,
"mem": 2048,
"disk": 4096,
"heap": {
"size": 1024,
"new": 100
},
"count": 2,
"seeds": 1
},
"executor" : {
"cpus": 1,
"mem": 512,
"heap": 256
},
"task" : {
"cpus": 1,
"mem": 128
}
}
Upvotes: 0
Views: 389
Reputation: 66
Given your config example, the constraints would be provided like this:
{
"service": {
"name": "cassandra-test",
"cpus": 1,
"mem": 512,
"heap": 256,
"placement_constraint": "hostname:CLUSTER:10.2.1.81,10.2.1.89,10.2.1.74,10.2.1.72"
},
"nodes": {
"cpus": 2,
"mem": 2048,
"disk": 4096,
"heap": {
"size": 1024,
"new": 100
},
"count": 2,
"seeds": 1
},
"executor": {
"cpus": 1,
"mem": 512,
"heap": 256
},
"task": {
"cpus": 1,
"mem": 128
}
}
See examples in the docs here:
You can see the config schema that controls this here:
https://github.com/mesosphere/dcos-cassandra-service/blob/master/universe/config.json
Upvotes: 0