2017-02-16 50 views
0

我在Mesosphere上使用Cassandra框架,在Mesos容器上启动Cassandra节点。Cassandra在Mesos上

我运行下面的命令来安装

dcos package install --options=cassandra.json cassandra 

我可以限制特定节点上,而不是中间层随机部署部署?我知道我们可以在Docker容器中使用JSON文件中的参数约束来做到这一点,但是当我使用相同的mesos时,它说约束条件是一个无效的参数。

我做错了什么?还是有办法解决?

我cassandra.json看起来像

{ 
    "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 
    } 
} 

回答

0

鉴于你的配置例如,约束会是这样规定:

{ 
    "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 
    } 
} 

见这里的文档的例子:

https://github.com/mesosphere/dcos-cassandra-service/blob/master/docs/configuration.md#service-configuration

你可以在这里看到控制这个的配置模式:

https://github.com/mesosphere/dcos-cassandra-service/blob/master/universe/config.json