One most important prerequisite of GCB is that your private or firewalled network must allow outbound connections. In other words, your NAT or firewall must allow (1) TCP connections initiated from private nodes and (2) UDP sessions initiated by private nodes. If you don't know how to set your network this way and you use Linux iptables on your headnode, you may find this site:Enable Outbound Connections Using Linux iptables helpful.
Installing from Binary
Untar the binary file you downloaded. bin, include, and lib will be created under gcb-platform-version directory. bin has daemons comprising GCB inagent; include and lib will have GCB header files and library, respectively.
Installing from Source
GCB is built using GNU build system. Untar the zip file and do the regular configure, make, and make install. The same directories and files will be created as if GCB is installed from the binary.
Copy files in $(GCB-install-dir)/bin to the machine that you want to run GCB inagent. Refer What goes where to figure out where you have to run GCB inagent.
GCB inagent needs several environment variables and takes an argument.
- The log file name of BrokerMaster. All the log and debug messages from a daemon called BrokerMaster will be recorded to this file.
- The log level of BrokerMaster. "fulldebug" or "basic". "fulldebug" means more detailed logging.
- The maximum size of the BrokerMaster log file. When the log file reaches to this size, the content of the file will be moved to $(BrokerMasterLog).old.
- The log file name of Broker. All the log and debug messages from a daemon called Broker will be recorded to this file.
- The log level of Broker. "fulldebug" or "basic". "fulldebug" means more detailed logging.
- The maximum size of the Broker log file. When the log file reaches to this size, the content of the file will be moved to $(BrokerLog).old.
- The log file name of RelayServer. Actual log file will be $(RelayServerLog).process_id.
- The log level of RelayServer.
- The maximum size of the RelayServer log file.
- The fact whether GCB inagent can directly talk to servers running inside the network that it manages. "yes" or "no".
Command line arguments
GCB inagent is actually comprised of a BrokerMaster, a Broker, and multiple RelayServer running together. The number of RelayServers is dynamically determined by the number of server sockets that the inagent currently supports. You can bring the inagent up by running:
BrokerMaster -i ip-address -i Public IP address in dotted notation like "184.108.40.206".
To run GCBnized application, you need to create a sort of routing table and set environment variables.
When an application calls GCB_connect, GCB refers the GCB routing table to decide whether GCB mechanism should be used to connect to the destination. You have to tell GCB where the routing table is by setting $(GCB_ROUTE). The format of the routing table is very simple. Each line of the file contains one rule. Each rule consists of 'target' and 'method'. 'target' specifies destination IP address(es) to match and 'method' tells what mechanism must be used to connect to the destination. The 'target' must be specified as a valid IP string in the standard dotted notation, "/", and 'mask'. 'mask' tells how many bits of destination IP and IP of 'target' must match. 'method' must be either "GCB" or "direct" GCB stops searching the table as soon as it sees a rule that matches, therefore you must put specific rules before generic ones. The following shows an example routing table.
220.127.116.11/32 GCB 18.104.22.168/32 GCB 22.214.171.124/24 direct */0 direct
Environment variable setting
- The fact that GCB must be used or not. Valid value is either "TRUE", "FALSE", or undefined. If $(GCB_ENABLE) is "FALSE" or undefined, GCB will be bypassed.
- The full pathname of GCB routing table.
- The IP address of the GCB inagent. This must be the same value as the IP address you use with -i option to run the inagent.
- The full pathname of the log file.
- This variable defines how detail GCB will produce log and debug information. Set this variable to "fulldebug" for detailed log. If the variable is undefined or set to "basic", only basic and error messages will be logged.
- The maximum size of the log file. After the log file reaches the size defined by this variable, GCB will move the current log file to $(GCB_LOG_FILE).old. Next log messages will go to $(GCB_LOG_FILE).