Can I change the environment of an existing server by updating the agent configuration?

  • Updated

Question

Can I change the environment of an existing server by updating the agent configuration?

Answer

The server environment can be specified in the agent configuration to determine if the server should be marked as QA, PRODUCTION or DEVELOPMENT in the Contrast UI:

  • Yaml Path: server.environment
  • Environment Variable: CONTRAST__SERVER__ENVIRONMENT
  • System Property: -Dcontrast.server.environment (Java agent only)

The server environment specified in the agent configuration only takes effect when the server is first created.  To change it, you can:

  • As an Admin user, update it manually through the Contrast UI using the Environment dropdown on the Servers tab.
  • As an Admin user, delete the server from the Contrast UI on the Servers tab using the trash icon that appears to the right when hovering over the server.  Follow these steps:

    1. Stop the application and ensure there's no agent traffic between the server and the Contrast UI.  Note that the server will be recreated with the original environment type if an agent heartbeat or any traffic is received from it before you can restart the server with the updated configuration.
    2. Delete the server in the Contrast UI.
    3. Start the application with the updated environment config.
  • The environment can also be updated by the agent if the automatic server cleanup job has ran to delete the server from the Contrast UI after it has been offline for a specified period (see Set server defaults at an organization level for more info).  The environment sent by the agent in the new create server request will be honored.

Change_server_environment_.png

 

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request