Using xGT on AWS
The xGT server runs as a Linux daemon on an AWS instance you spin up and listens on a local port for commands.
The server is driven by a python library, which can be run either locally on the AWS instance or any other python-capable client via the separate
There are three general modes of operation for working with xGT on AWS:
1. Local to AWS
All python scripts are run locally within the same AWS instance.
This strategy involves:
- logging in to the instance as described earlier;
- bringing your own data to the instance; and
- running scripts from any shell on the instance
2. SSH Tunneling
All python scripts are run on a remote system such as your laptop or desktop that is connected using an SSH Tunnel.
- First, create an encrypted ssh tunnel. On an openssh-based platform (most UNIX-based systems) this can be done on the command line:
$ ssh -i <private key file> -N -L 4367:localhost:4367 ec2-user@<instance DNS name or IP address>
Tunneling from a windows platform can be done using a third party package such as
PuTTYusing the provided graphical interface.
Users must install the
xgtpython package on their client machine.
Once tunneling is set up, run your python scripts on the client machine.
3. Using an open port
Warning: This method is insecure.
This is similar to the previous scenario but the EC2 instance has a port opened up for clients to connect.
The default port for
xgt is 4367, but an alternate port may be used.
- Users must open a port on their EC2 instance, usually port 4367.
- The client machine running python scripts will connect to the remote server at the open port.
- Note that because this mode allows for data between client and server to be sent in cleartext, it is insecure. Use at your own risk.
- An example of connecting to the open-port remote server is:
$ python >>> import xgt >>> conn = xgt.Connection("<DNS name or IP address>", 4367)