Best Practices for Setting Up Agents in Test and Production Environments

To help ensure proper file tracking, and to prevent issues when transitioning between environments, it's recommended that you set up separate Tetra Agent instances for test and production environments. This approach maintains data integrity, ensures that all files are properly uploaded to each environment, and prevents resource contention issues between environments.

For more information about Agent configuration and deployment options, see Tetra Agent Deployment Options.

Why Separate Agent Instances Are Needed

Tetra Agents maintain a local state about which files have been uploaded to the Tetra Data Platform (TDP). This state is stored in a local SQLite database that tracks file metadata, upload status, and other information. However, Agents don't track which environment the files are uploaded to.

If the same Agent instance is later reconfigured to point to a different environment (for example, from test to production), the following issues can occur:

  • Missing Files: The Agent won't upload files that have already been uploaded to the test environment, but are missing from the production environment. This behavior occurs because, according to its local database, these files have already been processed.

  • Inconsistent State: The Agent's local state will be inconsistent with the actual state of files in the production environment.

Best Practices

When setting up separate Tetra Agent instances in your test and production environments, it's recommended that you do the following.

Use Dedicated Agent Instances on Separate Machines

TetraScience recommends installing and configuring separate Agent instances on different machines for each environment:

  • One Agent instance on a dedicated machine for the test environment on a test server
  • One Agent instance on a dedicated machine for the production environment on a production server

🚧

IMPORTANT

Installing multiple Agent instances on the same machine is not recommended, because it can result in resource contention issues. Separate machines ensure that each Agent has dedicated resources and that performance issues in one environment don't affect the other.

Use Clear Naming Conventions for Each Agent Host Machine

Use clear naming conventions for the Agents' host machines to identify their environment purpose.

Example Agent Host Names

For example, the following names clearly define each of the host machines' environments:

  • Test server host name: <server-name>-test
  • Production server host name: <server-name>-prod

Use Environment-Specific Agent IDs

Use different Agent IDs for test and production instances. These IDs are provided by the Tetra Data Platform (TDP) when you create each Agent.

Use Environment-Specific Integration Settings

Configure each Agent instance with the appropriate connection details for its target environment. Make sure that each of the following connection details point to the correct environment for each Agent:

  • API endpoint
  • Organization slug
  • Authentication token

Document Each Agent Setup

To help avoid confusion during maintenance or troubleshooting, make sure that you document which Agent instance connects to which environment.

Set Up Monitoring for Each Agent Separately

To help clearly track each Agent's operational status, make sure that you set up monitoring for each Agent instance separately.

Verify that Each Agent Host Meets the Minimum Hardware and Software Requirements

To make sure that each Agent performs as expected, make sure that each host server has appropriate resources for the expected workload (CPU, memory, disk space).

Each Agent's prerequisites are listed in the Agents documentation.

Plan and Upgrade Agents in Each Environment Separately

When upgrading Agent versions, make sure that you upgrade the Agents in each environment separately. It's recommended that you upgrade the Agent in the Test server first.

Transitioning Agents Between Environments

When transitioning an Agent's workflow from test to production environments, do the following:

  1. Validate in Test: Complete testing and validation in the test environment.

  2. Configure the Production Agent: Configure the productionAagent with the same paths, patterns, and other settings as the test Agent.

  3. Start the Production Agent: Start the production Agent to begin uploading files to the production environment.

  4. Verify the Data: Verify that all expected files are uploaded to the production environment.