Add New Agent

This guide explains how to add a new agent to your Gluesync deployment using Docker Compose, programmatically.

Prerequisites

Before proceeding, ensure you have:

  • Access to your Docker Compose file

  • Basic understanding of Docker Compose configuration

  • A valid image name for your database agent from the MOLO17 Docker Hub repository

Adding a New Agent

1. Reference Documentation

For more details about managing the Docker Compose file, refer to: Gluesync Docker Compose Documentation

2. Locate Your Docker Compose File

The Docker Compose file is located in your Gluesync deployment directory.

3. Copy Existing Agent Service

To add a new source or target agent:

  1. Open your docker-compose.yml file

  2. Locate an existing source or target agent service

  3. Copy the entire service block and add it into the file after the last service block

4. Rename the Service

Change the service name to match your database name. For example, if your database is named "mydb", rename the service from:

previous-agent:

to:

mydb-agent:

5. Update the Docker Image

For example, if you’re using PostgreSQL, change:

image: molo17/gluesync-previous-agent:latest

to:

image: molo17/gluesync-postgresql:latest

6. Update Volume Configuration

Locate in the volume configuration section the correct volume path and update it to use the same name as your service:

Volume Section

For example, if your service is named "mydb-agent", update the volume path:

volumes:
  - ./gluesync-previous-agent:/opt/gluesync/data

to:

volumes:
  - ./gluesync-mydb-agent:/opt/gluesync/data

7. Save and Run

  • Save your changes to the docker-compose.yml file

  • Run the updated configuration:

docker-compose up -d

Example Configuration

Here’s an example of a complete agent configuration:

gluesync-postgresql-source:
    restart: "unless-stopped"
    image: molo17/gluesync-postgresql:latest
    # deploy:
    #   resources:
    #     limits:
    #       cpus: "2.0"
    #       memory: 2.0G
    environment:
    - TYPE=source
    - SSL_ENABLED=true   # set to true if you want to activate TLS encryption
    - LOG_CONFIG_FILE=/opt/gluesync/data/logback.xml
      # Time zone: defaults to UTC, you can change it to match yours (https://docs.diladele.com/docker/timezones.html)
      # - TZ: "Etc/UTC"
    # comment that if you don't require the agent to connect to a locally hosted DB (via your host's localhost)
    extra_hosts:
    - "host.docker.internal:host-gateway"
    volumes:
    - ./gs-license.dat:/opt/gluesync/data/gs-license.dat
    - ./logback.xml:/opt/gluesync/data/logback.xml
    - ./security-config.json:/opt/gluesync/data/security-config.json
    - ./gluesync.com.jks:/opt/gluesync/data/gluesync.com.jks
    - ./gluesync-postgresql-source:/opt/gluesync/data
    - ./gluesync-source-logs:/opt/gluesync/logs
    depends_on:
      gluesync-core-hub:
        condition: service_started

Troubleshooting

If you encounter any issues:

  1. Check the agent logs in the specified log directory

  2. Verify that the database connection settings are correct

  3. Ensure the Docker image exists in the MOLO17 Docker Hub repository

Next Steps

After adding your new agent, you can:

  • Configure the agent settings in the Gluesync UI

  • Test the connection to your database

  • Set up synchronization jobs using this agent