2018-12-13 14:47:20 -05:00
---
2019-08-21 00:48:59 -04:00
id: rolling-updates
title: "Rolling updates"
2018-12-13 14:47:20 -05:00
---
2018-11-13 12:38:37 -05:00
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
2015-05-05 17:07:32 -04:00
2020-01-03 12:33:19 -05:00
For rolling Apache Druid cluster updates with no downtime, we recommend updating Druid processes in the
2016-02-09 16:54:00 -05:00
following order:
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
1. Historical
2024-01-26 17:10:53 -05:00
2. Middle Manager and Indexer (if any)
3. Broker
4. Router
2024-09-05 13:25:30 -04:00
5. Overlord (Note that you can upgrade the Overlord before any Middle Manager processes if you use [autoscaling-based replacement ](#autoscaling-based-replacement ).)
2017-07-25 13:54:12 -04:00
6. Coordinator ( or merged Coordinator+Overlord )
2015-05-05 17:07:32 -04:00
2024-01-26 17:10:53 -05:00
If you need to do a rolling downgrade, reverse the order and start with the Coordinator processes.
2021-05-07 17:26:47 -04:00
2024-01-26 17:10:53 -05:00
For information about the latest release, see [Druid releases ](https://github.com/apache/druid/releases ).
2018-06-08 18:25:26 -04:00
2016-02-09 16:54:00 -05:00
## Historical
2015-05-05 17:07:32 -04:00
2019-02-28 21:10:39 -05:00
Historical processes can be updated one at a time. Each Historical process has a startup time to memory map
2016-02-09 16:54:00 -05:00
all the segments it was serving before the update. The startup time typically takes a few seconds to
2019-02-28 21:10:39 -05:00
a few minutes, depending on the hardware of the host. As long as each Historical process is updated
with a sufficient delay (greater than the time required to start a single process), you can rolling
2016-02-09 16:54:00 -05:00
update the entire Historical cluster.
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
## Overlord
2015-05-05 17:07:32 -04:00
2019-02-28 21:10:39 -05:00
Overlord processes can be updated one at a time in a rolling fashion.
2015-05-05 17:07:32 -04:00
2019-09-30 18:45:33 -04:00
## Middle Managers/Indexers
2015-05-05 17:07:32 -04:00
2019-09-30 18:45:33 -04:00
Middle Managers or Indexer nodes run both batch and real-time indexing tasks. Generally you want to update Middle
2016-02-09 16:54:00 -05:00
Managers in such a way that real-time indexing tasks do not fail. There are three strategies for
doing that.
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
### Rolling restart (restore-based)
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
Middle Managers can be updated one at a time in a rolling fashion when you set
`druid.indexer.task.restoreTasksOnRestart=true` . In this case, indexing tasks that support restoring
will restore their state on Middle Manager restart, and will not fail.
Currently, only realtime tasks support restoring, so non-realtime indexing tasks will fail and will
need to be resubmitted.
### Rolling restart (graceful-termination-based)
Middle Managers can be gracefully terminated using the "disable" API. This works for all task types,
even tasks that are not restorable.
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
To prepare a Middle Manager for update, send a POST request to
2024-09-05 13:25:30 -04:00
`<Middle_Manager_IP:PORT>/druid/worker/v1/disable` . The Overlord will now no longer send tasks to
2016-08-05 17:56:51 -04:00
this Middle Manager. Tasks that have already started will run to completion. Current state can be checked
2024-09-05 13:25:30 -04:00
using `<Middle_Manager_IP:PORT>/druid/worker/v1/enabled` .
2015-05-05 17:07:32 -04:00
2024-09-05 13:25:30 -04:00
To view all existing tasks, send a GET request to `<Middle_Manager_IP:PORT>/druid/worker/v1/tasks` .
2016-02-09 16:54:00 -05:00
When this list is empty, you can safely update the Middle Manager. After the Middle Manager starts
back up, it is automatically enabled again. You can also manually enable Middle Managers by POSTing
2024-09-05 13:25:30 -04:00
to `<Middle_Manager_IP:PORT>/druid/worker/v1/enable` .
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
### Autoscaling-based replacement
2015-05-05 17:07:32 -04:00
2019-02-28 21:10:39 -05:00
If autoscaling is enabled on your Overlord, then Overlord processes can launch new Middle Manager processes
2016-02-09 16:54:00 -05:00
en masse and then gracefully terminate old ones as their tasks finish. This process is configured by
2019-02-28 21:10:39 -05:00
setting `druid.indexer.runner.minWorkerVersion=#{VERSION}` . Each time you update your Overlord process,
2016-02-09 16:54:00 -05:00
the `VERSION` value should be increased, which will trigger a mass launch of new Middle Managers.
The config `druid.indexer.autoscale.workerVersion=#{VERSION}` also needs to be set.
## Standalone Real-time
2019-02-28 21:10:39 -05:00
Standalone real-time processes can be updated one at a time in a rolling fashion.
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
## Broker
2015-05-05 17:07:32 -04:00
2019-02-28 21:10:39 -05:00
Broker processes can be updated one at a time in a rolling fashion. There needs to be some delay between
updating each process as Brokers must load the entire state of the cluster before they return valid
2016-02-09 16:54:00 -05:00
results.
2015-05-05 17:07:32 -04:00
2016-02-09 16:54:00 -05:00
## Coordinator
2015-05-05 17:07:32 -04:00
2019-02-28 21:10:39 -05:00
Coordinator processes can be updated one at a time in a rolling fashion.