多机分布式调试工具JMT(任务管理工具) | 大装置帮助中心
跳到主要内容

多机分布式调试工具JMT(任务管理工具)

我们还为您提供了一个命令行工具 jmt,用于对任务进行操作(只针对开启了容错的任务)。具体操作指南如下:

  • 您需要从任务详情-Worker列表-Webterminal登录某一个Worker

  • 您需要配置环境,可以使用如下命令

/opt/transom/bin/launcher --login
# 上面的命令实际上是进入一个带有 PATH 环境变量的 Bash 环境,也可以像下面这样手动配置环境变量:
export PATH=/opt/transom/bin:$PATH

帮助说明

./jmt help  
Job Management Tool

Task Commands:
start Start task
stop Stop task
run Run commands in all pods
status Show status

Other Commands:
plugin Provides utilities for interacting with plugins.

Use "jmt <command> --help" for more information about a given command.

./jmt help run
Run commands in all pods

Options:
-t, --type='command': run type: command/task

Usage:
jmt run commands [options]

Use "jmt run options" for a list of global command-line options (applies to all commands).

使用示例

# jmt status 查看当前任务状态
root@om-ad060f41fad2448da38a3aa55d564769-worker-0:/opt/transom/bin# ./jmt status
Master Status:
Number 2 / 2
Pipeline task
Status running

Worker Status:
Index WorkerName WorkerIP NodeName NodeIP Status Detail
0 om-ad060f41fad2448da38a3aa55d564769-worker-0 10.119.30.19 host-10-111-38-42-10.111.38.42 10.111.38.42 running Task: command TaskStatus: running
1 om-ad060f41fad2448da38a3aa55d564769-worker-1 10.119.30.29 host-10-111-38-42-10.111.38.42 10.111.38.42 running Task: command TaskStatus: running

# jmt stop/start 停止/恢复当前任务
root@om-ad060f41fad2448da38a3aa55d564769-worker-0:/opt/transom/bin# ./jmt stop
root@om-ad060f41fad2448da38a3aa55d564769-worker-0:/opt/transom/bin# ./jmt status
Master Status:
Number 2 / 2
Pipeline task
Status stopped

Worker Status:
Index WorkerName WorkerIP NodeName NodeIP Status Detail
0 om-ad060f41fad2448da38a3aa55d564769-worker-0 10.119.30.19 host-10-111-38-42-10.111.38.42 10.111.38.42 pending
1 om-ad060f41fad2448da38a3aa55d564769-worker-1 10.119.30.29 host-10-111-38-42-10.111.38.42 10.111.38.42 pending
root@om-ad060f41fad2448da38a3aa55d564769-worker-0:/opt/transom/bin# ./jmt start
root@om-ad060f41fad2448da38a3aa55d564769-worker-0:/opt/transom/bin# ./jmt status
Master Status:
Number 2 / 2
Pipeline task
Status running

Worker Status:
Index WorkerName WorkerIP NodeName NodeIP Status Detail
0 om-ad060f41fad2448da38a3aa55d564769-worker-0 10.119.30.19 host-10-111-38-42-10.111.38.42 10.111.38.42 running Task: command TaskStatus: running
1 om-ad060f41fad2448da38a3aa55d564769-worker-1 10.119.30.29 host-10-111-38-42-10.111.38.42 10.111.38.42 running Task: command TaskStatus: running

# jmt run命令只能在任务停止状态下执行,因此执行jmt run指令前,需要先执行jmt stop
# jmt run --type task 执行当前任务指令,方便在真实的容器运行环境下,调试当前任务,无需申请新的资源。
# jmt run --type command 在当前任务所有容器内执行指定命令
# 在前端容器日志查看jmt run命令的输出内容
./jmt run --type command hostname -f
# 前端容器关联日志输出
time="2024-10-29T10:42:39Z" level=info msg="Run Command: [hostname -f]"
om-ad060f41fad2448da38a3aa55d564769-worker-0.om-om-ad060f41fad2448da38a3aa55d564769.ns-acptest-22ecc49f.svc.cluster.local