When working with Engine Yard, it is crucial to understand where files are located inside an application instance. This knowledge aids in carrying out investigations and addressing issues effectively.
This article aims to be a starting point when working with an Application Instance. We will go over the application instance's roles, its directory structure, and the location of the main logs that may be investigated.
- The application instance
The application instance
Application instances in Engine Yard are used for hosting a web application, whether it be a webpage or API. They always run a web server (Nginx) and one of several application servers (Unicorn, Passenger, or Puma).
For a given application, there can only be one application master. This differs from other application instances in the following ways:
- The application master has an elastic IP attached to it so traffic can be received. All incoming web traffic is directed to the app master and distributed to other instances through the load balancer.
- Deployment is executed on the app master, so it contains all logs concerning deployment. Other instances may have deployment hook logs.
When working with Engine Yard, the following directories will normally need to be accessed when investigating and addressing issues:
Application deployment: /data/<app_name>/
The application deployment directory is used in the deployment process, and contains the following relevant elements:
|Subdirectories & files
|Contains the directories for successful deployments made on the instance.
|Contains the directories for failed deployments made on the instance.
|It's a symlink to the current 'release' folder.
|Contains the deploy hooks, which allow for customizing the deployment process and are managed by the customer.
|Contains files used by all versions of the code, to prevent duplication. These are managed by Chef.
|Contains shared config files. Env files within the folder contain the environmental variables set in the Engine Yard Web UI.
|Symlink identical to that in /data/<app_name>/current/log/, pointing at /var/log/engineyard/apps/<app_name>.
|Used by the Rails app to store temporary files.
|Contains the control files used by the deployment process.
|Has the PIDs of the applications being managed by Monit.
|Contains a copy of the codebase, so pulling the code from GitHub does not require downloading all files during deployment.
|Contains the installed Ruby libraries ("Gems"), so that only new and modified files are installed on deployment.
Other directories and files
|Directories & files
|Contains the systemd configuration files. systemd is used in place of Monit in newer versions of the stack, and is a native OS utility.
|Contains the relevant Monit configuration files relevant to Engine Yard.
|Contains service initialization scripts for Nginx, MySQL, etc.
Contains the installed cookbooks.
In the v4 stack, etc/chef-custom/recipes exists as well for custom recipes.
This file contains all information about the instance type and use:
Contains configuration files:
|Contains the control scripts for application servers.
The existing flows and applications in the EY stack log their operations and errors to a variety of logs. This is a list of the logs that should be accessed during troubleshooting:
Logs related to the deployment of an application's codebase to the instance.
Contains the last deployment log; for older logs, the Engine Yard web UI must be used instead.
The application master contains all deploy-related logs, while other applications only contain the deploy hooks.
Configuration & Chef-related logs
Logs related to instance configuration and Chef runs.
|v6 & v7
Note: Chef runs work slightly differently depending on the version of the stack:
- v4: AWSM SSHs into the instance and executes Enzyme, and Enzyme runs Chef.
- v5: AWSM SSHs into the instance and runs the EY Primer, Primer runs Enzyme, and Enzyme runs Chef.
- v6 & v7: AWSM SSHs into the instance and runs MNML, MNML runs Enzyme, and Enzyme runs Chef.
Logs related to the execution of the application and the relevant web stack.
Contains logs for the rails application:
Contains the following logs:
Other logs concerning OS operations.
Lists all activities from the monitoring and alerting stack, corresponding to the alerts shown in the web UI.
collectd can be configured as required.
|Internal Monit logs, showing its actions.
|OS log with info from applications run in the user's space. While Engine Yard rarely uses it directly, applications in utility instances and other apps may write to it.
|OS-related logs, logging information for cronjobs, collectd errors, Monit activities, kernel messages, etc.
|Shows user access to the system, including all SSH attempts.
Understanding the file locations in Engine Yard application instances is crucial for effective troubleshooting and issue resolution. This guide provides a comprehensive list of directories that are typically accessed when troubleshooting Engine Yard.