使用以下命令时:
$ dcos marathon app add example.json
Run Code Online (Sandbox Code Playgroud)
我收到输出Error: Object is not valid
示例.json
{
"id": "es-cluster",
"env": {
"MARATHON_URL": "http://127.0.0.1:8080",
"APP_ID": "es-cluster",
"ELASTICSEARCH_CLUSTER_NAME": "CLUSTERNAME"
},
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "data",
"mode": "RW",
"persistent": {
"size": 1000
}
}
],
"docker": {
"image": "some/dockerImage",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 9200
}, {
"containerPort": 9300
}]
}
},
"cpus": 0.5,
"mem": 1024,
"instances": 2
}
Run Code Online (Sandbox Code Playgroud)
如果我删除卷块(或将其保留为空),它就可以正常工作。
还可以直接使用 Marathon 的音量块来运行它,效果非常好。
如何使用 DCOS 创建具有持久卷的应用程序?