|
Syzygy Documentation: Distributed Operating SystemIntegrated Systems Lab01/05/2007 Documentation Table of Contents
Overview
A Syzygy cluster is comprised of a set of computers connected by a network. Each
cluster is controlled by a Syzygy server. There is only one instance of
the Syzygy server program,
Membership in a cluster for a given user is determined by two files:
A Syzygy cluster can be controlled in two ways:
It's not entirely necessary, but it's a lot easier to run cluster applications
if each computer in a cluster runs a copy of the remote execution daemon Required Ports: A Note on FirewallsIMPORTANT: Many operating systems today will install a firewall. The default configuration of this software might very well keep Syzygy from functioning. As a networked system, Syzygy expects to be able to communicate on particular ports. The easiest option is to simply not have a firewall at all. However, this may not be acceptable. These ports must be allowed through a firewall:
Reserved Words and Characters"NULL" or "*" cannot be user-defined user, computer, group, or parameter names. "NULL" internally functions as the indication of an undefined value, while "*" is used in the Syzygy server automated discovery process. The characters
: ; | /
should also not be used in names. Creating a ClusterCreating a Cluster: The Network Configuration FileEach computer in a cluster must contain a network configuration file named "szg.conf". in which network interface data are stored. The default location of this file varies by platform:
If desired you can set the environment variable SZG_CONF to the path to a directory where this file should be created. Note that all Syzygy users MUST be able to change into the directory containing the szg.conf file. Every Syzygy program will try to read the szg.conf file, but they generally do not try to write to it. It must exist for programs to work in Cluster Mode but it is not necessary for programs to work in Standalone Mode.
# The computer's Syzygy name (typically the first part of the DNS name, but it doesn't have to be). Defaults to "NULL". # For each network interface card in the computer there must be a record specifying: # The Syzygy network that this interface is part of. Interfaces connected to the internet should specify "internet"; multiple private networks are allowed and should be assigned distinct names that are meaningful to you. # The interface's IP address and netmask. The netmask defaults to 255.255.255.0. # A "type" value that must currently be set to "IP". Note that there's no default interface record, if you don't add any you simply won't be able to perform any Syzygy networking functions. # A range of ports to be used in connection brokering. This is specified by two numbers, the starting port number and number of ports in the block. The default values are 4700 and 200. Here is an example of an szg.conf file:
<computer>
<name>my_computer</name>
</computer>
<interface>
<type>IP</type>
<name>internet</name>
<address>999.999.999.999</address>
</interface>
<interface>
<type>IP</type>
<name>private_net</name>
<address>192.168.0.1</address>
</interface>
<ports>
<first>
4700
</first>
<size>
200
</size>
</ports>
By default, the szg.conf file is located at c:\szg\szg.conf on Win32 systems
and at /etc/szg.conf on Unix systems. An alternate location can be specified
by setting the environment variable SZG_CONF to the path of the desired
directory (without trailing path delimiter, e.g. Creating the Network Configuration FileYou don't need to edit szg.conf by hand; command line programs are provided. Each of these commands parse the whole szg.conf file and re-write it from scratch upon completion, minimizing the possibility of error. To create szg.conf, perform the following steps (to perform these steps you must have write access to the directory where szg.conf will be created):
Network Configuration File Command Reference
dname <name>
Sets the computer's name in the szg.conf file. If no ports information is present, it goes ahead and adds a default ports record, reserving the range 4700-4899.
dconfig
Parses the szg.conf file and prints the information in compact form.
daddinterface <network_name> <address> [<netmask>]
Adds an interface to szg.conf file with the given name, IP address, and (optionally) netmask. The name should be descriptive (like "internet") and is meant to uniquely identify a network. The netmask can also be given (the default is 255.255.255.0).
ddelinterface <network_name> <address>
Removes the interface with the given name/address pair from the szg.conf file.
dports <first_port> <num_ports>
Changes the "ports" record in the szg.conf file, with "first_port" giving the number of the first port to be used and "num_ports" giving the number of ports in the block. Creating a Cluster: Running a Syzygy ServerTo run a Syzygy server, type:
szgserver <server_name> <server_port>
e.g.
szgserver my_server 8888
The <server_name> is arbitrary and is the name that users will use for logging in
with the You can restrict the IP addresses from which connections will be accepted by appending an optional sequence of whitelist entries, which can either consist of single IP addresses or blocks of IPs in address/netmask format. The latter means that addresses that match the specified address after being AND'ed with the netmask will be allowed to connect. For example, If you typed:
szgserver my_server 8888 192.168.0.11 130.126.127.0/255.255.255.0
The first whitelist entry, NOTE: szgserver is meant to run in the background for a long time (like a linux daemon or windows service). Here are some common misunderstandings:
Computer Names According to the Syzygy Server
The Syzygy server does not do name resolution (i.e. does not use DNS).
Clients read the network configuration file Creating a Cluster: The Syzygy Login FilesThe network configuration file determines the identity of an individual computer in the cluster. This information is insufficient to join a cluster: In order to do that you also need to specify a Syzygy server and user name. This information is maintained in a set of login files, potentially one for each operating system user on the computer. The default locations for these files are:
An alternate directory can be specified by setting
the environment variable SZG_LOGIN to the path to the directory (without
a trailing path delimiter). The login file names are of the form Each such file contains the following records:
Here is an example login file:
<login>
<user>me</user>
<server_name>my_server</server_name>
<server_IP>999.999.999.999</server_IP>
<server_port>
8888
</server_port>
</login>
If the user is not logged into any Syzygy server (e.g. after issuing the
<login>
<user>NULL</user>
<server_name>NULL</server_name>
<server_IP>NULL</server_IP>
<server_port>
0
</server_port>
</login>
Of course, the fact that this information is stored in a file means that it persists across operating system login sessions; if you log off of the computer and then log in again, you will still be logged into the same Syzygy server. Creating the Login FileYou use the following commands to create and modify the Syzygy login files:
dlogin <server_name> <syzygy_user_name>
dlogin <server_IP> <server_port> <user_name>
Two forms of the
dlogin my_server me
or
dlogin 127.0.0.1 8888 me
Upon successful dlogin, the information in the login file will be printed, looking something like:
OS user = johndoe
syzygy user = me
szgserver = my_server, 999.999.999.999:8888
This command associates a Syzygy user name with the current operating system (Windows, Unix) user name. Any subsequent commands issued on that computer while logged in as that operating system user will be interpreted by Syzygy as being issued by the specified Syzygy user. To change Syzygy users for a given OS user you can either (a) dlogin as a different Syzygy user, or (b) dlogout, which disconnects you from any szgserver. As stated above, if you log out of your computer's operating system and then log back in you will still be dlogged in as the same Syzygy user.
Note that the second form of the Not also that there is currently no authentication of Syzygy users. Other users that can dlogin to the server can change your Syzygy database parameters or execute your Syzygy applications without restriction.
If both forms of the
To log yourself out of the Syzygy server and reset the login file, type:
dlogout
This command resets the fields in the current user's login file to "NULL" or 0 as appropriate. Issue this command before running programs in Standalone Mode.
dwho
Prints the login file of the current operating system user in compact form.
dhunt
Searches for Syzygy servers. This command reads the szg.conf file and sends a broadcast discovery packet out through each network interface listed in that file. Any servers receiving the packet respond with their names, IP addresses, and port numbers. Creating a Cluster: The Remote Execution Daemon
The remote execution daemon
The exec message sent by By convention, dynamic libraries (dlls) are assumed to live in the same directory as the executables that load them. Consequently, when executing a program, szgd prepends the directory in which the program lives to the front of environment variable giving the dynamic linker search path (LD_LIBRARY_PATH on Linux).
The form of the
szgd <base_paths> [-r]
The required <base_paths> argument should
be a semicolon-delimited list of paths to directories or executables; paths
to executables should not include the '.exe' suffix on Windows.
For example, you might type: szgd C:\myapps -r
After starting
dps
You'll see something like:
computer1/szgd/0
computer2/szgd/1
computer3/szgd/2
computer4/szgd/3
computer5/szgd/4
computer6/szgd/5
i.e. "computer name"/"process name"/"process ID". There should be a line for each computer on which you have run szgd.
Note that only one instance of Creating a Cluster: Specifying VR-Related ParametersAt this point you have the basic Syzygy infrastructure in place. You need to read about setting up the information in the Syzygy database to specify what components should run on which computers, the configuration of your graphics displays, and so on. See System Configuration. The rest of this chapter contains reference material about the distributed operating system. Using Virtual ComputersFor information on defining virtual computers, see Virtual Computer Configuration.
To launch an application on a virtual computer, you will need a copy of
szgd running on every "mapped" machine, i.e. any real computer whose name appears as
the value of a "<something>/map" parameter value in the virtual computer definition.
Once this is done, to launch atlantis
(a sample application included with the szg source) on
virtual computer
dex vc atlantis
You can also launch a single component as part of a virtual computer. This allows you to either launch all the components of a virtual computer by hand one at a time or to re-start a component that has exited for some reason. Type:
dex <computer> <component_name> [<args>] -szg virtual=<virtual_computer_name>
For example, suppose we've had to quit the copy of atlantis running on computer "computer3", which is part of virtual computer "vc". Then we could type:
dex computer3 atlantis -szg virtual=vc
to restart it. This works for services (e.g. DeviceServer, SoundRender) as well. See Component Contexts for more information. There are two ways to kill an application running on the virtual computer. You can directly kill the trigger instance. For that you need to know the location parameter of the virtual computer. For the example virtual computer defined in Virtual Computer Configuration, that would be "my_room", so you would type:
dmsg -c my_room quit
Or you can type:
dkillall vc
Here are several useful commands for managing a virtual computer:
dkillall <virtual_computer>
Kill any application currently running on the given virtual computer, along with any associated services such as szgrender, SoundRender, or DeviceServer.
dmsg -c <virtual_computer_location> quit
Kills the application, if any, currently running in the given virtual computer location, but leaves services alone.
restarttracker <virtual_computer>
Restart services associated with virtual_computer (e.g. input devices and sound).
setdemomode <virtual_computer> [true, false]
If second argument is "true", this sets each render machine to use a fixed head position rather than that reported by the tracking device. The head position is read from the active screen definition (see Graphics Configuration) on each render computer. Each rendering machine will assume that the direction of gaze is perpendicular to its display, and the up direction of the head will be the screen's up direction rotated by the angle (in degrees) given by the screen's fixedheadupangle element. To set things back to normal mode, use "false" as the second argument.
setstereo <virtual_computer> [true, false]
Turns active stereo rendering on and off for each rendering machine of the cluster.
screensaver <virtual_computer>
Start szgrender programs on each render machine in the cluster. Since szgrender is black when no application is connected, this is effectively a screensaver.
calibrationdemo <virtual_computer>
Display a calibration screen useful for alignment and color matching, looking for the calibration picture cubecal.ppm in the SZG_DATA/path of each render machine. Component ContextsWhat is the Component Context?Every component in Syzygy is executed in a "context". The context determines the overall behavior of the component, whether the component is executing as part of a virtual computer, and what networks it will use for various sorts of communication. It consists of a list of variable/value pairs, as listed below:
virtual=virtual_computer_name
The name of the virtual computer on which this component is executing. Set to the value "NULL" if it is not executing on a virtual computer (the default).
mode/default=[trigger, master, component]
The overall behavior of the component. The "trigger" value causes a syzygy application to run as a trigger instance, launching other necessary components on a virtual computer. The "master" value causes a master/slave component to take the master role. The "component" value is a default and has no effect.
mode/graphics=SZG_DISPLAY(n)
One of SZG_DISPLAY0, SZG_DISPLAY1, etc. If the component opens a graphics window, this determines the screen configuration it will use from among those defined for the computer it is running on. If you specify a display that isn't defined, a default display configuration will be used.
networks/default=network_list
The value network_list is a slash-delimited list of network names, like internet/my_private_net. It indicates, in descending order of preference, the network across which service connections should occur, assuming that the service type (input, graphics, sound) has not already specified this.
networks/input=network_list
Defines the network across which input service connections should occur.
networks/graphics=network_list
Defines the network across which graphics service (szgrender) connections should occur.
networks/sound=network_list
Defines the network path upon which sound service connections should occur.
parameter_file=parameter_file_name
If the application is running in Standalone Mode it reads its parameter database from a file in its current working directory. By default it looks for szg_parameters.xml and then szg_parameters.txt, but this can be changed by passing this special parameter.
user=syzygy_user_name
The Syzygy user under whose auspices the application will run.
server=IPaddress/port
Identifies the location of the szgserver to which the component should attempt to connect. Note those last two items in particular: By manipulating them you could run a component as a different user and connecting to a different Syzygy server from the one you are currently dlogged into. Manipulating Component ContextsNormally when you launch an application on a virtual computer the application launching process sets up the context appropriately for each launched component. However, sometimes you will want or need to set the context manually; for example, you may need to restart an individual component of an application running on a virtual computer. This can be done in two ways: (1) By setting the SZGCONTEXT environment variable, or (2) by passing special arguments on the command line. Setting SZGCONTEXTThe value of SZGCONTEXT should consist of a sequence of the above pairs seperated by ';'. You can set this environment variable manually to control the behavior of Syzygy components on a particular computer. A sample one might look something like:
virtual=vc;mode/graphics=SZG_DISPLAY0;networks/graphics=my_private_net
Command-line Context ManipulationTo manipulate a context from the command line, pass "variable=value" pairs preceded by "-szg". For example:
syzygy_executable -szg virtual=vc -szg networks/graphics=internet
Obviously, this method is more flexible than setting an environment variable,
but it has a weakness: It depends on all Syzygy components (including any
applications that you write) processing command-line arguments after
the Syzygy client object,
Yet another advantage to this method of manipulating the context: It can
be used remotely. When you launch an application using the
dex render1 szgrender -szg virtual=vc
will launch szgrender on computer "render1" and tell it to behave as a component of virtual computer "vc". dex will interpret the "user" and "server" arguments, allowing you to launch applications as a different user or even on a different cluster from those specified in the login file. For example:
dex vc_far_away my_app -szg server=faraway_IP_address/faraway_port -szg user=somebody_else
Connection Brokering and Service Names
Connections to Syzygy services such as input event streams, sound output,
and scene-graph rendering are brokered by the Syzygy server Service names are parially determined by the nature of the service (the "basic service name") and partially by the circumstances under which a component is launched. If a user launches a component, but not in the context of a virtual computer, the component's service name will be:
basic_service_name/syzygy_user_name
This prevents the actions of one syzygy user from interfering with those of another. On the other hand, if a user launches a component in the context of a virtual computer, the component's service name will be:
virtual_computer_location/basic_service_name
(see Virtual Computer Configuration). This allows different users to share application components running in a particular virtual computer location, allowing them to be used as a communal resource. Base Service NamesBase service names for the various syzygy service are listed below.
SZG_INPUT#
An input-event service: One of SZG_INPUT0, SZG_INPUT1, etc. The number refers to the driver slot.??? inputsimulator and DeviceServer offer this service. DeviceClient and Syzygy applications in general must connect to it in order to receive input from trackers, joysticks, gamepads, and so on.
SZG_SOUND
A source of sound information. The sound-playing component SoundRender needs to receive or connect to this service. Syzygy VR framework applications (see Programming) offer it.
SZG_SOUND_BARRIER
Synchronization for the SZG_SOUND service. SoundRender connects to this service. Syzygy VR framework applications offer it.
SZG_GEOMETRY
A source of scene graph information, generally a distributed scene graph framework application (see Programming). The scene-graph rendering component szgrender needs to connect to this service.
SZG_GEOMETRY_BARRIER
Synchronization for the SZG_GEOMETRY service. szgrender needs to connect to this service. Distributed scene graph applications offer it.
SZG_MASTER_<application_name>
The master instance of a master/slave application (see Programming) offers data to the slaves via this service. Slave instances try to connect to this service.
SZG_MASTER_(application_name)_BARRIER
Synchronization for the above service. Examining Running ServicesExamining services can be helful in debugging problems with components not connecting properly. For a list of currently-offered services, type:
dservices
For a list of pending service requests, i.e. requests that have not yet been able to connect to a provider of the requested service, type:
dpending
How it All Fits TogetherConsider a brief example. You launch a distributed scene graph application. It signals the connection broker in the server that it requires an SZG_INPUT service (for user input) and provides SZG_GEOMETRY and SZG_SOUND services (i.e it is a source of virtual-world-object and sound information). The connection broker notes that there is a running DeviceServer providing SZG_INPUT0, several szgrenders on various computers requesting SZG_GEOMETRY, and a SoundRender requesting SZG_SOUND. In each case, it sends the IP address and port of the service provider to the components requesting the service, allowing them to connect and satisfy their cravings. LocksLocks are Syzygy's mechanism for synchronizing access by multiple, networked processes to resources that can only be accessed by one process at a time. They are exposed to the network by the Syzygy server, but they work analogously to mutexes within a multi-threaded program. When a process requires access to a resource, it requests the associated lock; if no other process holds the lock, it immediately acquires it and proceeds to use the resource. If another process is holding the lock, however, the first process is blocked and cannot continue until the second one releases it. For example, as noted in Virtual Computer Configuration, overlapping virtual computers can be assigned a common "location" parameter. Virtual computers with the same location parameter are assumed to share machines. If one user launches an application on one such virtual computer, you don't want anyone else to be able to start another program on an overlapping virtual computer at the same time. To prevent this, the first application to launch requests a lock with the name "<virtual_computer_location>/SZG_DEMO/lock". It holds the lock until all of its components have launched, then releases it. Other applications attempting to launch on another virtual computer with the same location parameter will request the same lock and will be blocked until they can acquire it. Locks are also used to reserve resources. Some Syzygy components are not allowed to run if another instance of the same component is already running on the same computer. When such a component starts, it requests a lock and does not release it until it exits; other instances attempting to start in the meantime will be unable to aquire the lock and will exit. Here are a few components and their named locks:
Finally, locks facilitate automatic shutdown of previously running applications. If a new application requires a particular resource (for example, it needs to run a rendering component on render1/SZG_DISPLAY0), it requests the associated lock. If the request fails, the server sends the Syzygy process ID of the component holding the lock to the application. The new application then sends the offending component a "quit" message and waits for the lock to be released. To see the existing locks, type:
dlocks
Command Line Tools ReferenceSyzygy also has commands for managing the paramter database (used for holding system configuration data), for sending messages to running components, and for monitoring the status of the system (e.g. finding out what components are running). Parameter Database ManagementThe commands for manipulating the Syzygy database are described in the System Configuration chapter. Interprocess CommunicationsSyzygy components communicate by sending messages to one another, with the Syzygy serving providing routing information. Messages have a type and optionally a body. The type is generally a single word, such as "exec" (to launch a component) or "quit" (telling the receiving component to exit). Some message types are only meaningful to certain components.
Of particular interest to applications programmers is the "user"
message type. This gets passed on to the application code
by means of the application frameworks' user-message callback or method
(see Programming). This allows you to control
your application by means of messages sent using the The following commands can be used to send messages to running components:
dex [-v] <execution_location> <executable_name> [<arguments>]
Launch a Syzygy component or application remotely. <execution_location> should be either
dkill [-9] [<computer_name>] <executable_label>
Send a "quit" message to the first entry in the Syzygy process table
with the specified label (i.e. process name as returned by
The remainder are variants on the dmsg <ID> <message_type> [<message_body>]
Send a message to the process with the specified <ID> as printed
by
dmsg 99 exec /home/randomuser/bin/linux
dmsg [-r] -p <computer_name> <component_name> <message_type> [<message_body>] Find the Syzygy component with name <component_name> that is running on computer <computer_name>. Send it a message with type <message_type> and optional body <message_body>. If the -r flag is specified, dmsg requests a reply to its message and waits for that reply, printing it upon receipt. dmsg [-r] -m <virtual_computer> <message_type> [<message_body>]
Find the component running on the master screen of
the specified virtual computer. Send it a message with type <message_type>
and optional body <message_body>. If dmsg [-r] -g <virtual_computer> <display_number> <message_type> [<message_body>]
Find the component running on the specified virtual computer's display indexed
by <display_number>. Send it
a message with type <message_type> and optional body <message_body>.
If dmsg [-r] -c <virtual_computer_location> <message_type> [<message_body>]
Find the trigger component for the currently
running application in the given virtual computer location
(locations are discussed in Virtual Computer Configuration). Send it
a message with type <message_type> and optional body <message_body>.
If dmsg [-r] -s <service_name> <message_type> [<message_body>]
Find the component providing the service <service_name>.
Send it
a message with type <message_type> and optional body <message_body>.
If dmsg [-r] -l <lock_name> <message_type> [<message_body>]
Find the component holding the lock <lock_name>. Send it
a message with type <message_type> and optional body <message_body>.
If System Monitoringdps [<search_tag>] List all Syzygy processes in the format:
computer_name/process_name/ID
Adding the <search_tag> parameter lists only those lines containing it. dtop [d <milliseconds>] | q | t Unix Only. Repeated dps, like Unix "top" with pretty color coding. Specify the repeat interval as:
TroubleshootingWhen things go wrong, e.g. an application or application component does not launch or two components refuse to connect, the user needs to understand connection brokering, locks, and the tools to examine them. Misconfiguration or misuse of these features is a major cause of problems when using Syzygy.
Connection-Brokering TestTo verify that basic connection brokering works between computers in your cluster:
|
|
[Schedule] [Labs] [Beckman Meeting Rooms] [Equipment] [Projects] [CUBE Projects] [Syzygy] [VSS] [People] [Events] [Publications] |