0

我知道我可以使用以下命令获取在 Spark Master 上运行的 Spark v2.2.1 版本:

http://<spark-master>:4040/api/v1/version

这将返回类似

{
  "spark" : "2.2.1"
}

但是,我还想检查每个 Worker 上运行的 Spark 版本。我知道我可以得到所有工人的名单:

http://<spark-master>:8080/json/

这将返回类似于

{
    "url": "spark://<spark-master>:7077",
    "workers": [{
            "id": "worker-20180228071440-<ip-address>-7078",
            "host": "<ip-address>",
            "port": 7078,
            "webuiaddress": "http://<ip-address>:8081",
            "cores": 8,
            "coresused": 8,
            "coresfree": 0,
            "memory": 40960,
            "memoryused": 35875,
            "memoryfree": 5085,
            "state": "ALIVE",
            "lastheartbeat": 1519932580686
        }, ...
    ],
    "cores": 32,
    "coresused": 32,
    "memory": 163840,
    "memoryused": 143500,
    "activeapps": [{
            "starttime": 1519830260440,
            "id": "app-20180228070420-0000",
            "name": "<spark-app-name>",
            "user": "<spark-app-user>",
            "memoryperslave": 35875,
            "submitdate": "Wed Feb 28 07:04:20 PST 2018",
            "state": "RUNNING",
            "duration": 102328434
        }
    ],
    "completedapps": [],
    "activedrivers": [],
    "status": "ALIVE"
}

我想使用该信息来查询每个 Spark Worker 的版本。这可能吗?

4

0 回答 0