Connecting Gaia Sky instances¶
Gaia Sky offers a method to connect different instances together so that their internal state is synchronized. The model uses a master-slave scenario, where one (and only one) instance acts as a master and one or more instances act as slaves, getting their internal states updated over a network. The user interacts with the master and all slaves are updated accordingly.
This section describes only how to configure the master and the slave instances in order to connect them together. This method is used to provide multi-projector rendering support (i.e. planetarium domes), but extra steps are needed in order to configure the orientation, distortion warp and blend settings for each slave instance.
Multi-projector configuration is covered in the “Planetarium mode multi-projector setup” section.
The configuration is easy and painless. You will need to launch each instance of
Gaia Sky using a different configuration file (
global.properties). You can
run Gaia Sky with a specific configuration file by using the
command line flags:
$ gaiasky -p ~/.config/gaiasky/global.master.properties
The next sections explain how to configure the master and the slaves.
Configuration: slave instance(s)¶
You can have as many slave instances as you want, but here we’ll explain the process of setting up two slaves.
Copy the current
global.propertiesfile in your config folder (see folders) into
global.slave0.properties. The name is irrelevant, but choose something meaningful. Repeat with
Set the property
program.net.slave=truein each file and make sure that
program.net.masteris set to
Set the desired port to listen to in
program.restport. For example, to use the port 13900 just set the property
program.restport=13900. Use a different port for each slave (i.e. slave 0 listens to 13900, slave 1 listens to 13901, etc.).
For exmaple, to set up a slave in port 13900, make sure that the following lines are in its configuration file:
program.net.master=false program.net.slave=true program.restport=13900
The slave instances should be launched before the master. Launch the slave(s) with:
$ # Launch slave 0 $ gaiasky -p /path/to/global.slave0.properties $ # Launch slave 1 $ gaiasky -p /path/to/global.slave1.properties
Once the slave(s) have been launched, you can verify that the API is working by
http://localhost:13900/api/help with your browser.
Modify the port with whatever port you are using.
Only the master is starting the scripting server. The slaves are automatically forbidden to do so!
Configuration: master instance¶
Copy the current
global.properties file into
edit the following lines.
Set the property
program.net.master=trueand make sure that
program.net.slaveis set to
Add the locations of all desired slaves under the properties
nis an integer that goes from 0 to the number of slaves - 1.
For example, in order to connect the master with two slaves, both running locally (
localhost) on ports
13900 and 13901, add the following to the
program.net.master=true program.net.slave=false program.net.master.slave.0=http://localhost\:13900/api/ program.net.master.slave.1=http://localhost\:13901/api/
Then, just launch the master (after the slaves are running!):
$ gaiasky -p /path/to/global.master.properties
Even though this offers a very flexible system to connect several instances of Gaia Sky together, each instance is a fully-fledged application with its own copy of the scene graph and the data structures. This means that, if you run them locally, the data and scene graph will be replicated several times in memory, possibly consuming lots of gigabytes.
Handle it with care.