CLI Tutorial: Server Scaling
Sometimes, after setting up the environment, you might need to change its topology. For instance, you might want to expand a specific server or the entire setup to handle increased traffic. This can be done using the appropriate changetopology CLI method:
~/jelastic/environment/control/changetopology --envName {env_name} --env '{"engine" : "{engine_type}"}' --nodes ['{"nodeType" : "{node_type}","count" : {nodes_amount}, "fixedCloudlets" : {cloudlets_amount}, "flexibleCloudlets" : {cloudlets_amount}}, {"nodeType" : "{node_type}", "count" : {nodes_amount}, "fixedCloudlets" : {cloudlets_amount}, "flexibleCloudlets" : {cloudlets_amount}}']
The parameters for the createenvironment method remain consistent across the board, save for one exception – the –envName {env_name} argument. Here, it serves the purpose of indicating an existing environment that requires adjustments.
In this example, let’s talk about the other choices:
- {engine_type} – This is the type of engine that runs the instances of the environment you’ve chosen. It’s a must-fill string.
- {node_type} – This is an identifier for the type of stack you’re using, picked from a list.
- {nodes_amount} – This tells you how many nodes you want to set up. It’s for scaling horizontally.
- {cloudlets_amount} – This is about the number of cloudlets, both fixed and flexible, that you’re allocating for the specific node type. It’s for scaling vertically.
Changing the setup of the environment might require a few minutes to complete.