appid:指定路径

u4vypkhs  于 2021-06-26  发布在  Mesos
关注(0)|答案(1)|浏览(392)

我在部署mesos马拉松集群!主服务器和2个从服务器。我用负载平衡器设置的一切都很好,但是在设置完所有东西之后,我从marathon得到了这个错误。我试图部署一个名为tidb的数据库
这是我要部署的marathonjson文件(组)

[{
    "acceptedResourceRoles": [],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "grafana/grafana:6.0.1",
            "network": "BRIDGE",
            "parameters": [
                {
                    "key": "user",
                    "value": "0"
                }
            ],
            "portMappings": [
                {
                    "containerPort": 3000,
                    "hostPort": 3000,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/etc/grafana",
                "hostPath": "./config/grafana",
                "mode": "RW"
            },
            {
                "containerPath": "/tmp/dashboards",
                "hostPath": "./config/dashboards",
                "mode": "RW"
            },
            {
                "containerPath": "/var/lib/grafana",
                "hostPath": "./data/grafana",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "env": {
        "GF_LOG_LEVEL": "error",
        "GF_PATHS_CONFIG": "/etc/grafana/grafana.ini",
        "GF_PATHS_PROVISIONING": "/etc/grafana/provisioning"
    },
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "grafana",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--name=pd0",
        "--client-urls=http://0.0.0.0:2379",
        "--peer-urls=http://0.0.0.0:2380",
        "--advertise-client-urls=http://pd0:2379",
        "--advertise-peer-urls=http://pd0:2380",
        "--initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380",
        "--data-dir=/data/pd0",
        "--config=/pd.toml",
        "--log-file=/logs/pd0.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/pd:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 2379,
                    "hostPort": 0,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/pd.toml",
                "hostPath": "./config/pd.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "pd0",
    "instances": 1,
    "mem": 128,
    "requirePorts": false
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--name=pd1",
        "--client-urls=http://0.0.0.0:2379",
        "--peer-urls=http://0.0.0.0:2380",
        "--advertise-client-urls=http://pd1:2379",
        "--advertise-peer-urls=http://pd1:2380",
        "--initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380",
        "--data-dir=/data/pd1",
        "--config=/pd.toml",
        "--log-file=/logs/pd1.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/pd:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 2379,
                    "hostPort": 0,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/pd.toml",
                "hostPath": "./config/pd.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "pd1",
    "instances": 1,
    "mem": 128,
    "requirePorts": false
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--name=pd2",
        "--client-urls=http://0.0.0.0:2379",
        "--peer-urls=http://0.0.0.0:2380",
        "--advertise-client-urls=http://pd2:2379",
        "--advertise-peer-urls=http://pd2:2380",
        "--initial-cluster=pd0=http://pd0:2380,pd1=http://pd1:2380,pd2=http://pd2:2380",
        "--data-dir=/data/pd2",
        "--config=/pd.toml",
        "--log-file=/logs/pd2.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/pd:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 2379,
                    "hostPort": 0,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/pd.toml",
                "hostPath": "./config/pd.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "pd2",
    "instances": 1,
    "mem": 128,
    "requirePorts": false
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--log.level=error",
        "--storage.tsdb.path=/data/prometheus",
        "--config.file=/etc/prometheus/prometheus.yml"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "prom/prometheus:v2.2.1",
            "network": "BRIDGE",
            "parameters": [
                {
                    "key": "user",
                    "value": "root"
                }
            ],
            "portMappings": [
                {
                    "containerPort": 9090,
                    "hostPort": 9090,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/etc/prometheus/prometheus.yml",
                "hostPath": "./config/prometheus.yml",
                "mode": "RO"
            },
            {
                "containerPath": "/etc/prometheus/pd.rules.yml",
                "hostPath": "./config/pd.rules.yml",
                "mode": "RO"
            },
            {
                "containerPath": "/etc/prometheus/tikv.rules.yml",
                "hostPath": "./config/tikv.rules.yml",
                "mode": "RO"
            },
            {
                "containerPath": "/etc/prometheus/tidb.rules.yml",
                "hostPath": "./config/tidb.rules.yml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "prometheus",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--log.level=error"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "prom/pushgateway:v0.3.1",
            "network": "BRIDGE"
        },
        "type": "DOCKER"
    },
    "cpus": 1.0,
    "fetch": [],
    "id": "pushgateway",
    "instances": 1,
    "mem": 128
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--store=tikv",
        "--path=pd0:2379,pd1:2379,pd2:2379",
        "--config=/tidb.toml",
        "--log-file=/logs/tidb.log",
        "--advertise-address=tidb"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tidb:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 4000,
                    "hostPort": 4000,
                    "protocol": "tcp"
                },
                {
                    "containerPort": 10080,
                    "hostPort": 10080,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/tidb.toml",
                "hostPath": "./config/tidb.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "tidb",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
},
{
    "acceptedResourceRoles": [],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tidb-vision:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 8010,
                    "hostPort": 8010,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER"
    },
    "cpus": 1.0,
    "env": {
        "PD_ENDPOINT": "pd0:2379"
    },
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "tidb-vision",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--addr=0.0.0.0:20160",
        "--advertise-addr=tikv0:20160",
        "--data-dir=/data/tikv0",
        "--pd=pd0:2379,pd1:2379,pd2:2379",
        "--config=/tikv.toml",
        "--log-file=/logs/tikv0.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tikv:latest",
            "network": "BRIDGE"
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/tikv.toml",
                "hostPath": "./config/tikv.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "id": "tikv0",
    "instances": 1,
    "mem": 128
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--addr=0.0.0.0:20160",
        "--advertise-addr=tikv1:20160",
        "--data-dir=/data/tikv1",
        "--pd=pd0:2379,pd1:2379,pd2:2379",
        "--config=/tikv.toml",
        "--log-file=/logs/tikv1.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tikv:latest",
            "network": "BRIDGE"
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/tikv.toml",
                "hostPath": "./config/tikv.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "id": "tikv1",
    "instances": 1,
    "mem": 128
},
{
    "acceptedResourceRoles": [],
    "args": [
        "--addr=0.0.0.0:20160",
        "--advertise-addr=tikv2:20160",
        "--data-dir=/data/tikv2",
        "--pd=pd0:2379,pd1:2379,pd2:2379",
        "--config=/tikv.toml",
        "--log-file=/logs/tikv2.log"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tikv:latest",
            "network": "BRIDGE"
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/tikv.toml",
                "hostPath": "./config/tikv.toml",
                "mode": "RO"
            },
            {
                "containerPath": "/data",
                "hostPath": "./data",
                "mode": "RW"
            },
            {
                "containerPath": "/logs",
                "hostPath": "./logs",
                "mode": "RW"
            }
        ]
    },
    "cpus": 1.0,
    "fetch": [],
    "id": "tikv2",
    "instances": 1,
    "mem": 128
},
{
    "acceptedResourceRoles": [],
    "args": [
        "/opt/spark/sbin/start-master.sh"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tispark:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 7077,
                    "hostPort": 7077,
                    "protocol": "tcp"
                },
                {
                    "containerPort": 8080,
                    "hostPort": 8080,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/opt/spark/conf/spark-defaults.conf",
                "hostPath": "./config/spark-defaults.conf",
                "mode": "RO"
            }
        ]
    },
    "cpus": 1.0,
    "env": {
        "SPARK_MASTER_PORT": "7077",
        "SPARK_MASTER_WEBUI_PORT": "8080"
    },
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "tispark-master",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
},
{
    "acceptedResourceRoles": [],
    "args": [
        "/opt/spark/sbin/start-slave.sh",
        "spark://tispark-master:7077"
    ],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "pingcap/tispark:latest",
            "network": "BRIDGE",
            "portMappings": [
                {
                    "containerPort": 38081,
                    "hostPort": 38081,
                    "protocol": "tcp"
                }
            ]
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/opt/spark/conf/spark-defaults.conf",
                "hostPath": "./config/spark-defaults.conf",
                "mode": "RO"
            }
        ]
    },
    "cpus": 1.0,
    "env": {
        "SPARK_WORKER_WEBUI_PORT": "38081"
    },
    "fetch": [],
    "healthChecks": [
        {
            "gracePeriodSeconds": 300,
            "intervalSeconds": 60,
            "maxConsecutiveFailures": 3,
            "path": "/",
            "portIndex": 0,
            "protocol": "HTTP",
            "timeoutSeconds": 20
        }
    ],
    "id": "tispark-slave0",
    "instances": 1,
    "mem": 128,
    "requirePorts": true
}]

我将通过以下方式部署:

curl -X POST http://<mesos_master_IP>:8080/v2/groups -d@/root/cluster.json -H "Content-type:application/json"

但是我得到了appid:指定一个路径,我的错误在哪里????

xhv8bpkk

xhv8bpkk1#

你好像错过了groupid。你发布的部分只是组定义的一部分,应该放在 apps 中的对象 groups 请求

{
  "id": "/",
  "apps": [...]
}

https://mesosphere.github.io/marathon/api-console/index.html

相关问题