Introduction
Restarting applications in a Replicated deployment of Terraform Enterprise (TFE) requires careful execution to minimize disruptions. By following the steps in this article, you can safely restart the application to apply changes, troubleshoot issues, or perform maintenance while maintaining the integrity of your TFE environment.
Expected Outcome
You will restart the underlying services of the Terraform Enterprise application running on Replicated.
Prerequisites
- Access to the Terraform Enterprise host instance with
sudoor root permissions. - A Terraform Enterprise instance deployed in Replicated mode.
- A basic understanding of Docker and containers.
Use Case
Restarting applications in Terraform Enterprise may be necessary to apply configuration changes, troubleshoot operational issues, or perform routine maintenance tasks. This article outlines the steps to safely restart applications within the TFE environment.
Procedure
-
Check and Stop the Application
First, check the current status of the Terraform Enterprise application.
$ replicatedctl app status
If the application is running, stop it.
$ replicatedctl app stop
Periodically check the status again until the output confirms the
Stateisstopped.$ replicatedctl app status
-
Stop Replicated Services
After the application is stopped, stop the Replicated services.
# systemctl stop replicated replicated-ui replicated-operator
Verify that the services are inactive.
# systemctl status replicated replicated-ui replicated-operator
-
Stop Running Containers
Check for any running Docker containers.
# docker ps
If any containers are still running, stop them all.
# docker stop $(docker ps -a -q)
-
Reload Daemons and Restart Docker
Reload the
systemdmanager configuration.# systemctl daemon-reload
Restart the Docker service.
# systemctl restart docker
Verify that Docker is active and running.
# systemctl status docker
-
Start Replicated Services
Once Docker has restarted, start the Replicated services.
# systemctl start replicated replicated-ui replicated-operator
Check the status to ensure the services started without errors.
# systemctl status replicated replicated-ui replicated-operator
-
Start the Terraform Enterprise Application
After the Replicated services are running, start the Terraform Enterprise application.
$ replicatedctl app start
Monitor the application status until it has started completely. The final output should show
"State": "started"and"IsTransitioning": false.$ replicatedctl app status
A successful startup will produce output similar to the following.
[ { "AppID": "1d1979cd76c843f05e0a8b407d0a5b62", "Sequence": 751, "PatchSequence": 0, "State": "started", "DesiredState": "started", "Error": "", "IsCancellable": false, "IsTransitioning": false, "LastModifiedAt": "2024-04-18T04:45:45.894804916Z" } ]
Additional Information
- For more details on the admin CLI, refer to the Terraform Enterprise Admin CLI Commands documentation.