当前位置:网站首页>Nomad application layout scheme 04 of hashicopy (scaling and updating a job)
Nomad application layout scheme 04 of hashicopy (scaling and updating a job)
2022-06-11 14:38:00 【Hua Weiyun】
One Preface
The definition of an assignment is not static , It means updating over time . You can update the job to change docker Containers 、 Update the application version or change the count of task groups to expand with load .
Two Telescopic Job
Now? , edit example.nomad File to update the count and set it to 3. This line is in 143 In the cache section around the line .
- count = 1+ count = 3After modifying the operation specification , Use nomad job plan Command invokes a drill of the dispatcher , See what happens if you run the updated job :
nomad job plan example.nomad 
The scheduler detected a change in the count , And output the plan to create two new assignments , And update the existing allocation in place , To update the job specification . In place updates do not cause any service disruption . You can then use the nomad job run Command to run a job with version validation .
By using -check-index Sign operation ,Nomad Check whether the job has not been modified after running the plan . If more than one person interacts with the job at the same time , This will be very useful , To ensure that the job is not changed before the changes are applied .
nomad job run -check-index 10 example.nomad
Because you set the count of task groups to three ,Nomad Two additional allocations are created to achieve the desired state . Running the same job specification again is idempotent , And no new assignments will be created .
You can get the sample job status , To verify Nomad Whether other instances are started . function nomad Example of job status and check the allocation part of the output . Please note that , Now there are three examples .

Also note the time created for the assignment , The initial container time has not changed , Means no updates , The two newly added containers are created concurrently .
The allocated creation time is scheduled by the scheduler application and the allocation is ready to be allocated by the run Nomad When the client receives . The creation time is a fixed point in time . The modified time reflects the time when the allocation record was last updated .
With the start of the assignment and any events that may occur during its life cycle ( It is mainly updated by the template 、 Restarts caused by workload failures or health check based restarts ), The assignment will be updated to reflect its current status .
3、 ... and to update Job
Now modify example.nomad file , modify redis:3.2toredis:4.0, perform
nomad job plan example.nomad 
Use -check-index
nomad job run -check-index 44 example.nomad
After running , Rolling updates can be run at the bottom nomad job status Example and observation assignment section . A successful deployment will show version Updated version number of 、run The expected value and operating status of .

The output here shows Nomad Updates are processed in three stages , Update an assignment at each stage , And wait for it to min_healthy_time 10 Stay healthy for seconds , Then proceed to the next stage . Because containers are cached ,Redis It starts very quickly , So the second and third instances start close to each other on this node ; however , You can see that there is at least one expected... Between each creation 10 Second time .
You can configure the update policy yourself , But the default rolling update behavior makes it less complicated to update applications on a large scale and prevent application interruptions .
Four other
Use Nomad To carry out job In the case of containers , Can be quickly choreographed .
Reference link
边栏推荐
- Zhejiang University has developed a UAV, which can automatically avoid obstacles and walk through the woods like a bird. The real swarm is coming
- Vscode virtual environment running file reported an error importerror: DLL load failed: the specified module could not be found
- 基于Qt开发实现的任务管理器
- 化“被动”为“主动”,如何构建安全合规的智能产品 | Q推荐
- NoSQL之Redis配置与优化
- Redis configuration and optimization of NoSQL
- Live800:智能客服提升客户体验的几种方式
- In depth research and analysis report on global and Chinese plant extract products market
- mysql高级语句
- Check box select all or deselect all
猜你喜欢

【SystemVerilog 之 过程块和方法】~ 域、always过程块、initial过程块、函数 function、任务 task、生命周期

What is excess product power? Find the secret key of the second generation cs75plus in the year of the tiger

How to quickly compress the size of video?

Recommandation de la Bibliothèque open source de programmation

Cartoon: interesting "cake cutting" problem

CVPR 2022 | 神经辐射场几何编辑方法NeRF-Editing

小米9线刷ROM

Uniapp settings page Jump effect - navigateto switching effect - Global animationtype animation

MySQL create table error 1067 - invalid default value for 'update_ time‘

Sum of two leetcode numbers
随机推荐
In depth research and analysis report on global and Chinese hydrogen fuel station market
In depth research and analysis report on global and Chinese content audit market
当开源遇见 KPI,全球化 VS 本土化,开源的理想与现实该如何和解?
In depth research and analysis report on global and Chinese SURFBOARD WAX Market
【Flink】Flink CancellationException null DefaultExecutionGraphCache LeaderRetrievalHandler
2022.2.28 variable length sequence table
强大的全文本搜索工具——AnyTXT Searcher
Ali, tell me about the application scenarios of message oriented middleware?
In depth research and analysis report on global and Chinese p-chlorotrifluoromethane Market
111. minimum depth of binary tree
非常值得學習的調度開源庫推薦
一些经典的嵌入式C面试题汇总
North China pushed Yale hard, MIT won the first place in a row, and the latest 2023qs world university ranking was released
Leetcode 1962. 移除石子使总数最小(应该是向上取整)
2021 年度 Go 开发者调查
System. out. What should I pay attention to when using the println () method
Methods and benefits of creating indexes for MySQL databases
Anaconda delete virtual environment
Current situation and future development trend of global and Chinese metalworking fluid market from 2022 to 2028
[Clickhouse] the clckhouse view can be inserted but not queried