AWS AMI Edition

Version 22.0.8425


AWS AMI Edition


The Amazon Machine Edition of CData Sync is a Linux-based instance with CData Sync pre-configured and ready to run, with little additional configuration necessary. This offering is available in the Amazon Web Services Marketplace by searching for CData Sync.

Launching the CData Sync Instance

  1. Click Continue to Subscribe in the upper right corner to subscribe to the Amazon Machine instance (AMI). Then, accept the terms and conditions. After you subscribe, you can configure a new instance of CData Sync.
  2. Configure your instance, as follows:
    1. Choose the instance type. See CData Sync Licensing for more information.
    2. Set the security group. CData Sync runs on the default HTTPS port (443). Ensure that this port is accessible from the IP address that you use to connect to CData Sync.
    3. Create a new key pair or choose an existing one. Ensure that you save the PEM file. That file is used later to access the AMI via a secure shell (SSH).
  3. Click Launch to create the EC2 instance and start CData Sync.

Accessing CData Sync from Your Browser

After you launch the CData Sync instance, it is listed in your Amazon EC2 management console. Then, you can access CData Sync in your browser with the following URL:

https://InstancePublicDNS

Log in with the following credentials:

  • User: The default username is admin.
  • Password: The password is the instance’s randomly generated instance Id prefixed with Sync22:. For example, if the Instance Id is i-1234a, the initial password to access Sync is Sync22:i-1234a. After you log in, you can change the password for the admin user from the upper right corner of the browser.

Now, you can follow the instructions in Creating Connections to create your connections and manage your jobs.

Managing the AMI

The CData Sync AMI works immediately, without additional configuration. The following sections provide information about management tasks for CData Sync that are AMI specific.

Accessing the Instance from a Secure Shell (SSH)

Connecting to the EC2 instance via SSH is useful for advanced configuration of the service. The CData Sync AMI is based on a standard Ubuntu 16 virtual machine (VM), and the main user is ubuntu. You can connect to the instance via SSH by using the key pair that you select when you launch the instance, as shown below:

ssh -i MyKeyPair.pem ubuntu@InstancePublicDNS

Controlling the CData Sync Service

CData Sync is run as a systemd service (rather than being run in-process) in an AMI deployment. The service definition file is available in the following location:

etc/systemd/system/sync.service

You should use the following systemd commands to stop, start, and restart Sync:

sudo systemctl restart sync
sudo systemctl stop sync
sudo systemctl start sync

Note: Before you make any changes to the Sync application, you should stop the service first.

Installation Directory

All the Sync configuration and application data resides in the application directory. The default application directory is shown below:

/opt/sync

You can configure the application directory’s path in the sync.properties file, as described in Configuring the Application Directory.

db Folder

The db folder contains the database files for the default Derby database. Note that you can configure the application database to use an external database, as described in Application Database.

libs Folder

The libs folder is where the application reads external resources, like drivers for connectors that require an external driver. Place jar files in this folder and restart Sync to enable the application to read these resources.

Configuring the Application Directory

You can configure the application directory’s location in the sync.properties file, which is located next to the sync.jar file.

To configure the application directory to a non-default location:

  1. Locate the following snippet within the sync.properties file:
    cdata.app.directory =
    
  2. Add the path to the new location for the application directory, as shown in this example:

    cdata.app.directory=/mnt/shared/sync
    

Application Database

By default, Sync uses a Derby database for connection, jobs, application settings, and general application logs. This Derby database is in the db folder of the application directory, as described in the previous section.

You can configure Sync to use an external database like MySQL. As with the application directory, you configure the application database in the sync.properties file.

To configure the application database:

  1. Locate the following snippet in the sync.properties file:

    cdata.app.db=
    
  2. Set the connection string to the target database that you want, as shown in this example:
    cdata.app.db=jdbc:mysql:Server=MySQLServer;Port=3306;Database=mysql;User=User;Password=Password
    
  3. Restart the Sync service so that the changes in the previous steps take effect.

Ports and SSL

By default, Sync listens for SSL connections (HTTPS) on port 8443. Sync cannot bind to the default HTTPS port (443) because of permissions restrictions. Therefore, an iptables rule redirects traffic from port 443 to port 8443. No further action is required for standard HTTPS traffic to reach the Sync web server.

Sync AMIs include a self-signed certificate for use when hosting an SSL server. If the SSL server needs to be hosted using a certificate signed by a certificate authority (CA), then you should contact the CA directly to obtain a certificate.

Enabling HTTP Connections

To add a plaintext/non-SSL port (for example, HTTP instead of HTTPS), you need to edit the sync.properties file to enable the plaintext listener. Because of permissions restrictions, the listener cannot bind directly to port 80. Therefore, it is established on port 8181, and an iptables rule must be established to forward traffic from port 80 to port 8181, as follows:

  1. Stop the Sync service by submitting this command:
    sudo systemctl stop sync
    
  2. Locate the http.port snippet in the sync.properties file:
    cdata.http.port=
    
  3. Set the port to 8181 and save the changes.
  4. Create a new iptables rule to forward traffic from port 80 to port 8181:
    iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8181
    /usr/libexec/iptables/iptables.init save
    
  5. Restart the Sync service so that the changes in the previous steps take effect.

Upgrading

Upgrading Sync requires launching a new instance of the latest Sync AMI. Before launching the new instance, you should copy data from the old instance so that the application configuration is preserved in the new instance.

Sync includes a migration tool that enables you to export and import the configured connections and jobs easily in the application.

To use the migration tool:

  1. Navigate to the Migration tab on the Settings page.
  2. Click Export to export all settings (connections, jobs, users, and history) to a ZIP file.
  3. Import the configuration settings from the same Migration tab into the new instance.
  4. Click Import.
  5. Navigate to the ZIP file that you created in step 2.

Adding a New Connector

You can add new connectors through the UI by following the steps outlined in Connections. However, you might be required to update or add the connector manually to your instance by following these steps:

  1. Use SSH to navigate to your AMI.
  2. Stop the Jetty service by submitting this command:
    sudo systemctl stop sync
    
  3. Open a new command prompt and copy the connector to your instance by using the following scp command:

    scp -i ./FolderPath/MyKeyPair.pem ./FolderPath/cdata.jdbc.ProviderName.jar ubuntu@InstancePublicDNS:/home/ubuntu/cdata.jdbc.ProviderName.jar

  4. Copy the connector to the libs folder by submitting this command:

    sudo cp ./home/ubuntu/cdata.jdbc.ProviderName.jar /opt/sync/libs/cdata.jdbc.ProviderName.jar

  5. Restart the Sync service by submitting this command:
    sudo systemctl start sync