Launching a cluster

Building and running a Cluster in Overcast is fairly simple and it's done via a guided procedure from the Overcast HQ. In this article we are going to demonstrate the launch of a SmartFoxServer Cluster step by step and provide several tips to get started.

Basic workflow

Launching a cluster, and in particular its Lobby, requires a number of parameters to be set, one of which is the server snapshot to be used to spawn new Game Nodes. The snapshot acts as a "template" for all Game Nodes that will be launched automatically later, so it needs to be fully configured before the cluster is launched. This includes providing the connection settings to a database, if one is needed.

For this reason a few steps must be executed to launch a new cluster, in the following order:

  1. Launch a Database Server (optional)
  2. Prepare a Game Node snapshot
  3. Launch the Lobby Node
NOTE: this article assumes you are already familiar with the basics of launching a server in the Overcast Cloud. If you have never done it before, please refer to our Basic Operations section.

1. Launch a Database Server (optional)

A database server is typically required in a cluster, usually for user access management and shared state persistence. Creating it as the first step is needed to be able to configure the Game Node template to connect to it, prior to creating its snapshot.

The processes for launching a database server is already described in the Basic Operations section of this documentation. Please refer to the Creating a new server article if you need more information.

2. Preparing a Game Node snapshot

As already mentioned, launching a cluster requires the server snapshot used to spawn new Game Nodes.

In other words you need to create a Game Node first, configure it according to your needs (e.g. setup the main Zone, deploy the Extensions, configure the database connection, etc) and finally create a snapshot in the Overcast Cloud. All this can be done in a few clicks from your Overcast account.

First make sure you have a new Application where you can create the cluster. This step is important because you should not mix the servers participating in the cluster with other standalone servers created previously.

Next choose to launch a new SmartFoxCluster Game node.

After selecting the wanted version and setting the admin password, you have to specify that this node should not join the cluster. This is because at this stage a cluster doesn't exist yet and, even if it existed, you'd still need this instance to run standalone so you can prepare it and create the snapshot.

When the server is ready you can connect via the AdminTool and start configuring the instance as you would normally do with SmartFoxServer 2X. If your cluster includes a database, refer to the Database connection document to set up the Game Node to connect to it.

NOTE: Game Nodes support only one Zone, called Cluster by default, which is readily available as soon as the node is started. You will learn more about this in the server-side development section.

Once you're done you can finally create the server snapshot:

  • First go back to the main server list.
  • Click on the [Actions] icon next to the server you want to snapshot.
  • Click on the Take snapshot menu option.

After a few minutes the server image will be ready in your snapshots list.
You can now proceed to launch the Cluster Lobby.

3. Launch the Lobby Node

From the main application view click the [Add server] icon on the right hand side.

At the first step of the server launch process select the SmartFoxCluster Lobby server type and submit.

Next provide a name and and optional description for the new instance, choose a server tier and proceed with the next step.

NOTE: the optional snapshot field found here refers to a Lobby Node disk image, which you don't have in this example because it is unrelated to the snapshot you created in the previous section.

Finally you have to configure the actual cluster by specifying how many Game Nodes should be launched together with the Lobby. The Game Server Snapshot field is where you select the Game Node image you created earlier.

NOTE: the number of nodes specified here also indicates the minimum size of the cluster. In other words the system will always have at least the number of Game Nodes specified here running at any given time.

This is the end result with all servers up and running. The next step would be to create a client application and start testing, which we illustrate in this other document.

Assigning domain names

When setting up an Overcast Cluster you may also need to assign domain names to each node in the system.

This is done in the same way as for standalone servers, i.e. by associating a 2nd level domain to the containing application and then specifying the 3rd level domain for the server. You can refer to the relative guide for more details.

If you already know the domain name used for your game we recommend to assign it immediately after creating the application in the Overcast HQ.

By clicking on the [Edit domain] icon, the above dialog window will appear. Once the domain is assigned you'll be prompted during the creation of the Lobby to specify a third level domain for each.

For Game Nodes instead, the name prefix specified in the "Cluster Parameters" step is used in conjunction with a dynamic string to compose the third level domain name automatically.