I am in my learning path for the AWS Solution Architect exam. Please consider this question under this point of view, an auto assignment :-)
As an exercise for the reliability pillar I am trying to rethink a working Glassfish Cluster consisting in two nodes to fit an ELB + auto scaling group solution.
My idea is to have only one node up and running and an ELB in front of it. The ELB would be connected to the main node and to an Auto Scaling group with minimum capacity zero. To explain better the main node is not included in the scaling group but only the newly created nodes would be.
Problems.
- Can the ELB have such configuration EC2 Main Node + Auto Scaling Group ?
- For adding a node in the cluster I have to run a specific asadmin shell command from the main node, how can I accomplish this ? The main node should be informed that a further node have with a specific ip (or name) has been added.
- One other possible option would be to use Elastic Beanstalk but it's an option I don't want to follow for the moment as I would have to learn how to use beanstalk and the feasibility of this solution.
- Not specific related to the question: If I could run the add node command from the freshly created instance I would have solved all my problems, but I don't think it is possible.
[UPDATE]
The reason I want to do autoscaling to zero is that I am also working on other exam pillars. For keeping costs down I want to have a "full time" working node and a node (or more depending on the scaling policy) to be activated only when alert breach.
The difficult I am finding is to understand how Glassfish can be configured in this scenario and not how autoscaling works. The main point is that Glassfish needs a main node from where to launch command "asadmin".
I know and I am extensively using "user data" for all my instances. But for example an auto scaling group is tied to a launch template only (or not ?), how can I differentiate in the user data that I need to restore as main node or a cluster node. The script would be quite complicated. I don't know if I made myself clear about this.
Maybe, the options I am working on is not feasible.