Configure a second EC2 Instance For ActiveMQ
Up to this point, you have successfully setup EFS, installed and configured an ActiveMQ broker on an EC2 instance, and also configured the ActiveMQ broker to use the shared EFS file system.
You are now ready to launch a second ActiveMQ broker which will share the same configuration and thus the same shared EFS file system as the first ActiveMQ instance. This will help us validate that the second ActiveMQ broker will automatically become a slave of the first ActiveMQ broker, since the latter is already running and locking the shared file system (thanks to EFS/NFS4 locking feature).
There are 2 possible options to launch a second broker:
- Option 1: repeat the steps of the previous sections to launch an EC2 instance and configure a similar ActiveMQ broker with exactly the same configuration (just use a different name for the EC2 instance in order not to be confused with the first instance).
- Option 2: create an AMI from the running ActiveMQ broker EC2 instance, and then use the AMI to launch a similar instance with ActiveMQ embedded.
You are going to perform Option 2 for this tutorial.