0

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.

  1. Can the ELB have such configuration EC2 Main Node + Auto Scaling Group ?
  2. 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.
  3. 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.
  4. 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.

Leonardo
  • 103
  • 5

1 Answers1

1

Your Idea

Why would you have an minimum of zero? Use one, or for high availability, two.

If you want high availability you need a minimum of two nodes, so if one fails the system keeps working while auto scaling brings up another server. Have a server outside the auto scaling group, also not general good practice, an unnecessary in this case as far as I can see.

Question One

Yes, but I can't see a good reason to do it that way.

Question Two

Learn about "ec2 user data"

General Notes

These aren't particularly difficult questions and I'm sorry to say you seem to have fairly non-standard answers that would not help you design a good architecture or pass the exam. I suggest you at least do the Linux Academy course for this exam, they're generally good.

Update

If GlassFish needs a main node and worker node then simply have two AMI types and two auto scaling groups. The main glassfish node has a min and max size of one, the other has a min size of zero and you'll have to work out parameters to scale it up based on load of the other auto scaling group. I've never tried that, but the answer to many complex custom requirements in AWS is often "Use Lambda".

Tim
  • 31,888
  • 7
  • 52
  • 78
  • Thanks for your answer, please find the time to review my update. – Leonardo Apr 02 '20 at 08:25
  • That was I was trying to understand: two scaling groups. However I have abandoned the use of cluster and autoscaling compared to the standard JEE approach. The resulting configuration (especially the user data approach) wouldn't be a reliable architecture, instead I consider more than acceptable to monitor and tune the existing VPC/EC2 approach by using the appropriate instance type. By the way, I think that this question didn't deserve to be closed (and me redirected to a Linux course), instead it could have opened an interesting discussion, but I respect the rules :-) – Leonardo Apr 16 '20 at 13:52
  • Question was closed because SF to help with real world problems, not to help people learn how to do things. However, I did answer, to help. – Tim Apr 16 '20 at 19:56