Rolling Restart
Last updated
Last updated
What is rolling restart?
A rolling restart is typically an operation that can be performed on an application component that is deployed across multiple instances or application servers (for example, in a cluster) to incrementally stop and start applications on each instance. The purpose may be for an application to pick up configuration changes that require a restart, while ensuring high availability of the application.
The above command restarts the my_application
component for service odindemo
in environment rol-res
while restarting 5% of the instances in one single batch till all the instances are restarted. The mode of restart is "FORCEKILL" in this example. Please refer to the below table for the options and their significance.
batch_size_percentage
int
This field states the percentage of the batch at once you want to restart. The value of this field can be any integer ranging from 1 to 100. This value can vary based on your requirement. If you want to perform a full restart at once, the value of this field will be 100.
mode
string
This field states the way you want to perform the restart. There are two options:
FORCEKILL: Forceful mode restarts your application without taking in-flight request in account. It is a faster way of performing the restart and mostly recommended if you have an application that is not functioning in a desired manner. This mode of restart will kill the in-flight requests, hence returning an error for such users. This method restarts your application and performs a health check before registering the same.
GRACEFUL: Graceful mode provides you a window of 15-sec to complete your in-flight requests. It is a longer but graceful way of performing the restart and mostly recommended in case you want to update some config without impacting the user experience. This method restarts your application followed by a health check before registering after the same.
Start.sh should be in such a way that stopping the application and re-running the start.sh will restart the application successfully.The process of Rolling restart will stop the application and execute start.sh for your application to restart your application. Hence, to make rolling restart a success, you must have start.sh operational and error free.