今天来写最基本的提交工作(Submit a Job)
提交工作的指令: nomad job run hello-world.nomad
但提交後但你怎麽知道
所以有一个指令可以用来测试: nomad job plan hello-world.nomad
它会告诉你修改了那些地方,如下的例子:
我修改了image的版本,由"nginx:1.19.2" => "nginx:1.21",
dry-run的结果告诉我 All tasks successfully allocated.
并显示修改了哪些地方
$ nomad job plan hello-world.nomad
+/- Job: "hello-world"
+/- Task Group: "webfront" (1 create/destroy update)
+/- Task: "nginx" (forces create/destroy update)
+/- Config {
+/- image: "nginx:1.19.2" => "nginx:1.21"
port_map[0][web]: "80"
}
Scheduler dry-run:
- All tasks successfully allocated.
Job Modify Index: 748164
To submit the job with version verification run:
nomad job run -check-index 748164 nginx.nomad
When running the job with the check-index flag, the job will only be run if the
job modify index given matches the server-side version. If the index has
changed, another user has modified the job and the plan's results are
potentially invalid.
Dry-run 成功後就可以提交工作了?
在团体开发的环境下,直接执行nomad job plan hello-world.nomad
, 要怎麽确保执行的是当下的job呢?
可能下一秒别人就修改了job, 所以Nomad在每次dry-run後都会提供一个Job Modify Index
,透过index来保证执行的是当下plan job後的的内容。
但如果在submit job之前,有人又做了plan job得到新的index,则会造成旧的index, submit无效。
Job Modify Index: 748164
To submit the job with version verification run:
nomad job run -check-index 748164 nginx.nomad
<<: 铁人赛 Day6 -- 一定要知道的 CSS (三) - Flex 属性的应用
>>: [30天 Vue学好学满 DAY6] 计算属性(Computed)
葛瑞部落格欢迎光顾 线上工具 Azure CloudShell 离线必要工具 Azure CLI C...
前一天我们介绍了用来资料处理最基本的pandas套件 那今天我们则是来谈一下不同的档案类型 我们都知...
Email 安全 为什麽要收集各个企业的 Email 信箱,透过了解企业公开在外的 Email,可...
Mysql下载 因为网路上已经有很多下载教学了,icebear也是参考网路上下载的,所以在这里就不多...
目标 今天写个时事题,我们来查询立委议案提案 本日重点 立法院 Open Data 如何将 CSV ...