Tutorials/howto install cluster

= How To: Install Cluster =

NB:  This how-to is relevant to Firebase Enterprise Edition only.

Requirements

 * An installed Firebase server.
 * Physical cluster servers within one physical network. These machines should typically be homogeneous, ie. configured the same way.
 * Access to the cluster machines via SSH, preferably with shared SSH keys between the cluster machines to make navigation and copying easier.
 * Basic Linux command skills, or access to a system administrator.

Preparations
alpha1 - primary master and client node alpha2 - secondary master and client node alpha3 - game and tournament node alpha4 - game and tournament node zip -r firebase-upload firebase-1.6.0/ scp firebase-upload.zip alpha1:/usr/local/firebase
 * 1) Make sure you have a working Firebase singleton (ie. single machine) which you can use as a template and which you know how to start and stop.
 * 2) Remove temporary files from the installation (ie 'logs/' and 'work/') which you don't need to copy.
 * 3) Decide on the cluster topology, for this example, we'll use four nodes, configured like so (the servers are named alpha1-4):
 * Create a zip archive of you working installation and copy to the primary master. For example:

Install Primary Master

 * 1) Unzip you uploaded Firebase installation.
 * 2) Modify all start scripts to take bind addresses from the system.
 * 3) If the cluster shares network with development machines or other clusters you may want to give the new cluster a new "cluster-mcast-address" in the 'conf/server.props' file in order to prevent cross installation clustering.
 * 4) Make sure you can [wiki:installManual#StartStop start and stop] the primary master on the server.

Install Secondary Nodes
Since Firebase is meant to be used in a homogeneous environment, this step is really only to copy the master installation to all nodes. For example: for ((i=2;i<=4;i+=1)); do scp -r firebase-1.6.0/ alpha$i:/usr/local; done

Start / Stop
Starting and stopping cluster nodes can be done with a cluster manager which you may have received from Cubeia. However, as your system administrator will probably want to control the installation we'll do it by the command line here.

NB:  Nodes must be started one by one, starting with the primary master. Do not attempt to start nodes in parallel.

Our little script to start the cluster may look like this:

ssh alpha1 "cd /usr/local/firebase-1.6.0/; ./start.sh -n master:mas1,client:cli1 -i alpha1" ssh alpha2 "cd /usr/local/firebase-1.6.0/; ./start.sh -n master:mas2,client:cli2 -i alpha2" ssh alpha3 "cd /usr/local/firebase-1.6.0/; ./start.sh -n game:gam1,mtt:mtt1 -i alpha3" ssh alpha4 "cd /usr/local/firebase-1.6.0/; ./start.sh -n game:gam2,mtt:mtt2 -i alpha4"

Stopping the cluster is simply a matter of calling the "stop.sh" script instead of "start.sh". If possible, stop the cluster in reverse order, like so:

ssh alpha4 "cd /usr/local/firebase-1.6.0/; ./stop.sh" ssh alpha3 "cd /usr/local/firebase-1.6.0/; ./stop.sh" ssh alpha2 "cd /usr/local/firebase-1.6.0/; ./stop.sh" ssh alpha1 "cd /usr/local/firebase-1.6.0/; ./stop.sh"