Tutorials/howto configure server

From CubeiaWiki

Jump to: navigation, search

Contents

How To: Configure Firebase

Requirements

This how to assumes an installed Firebase distribution.

Overview

Firebase is configured, mainly using three different files:

  • conf/config.sh
  • conf/server.props
  • conf/cluster.props

The 'config.sh' file contains properties used by the start and stop scripts. For example memory configuration, Java install directory etc. This file is usually the same across all machines even in a cluster.

The 'server.props' file contains Firebase properties for the local server, in other words properties that are likely to be different across multiple machines in a cluster. For example, network bind addresses etc.

The 'cluster.props' is read by the master nodes and used to configure the entire cluster (or of course, single server). In a cluster, this file is on required on the servers which are running the master nodes and may safely be removed from the other servers.

Script Configuration

The 'config.sh' file contains properties used by the start and stop scripts. These are detailed in the installation manual. But to start with, you may want to set the following property:

JAVA_HOME

Note however, that this may be set in you system configuration already, you can do a quick test to check like this:

echo $JAVA_HOME

If the echo prints a valid directory you do not have to configure Firebase specially, otherwise edit the 'config.sh' file to you liking, for example:

# java home, uncomment and change for non-system default
export JAVA_HOME=/usr/local/java

Server Properties

The 'server.props' file contains Firebase properties for the local server. This file contains network bind address configuration, which is important on multi-homed servers. To start with, if your server has multiple network interfaces, this is the property you need to set:

cluster-bind-address

That's it. Just point it to the IP address of the NIC you want to use.

The above bind address is also used as a default NIC for several internal Firebase services. These can also be set by hand, in which case you're interested in the following properties:

service.mbus.dqueue.game-channel-bind-address
service.mbus.dqueue.client-channel-bind-address
service.mbus.dqueue.mtt-channel-bind-address
service.space.tablespace.bind-address
service.space.mttspace.bind-address
systemstate.bind-address

Setting Bind Addresses From Script

This is a quick step by step on how to set bind addresses automatically when configuring Firebase. The steps will be approximate and may have to be modified for you particular environment, but they should give you an idea of the procedure.

  • Find a Linux command which prints the correct IP address, ask you system administrator for help if need be. For example:
hostname -i
  • Set the IP as a system variable somewhere at the top of the 'bin/gameserver.sh' file in the Firebase ditribution. For example:
export FB_BIND_IP=`hostname -i`
  • Find the actual Java command in the 'bin/gameserver.sh' and add the IP variable as a Java variable. This is found in the funtion 'startserver()' and starts with the varialble ${BINARY}. You add the IP variable by using a Java '-D' flag. For example (shortened):
${BINARY} -Dserver_bind_ip=${FB_BIND_IP} -server ${GCARGS} [... etc ...]
  • As the bind IP is now available in the Java system variable for Firebase to find, you can edit the 'server.props' bind address variables to look like this (using the "server_bind_ip" variable name from step 3 above):
cluster-bind-address=${server_bind_ip}
  • Relax, if the command from step one above works on all cluster machines you can safely copy 'bin/gameserver.sh' and 'conf/server.props' across the entire cluster and it will work automagically.

Cluster Properties

The 'cluster.props' is read by the master nodes and used to configure the entire cluster (or of course, single server). In a cluster, this file is on required on the servers which are running the master nodes and may safely be removed from the other servers.

Normally you edit this file to tweak performance and behaviors and as such we'll ignore it here. You can find all available properties documented in the administration manual.

Personal tools