Created
December 13, 2013 12:11
-
-
Save thiagooak/7943393 to your computer and use it in GitHub Desktop.
kill ALL rabbitmq connections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name | awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" | "/bin/bash" }' |
Thanks.
This command also added the Listing connections ...
line as:
rabbitmqctl close_connection "Listing" "manually closing idle connection"
I slightly changed it to this instead, which seems more resilient:
sudo rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name \
| grep -vP 'Listing|pid' \
| awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" }' \
| sudo sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save my life too. Thanks