As introduced in the GE basics, the machines in a GE cluster may have different roles to play. Each GE instance reads its configuration file, an xml file named trinity.xml under its working directory, to know its role to play.
There are three ways of configuring GE.
Using the TrinityConfig class.
Using the graphical configuration editor geconfig.
Directly modifying trinity.xml under the GE application working directory.
In this chapter we mainly introduce the usage of the graphical configuration editor geconfig. It is no more than a GUI modification tool of trinity.xml. But since it provides verification functionality, instead of directly modifying trinity.xml, use geconfig whenever possible.
A Running Mode Selector dialog pops up each time we run geconfig. We can choose between embedded or distributed.
The configuration for embedded GE is very simple. Only two parameters need to set as shown below.
StorageRoot is the directory where GE stores data. LoggingLevel controls what kinds of messages are logged: Off (no message is going to be logged), Verbose (all messages will be logged), and a few levels in between.
The distributed mode configuration editor has two tab pages.
The first tab configures the servers in the cluster. You can add or remove GE servers by clicking the Add / Remove button. We can use one or more # symbols to add a range of servers. Each # represent a single digit. The range of the # digits is specified by the '#' Range. The Working Directory is the directory where the current GE application can be located.
We can modify the information of an existing server entry by making it selected in the server list.
The proxy tab page is similar to the server page except it is for configuring GE proxies.
Besides the graphical configuration editor, GE has a public static class named TrinityConfig for runtime configuration. You can change the configuration parameters loaded from trinity.xml via the interfaces provided by this class. For example, you can switch the running mode of your program to Embedded by the following line of code.
TrinityConfig.CurrentRunningMode = RunningMode.Embedded;
Note the runtime changes are not written back to trinity.xml. If you would like to save your changes, you need to explicitly call TrinityConfig.SaveConfig().