Note: In this approach BusinessEvents application image is built locally and the docker registry is used to push or pull images. You can also build images directly on Amazon EC2 instances. If required, you can also configure separate VPC and security group.
Use default VPC, same used for Amazon EC2 instances. Also, in the same security group add one more inbound rule for database port.
Inbound Rules
Type
Protocol
Port
Source
Custom TCP Rule
TCP
1501
Anywhere
Or if required, you can create a separate security group for the database instance
After the database instance is running and is in "available" state, you can establish a connection to it using any SQL client.
Create a BusinessEvents specific user and run all BusinessEvents specific scripts that are required.
After the database setup is ready, use the same database setup in the JDBC shared resource. You can use the database instance endpoint as
Database URL in the JDBC shared resource. Use the
Test Connection feature to check if the connection is successful.
Create BusinessEvents application docker image locally on any machine and push it to docker registry.
Pull this BusinessEvents application docker image on all Amazon EC2 instances.
After the BusinessEvents application image is available on all EC2 instances, you can run BusinessEvents application containers.
Set the Weave environment on all Amazon EC2 instances for running BusinessEvents application containers.
> eval $(weave env)
Start containers on all Amazon EC2 instances.
For example,
//Start cache 1 on instance 1
docker run -d --name=cache1SA -e PU=cache <username>/fdstore_sharedall:GA
//Start cache 2 on instance 2
docker run -d --name=cache2SA -e PU=cache -e AS_DISCOVER_URL=tcp://cache1SA:50000 <username>/fdstore_sharedall:GA
//Start inference on instance 2
docker run -d --name=InfSA -p 8209:8209 -e PU=default -e AS_DISCOVER_URL=tcp://cache1SA:50000 <username>/fdstore_sharedall:GA
Ensure that all BusinessEvents application containers are connected to each other and inference is processing events at port 8209.
For sending events using
readme.html of the example application, replace
localhost with the public IP address of instance where the inference container is running.
As long as the RDS database instance is in running state, data is persisted.
To check the data recovery, stop all Amazon EC2 instances and start them again.
Restart all stopped containers and check that the data is recovered in cache containers.