Terracotta DSO on Multiple Nodes |
rate-7766462-21075
| Article Rating? |
|
|
|
Table of Contents
Description
This guide details the steps required to run the Terracotta samples on multiple machines. When you're finished with this guide you will have the Shared Editor sample running on two different machines, using a Terracotta server on yet another machine.
Common instructions:
- Install kits on target machines
- Run sample server
For using the Sample Launcher:
- run sample launcher on clients
- Use File|Servers dialog to specify server host machine
- Run Shared Editor sample
For command-line:
- set TC_SERVER environment variable to server-host:9510
- run Shared Editor sample using command-line script
Monitor server activity:
- Start AdminConsole, connecting to server
Getting Started
Let's assume for the purposes of this guide that the Terracotta samples will be run on two different computers named clientA and clientB, and that the Terracotta server will be run on a computer named server-host.
Install the Terracotta distribution on each of these machines. Currently Terracotta clients and server must be of the same version.
Running the sample server on server-host
On server-host, run the sample server by executing the TC_HOME/samples/start-demo-server script appropriate for your host environment, .bat for Windows and .sh for everything else.
Running the Pojo Sample Launcher on clientA and clientB
On clientA and clientB, run the graphical Pojo SampleLauncher by executing the TC_HOME/tools/pojo/samples script. The SampleLauncher will appear:

Use the File|Servers menu to specify server-host as the remote server for the sample clients:

The samples will now use the Terracotta server on server-host instead of the local server that is automatically started by the SampleLauncher. Launch the Shared Editor sample.

What is really happening?
The Remote server item of the SampleLauncher's Server dialog simply causes the tc.server Java system property to be passed to the Terracotta sample client. The tc.server property is known as a server specification, a comma-separated list of DSO server addresses. A DSO server address is a DSO server hostname followed by an optional DSO server port. For example,
server1-host:9510,server2-host:9510
In our case the SampleLauncher passes -Dtc.server=server-host:9510 to the sample client, causing it to use the specified server specification in place of the servers listed in the sample's configuration file.
If you wish to run the samples using the command-line scripts, you can simply set the TC_SERVER environment variable prior to invoking the sample runner scripts:
$ set TC_SERVER=server-host:9510
$ TC_HOME/samples/pojo/sharededitor/run
The sample runner scripts make use of the dso-env helper script to setup the JAVA_OPTS required to activate the Terracotta runtime. When dso-env sees that TC_SERVER has been set, it will include that value as the tc.server Java system property.
Monitoring the Terracotta Server
Now that you have the samples running on multiple nodes, you can start the AdminConsole by running the TC_HOME/bin/admin script. Specify server-host in the Hostname field and click the Connect button. You're can now monitor the server activity generated by the running samples.