当前位置:网站首页>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
边栏推荐
- Question bank and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022
- 2022-2028 near infrared (NIR) analyzer Market Status and future development trend in the world and China
- IC fresh Chinese cabbage price of 400000 yuan! Experienced experts who have worked for many years guide you how to choose an offer!
- Raspberry school literacy
- 深度剖析「圈组」关系系统设计 | 「圈组」技术系列文章
- 清北力压耶鲁,MIT蝉联第一,2023QS世界大学排名最新发布
- .NET C#基础(6):命名空间 - 有名字的作用域
- How to quickly compress the size of video?
- In depth research and analysis report on global and Chinese sanitary safety product market
- 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?

Ali, tell me about the application scenarios of message oriented middleware?

HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications

Distributed file system and enterprise application -- elk enterprise log analysis system

清北力压耶鲁,MIT蝉联第一,2023QS世界大学排名最新发布

Task manager based on Qt development

Top 10 bone conduction earphones in the list, and five easy-to-use bone conduction earphones are recommended

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

深度剖析「圈組」關系系統設計 | 「圈組」技術系列文章

Leetcode 1962. Remove stones to minimize the total amount (should be rounded up)
随机推荐
2022-2028 near infrared (NIR) analyzer Market Status and future development trend in the world and China
North China pushed Yale hard, MIT won the first place in a row, and the latest 2023qs world university ranking was released
In depth research and analysis report on global and Chinese hydrogen fuel station market
Ali, tell me about the application scenarios of message oriented middleware?
In depth research and analysis report on global and Chinese smart lamp Market
Flutter 3.0正式发布:稳定支持6大平台,字节跳动是主要用户
HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications
树莓派获得网络安装系统功能,无需借助其他设备
MySQL advanced statement
非常值得學習的調度開源庫推薦
Pond (topology + priority queue)
Seven parameters of thread pool and reject policy
[verification of SystemVerilog] ~ test platform, hardware design description, excitation generator, monitor and comparator
PowerShell主架构师:我用业余时间开发项目,表现优秀反而被微软降级了
02 Tekton Pipeline
Webgl programming guide learning (0)
Sum of two leetcode numbers
为什么需要public static void main(String[ ] args)这个方法?
Which exchange is PTA futures on? How can PTA futures be safe?
Leetcode daily question - plus one