rabbitmq / rabbitmq-cli

Command line tools for RabbitMQ
Other
105 stars 34 forks source link

Introduce drain/maintenance mode commands #419

Closed michaelklishin closed 4 years ago

michaelklishin commented 4 years ago

A part of rabbitmq/rabbitmq-server#2321 and rabbitmq/rabbitmq-server#2349.

This introduces the following commands most relevant for upgrade and maintenance scenarios:

# puts target node into maintenance mode,
# see rabbitmq/rabbitmq-server#2321
rabbitmq-upgrade drain

# puts target node out of maintenance and into regular operating mode,
# see rabbitmq/rabbitmq-server#2321
rabbitmq-upgrade revive

# makes the node no longer accept new client connections
# while not affecting currently established connections
rabbitmqctl suspend_listeners

# makes the node accept client connections again
rabbitmqctl resume_listeners
dcorbacho commented 4 years ago

We need a way to discover the current status of a node (maintenance/running). It could be added to the cluster_status command

michaelklishin commented 4 years ago

@dcorbacho @lukebakken I have added node maintanance to rabbitmq-dianostics status and rabbitmq-dianostics cluster_status.

lukebakken commented 4 years ago

Thanks @michaelklishin . If I have time I may look at adding maintenance status to the management UI somehow.

michaelklishin commented 4 years ago

we can start with only adding it to API responses for GET /api/nodes and GET /api/nodes/{node}

coro commented 4 years ago

@michaelklishin does this need to be backported to branch 3.8.x since https://github.com/rabbitmq/rabbitmq-server/issues/2321 is getting backported?

(I came across this while trying to play about with this feature in a 3.8.x-alpha build; apologies if you've a different process I'm not familiar with)

michaelklishin commented 4 years ago

@coro it will be backported together with other PRs for 3.8.8. 3.8.7 will be a security patch release.

michaelklishin commented 4 years ago

Backported to v3.8.x.