Table of Contents
For information about the role of BWMachined please refer to the Server Overview's chapter BWMachined.
In order for the BWMachined process to act as an agent for starting and locating server processes for users within a network cluster it is nescessary to have a mechanism for BWMachineD to be able to locate game resources on a per user basis on each machine it is running on.
The approach chosen for BWMachineD was to have a configuration file in each user's home directory that intends to launch any BigWorld processes. This configuration file directs BWMachineD as to where it can locate the BigWorld server binaries as well as the game resources to use on each machine. While it is uncommon this approach allows each machine to potentially have a different installation location for the server binaries and game resources.
When interacting with the BigWorld server tools and requesting to launch a server, a message will be sent to BWMachineD which in turn queries the configuration file associated with the requesting user. The paths specified in the configuration file are then used by the BWMachineD process when it attempts to launch the server processes. For more details regarding the layout of the BWMachineD configuration files please refer to the following section Configuring BWMachined.
BWMachined plays a crucial role in the ongoing operation of your cluster environment, so it's important to understand how it can be configured and which configuration options are relevant for your server environment.
There are two configuration files which are relevant to the operation of BWMachined:
-
~/.bwmachined.conf
This file is used to specify options relating to how an individual user working within a BigWorld cluster should find the server resources required to operate on any available cluster machines.
-
/etc/bwmachined.conf
This file is primarily used to specify settings relating to how the machine on which BWMachined is running should operate within the cluster environment.
When starting a server and related components there are two important pieces of information that are required:
-
Where to find the BigWorld server executable files.
-
Which directories contain the game resources to use with the server.
The preferred way to specify these settings is in the file
~/.bwmachined.conf
.
Note
For users not familiar with Linux:
-
The ~ (tilde) indicates the user's home directory, for example a user called johns would generally have a home directory located at
/home/johns
-
The period character before the filename indicates it is a hidden file which causes it to not be displayed by many directory listing applications including ls (unless the
-a
option is specified).
Below is an example of a ~/.bwmachined.conf
file for a user johns. This file needs to be manually
created when the user account is created. Note the different places where
a semi-colon and a colon are used:
The preferred way to specify these settings is in a file
~/.bwmachined.conf
.
Note
For users not familiar with Linux:
-
The ~ (tilde) indicates the user's home directory, for example a user called alice would generally have a home directory located at
/home/alice
-
The period character before the filename indicates it is a hidden file which causes it to not be displayed by many directory listing applications including ls (unless the
-a
option is specified).
Below is an example of a ~/.bwmachined.conf
file for a user alice. This file needs to be manually
created when the user account is created. Note the different places
where a semi-colon and a colon are used.
# .bwmachined.conf # Format: BW_ROOT;BW_RES_PATH:[BW_RES_PATH] ... /opt/bigworld/current/server;/home/alice/fantasydemo/res:/opt/bigworld/current/server/res
The path before the semi-colon should point to the root directory of
the installed files. You will generally have the bigworld
directory underneath this root
directory. The paths after the semi-colon (separated by colon characters)
specify the resource paths that will be used to find resources used by
your game.
When starting a BigWorld server using the standard server tools,
such as control_cluster.py or WebConsole, BWMachined is
responsible for launching the server binaries and uses the information
located in ~/.bwmachined.conf
as well as the
architecture of the host system to determine how to launch the server for
the requesting user.
Note
Each user that needs to run a server within your cluster
environment will need a ~/.bwmachined.conf
file
created and configured for them.
The global configuration file
/etc/bwmachined.conf
is used for setting options that
define how BWMachined will operate on the host it is running on. For
example, if you have multiple machines in your cluster, and during
development you wish to isolate certain machines into groups for developer
usage, this would be applied in the global configuration file. The
following list provides a quick summary of host based configuration
options that may be applied in the file
/etc/bwmachined.conf
:
-
User defined categories
-
Reviver configuration
-
BigWorld server timing method
-
Interface configuration for multi-interface hosts
Note
The configuration file is only read when BWMachined starts. It will have to be restarted if you want it to acknowledge your changes.
When the Reviver process starts, it queries the local BWMachined process, and will only support the components that have an entry in a special user defined category called [Components]. An example configuration specifying that the Reviver should support all server components would be defined as below:
[Components] baseApp baseAppMgr cellApp cellAppMgr dbMgr loginApp
Note
BaseApp and CellApp will not be restarted by Reviver, the [Components] entries are used by the WebConsole and control_cluster.py to determine which processes should be started by BWMachined on that host. This list however is only a hint for the server tools and the processes may still be started on that host if required.
Note
If the [Components] category does not contain any entries, then Reviver will support all server components.
By default, time services is provided by the clock_gettime system call. The default is the recommended timing method and works for all supported platforms, for further options, please refer to the Server Operations Guide's chapter Clock.
The membership of the machine running BWMachined can also be
optionally specified in /etc/bwmachined.conf
. For
more details on what machine groups are used for, and how to specify
them, refer to the Server Operations Guide's
chapter Machine Groups and Categories.
The BigWorld machine daemon is used for both internal machines and out-facing machines such as those that BaseApps and LoginApps are run on. The protocol that BigWorld components use for discovery of server processes, and process startup registry involves a UDP broadcast to the machine daemons.
The machine daemon must determine the interface to receive these broadcasts from. By default, the machine daemon will determine which interface is the internal interface by sending a broadcast packet on each interface and waiting for this broadcast packet to be returned. The interface which receives the first broadcast packet is assumed to be the internal network.
For the out-facing machines with more than one interface, this may result in the incorrect interface being chosen. In these situations, it is best to check your broadcast routing rules[2] and consider adding firewall rules to block receiving from BWMachined ports (20018 and 20019) on these other interfaces.
For example, if eth1 is not your internal interface:
# /sbin/iptables -I INPUT 1 -p udp -i eth1
-m multiport --destination-ports 20018:20019 -j DROP
Note
In most circumstances it is better to block all ports and then only open the ports that are needed. See Security.
In rare cases, the [InternalInterface] configuration option can be set with either the dotted-decimal address or the name of the interface that is connected to the internal network.
For example, using the name of the interface:
[InternalInterface]
eth0
Using dotted-decimal notation:
[InternalInterface]
192.168.0.1
If this option is not specified, auto-discovery of the internal interface will be performed. If the option is specified, but no interface is found that matches the value set in [InternalInterface], then an error will be logged to syslog and the machine daemon process will terminate.
This option may now also be specified in the
[bwmachined] section of
/etc/bigworld.conf
as follows:
[bwmachined]
internal_interface = <value>