This is on EC2. I have an init script that does some basic setup like installing rabbitmq, creating a virtual host, user, setting permissions, etc. So basically it goes:
sudo yum --enablerepo=epel install rabbitmq-server
/etc/init.d/rabbitmq-server start
rabbitmqctl add_user username password
rabbitmqctl add_vhost vhost
rabbitmqctl set_permissions -p vhost username ".*" ".*" ".*"
rabbitmqctl stop
Then I exit the shell, and create an EBS image from the instance. Amazon automatically reboots the server to create the image.
Now the weird part...after a reboot everything was still set except the permissions.
Then when I started a new instance from the image, there was no username or host in rabbitmq.
Is there something that needs to be done in rabbitmq to save changes?
Messages, exchanges, and queues that are not durable and persistent will be lost during a broker restart. If you cannot afford to lose any messages, make sure that your queue is declared as durable and your messages are sent with delivery mode "persistent".
If a queue is not durable, all messages will be lost if RabbitMQ is shut down for any reason. For messages to survive restarts, both of these configurations must be true. This article talks about RabbitMQ Durable queues extensively.
If the settings disappear when you "stop" and "restart" the instance opposed to rebooting it, it is because the ip address is changing and RabbitMQ settings are bound to the ip.
See RabbitMQ on Amazon EC2 instances
I think it maybe be this, from http://www.rabbitmq.com/ec2.html
Persistent data on EBS device
RabbitMQ writes data to the following directories on Ubuntu:
/var/lib/rabbitmq/ to store persistent data like the messages or queues
/var/log/rabbitmq/ to store logs
If you want to use EBS block device to store RabbitMQ data, just link these directories to your EBS device. Stop RabbitMQ before making any changes to the data directory:
$ /etc/init.d/rabbitmq-server stop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With