I use EBS volume as a storage of data (Lucene index, in my case). I mount this 50Gb volume to an instance from Java application, right after initialization. Every time an environment is started my web app attached the EBS volume to the EC2 instance it is running on, mounts the disc, and starts using the data there (for read and write). Everything works fine.
Now I’m trying to implement URL swap mechanism, which means that I will start a new environment every time I want to re-deploy the application. But the EBS volume will still be attached to the old environment. The conflict is obvious.
I don’t know how this can be possibly resolved. Any ideas?
(I posted this question already to AWS forum, but didn’t get any reasonable answer).
The only solution I’ve found so far is to have an extra EC2 instance with the EBS volume attached, and shared through NFS among running EBT nodes.