Last active
March 19, 2018 15:16
-
-
Save mccun934/e74d86737eebafeb5c5bc84da22f8335 to your computer and use it in GitHub Desktop.
non parallel queue recreate
This file contains hidden or 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
#!/bin/bash | |
recreateq(){ | |
qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 add queue pulp.agent.${1} --durable; | |
} | |
echo "" | |
echo "*** Clearing old qpid journal files.." | |
echo "" | |
katello-service stop | |
service postgresql start | |
rm -rf /var/lib/qpidd/.qpidd /var/lib/qpidd/* | |
service-wait qpidd start | |
sleep 10 | |
echo "" | |
echo "*** Recreating infrastructure queues.." | |
echo "" | |
qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 add exchange topic event --durable | |
qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 add queue katello_event_queue --durable | |
for key in compliance.created entitlement.created entitlement.deleted pool.created pool.deleted; do | |
qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 bind event katello_event_queue $key | |
done | |
for i in pulp_resource_manager pulp_workers pulp_celerybeat; do service $i restart; done | |
echo "" | |
echo "*** Creating client queues, this can take some time (multiple hours or more).." | |
echo "" | |
for consumer in $(su - postgres -c "psql candlepin -c \"select uuid from cp_consumer;\"" | grep "^ " | grep -v uuid); do | |
recreateq "$consumer" | |
done | |
echo "" | |
echo "*** Restarting services.." | |
echo "" | |
katello-service restart | |
echo "" | |
echo "*** Queue recreation complete.." | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment