References:
AWS Console → All Services → Compute → Elastic Beanstalk → change Ohio to N. Virginia in top menu
AWS Console → Storage → S3 → Buckets → search for app name
click Logs in left side menu
interesting logs
log/eb-commandprocessor.log | shows what happened during deploy |
log/nginx/access.log | shows URLs accessed for qa_server |
app/containerfiles/logs/production.log | rails app log |
eb logs # equivalent to tail -100 eb logs -a # download all logs to local directory in rails app .elasticbeanstalk/l |
eb init
eb ssh
locations of interest
path | purpose | ex files |
---|---|---|
/var/app/current | navigate to app | |
/opt/elasticbeanstalk/hooks/appdeploy/pre | scripts to run before deploy starts | 10_bundle_install.sh |
/opt/elasticbeanstalk/hooks/appdeploy/post | scripts to run after after deploy starts | 01_rails_support.sh |
/opt/elasticbeanstalk/support | EB_SUPPORT_DIR | |
/opt/elasticbeanstalk/support/scripts | EB_SCRIPT_DIR | |
/var/app/ondeck | EB_APP_STAGING_DIR | |
webapp | EB_APP_USER | not a location, but used in 10_bundle_install.sh |
$ sudo mysql -h _DATABASE_HOST_ -u _DATABASE_RAILS_USER_ -p Enter password: _DATABASE_RAILS_USER_PW_ |
Values for _DATABASE_* are in the AWS config
tail -f -n 50 log/integration.log
tail -f -n 50 log/staging.log
tail -f -n 50 log/production.log
tail -f -n 50 log/monitor.log
tail -f -n 50 log/performance_cache.log
sudo service httpd restart
grep 500 log/production.log
grep Timeout log/production.log
grep "RDF::Graph#load failure" log/production.log
check if solr is running
ssh _URL_MINUS_HTTP_MINUS_PORT_TO_END_ ### NO PERMISSION TO SSH TO THIS MACHINE ps ef | grep solr |
start if not running or restart solr if running but not responding
sudo service solr start sudo service solr restart |
Ref: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-ssh.html
command | example | comments |
---|---|---|
eb init | eb init |
|
eb list | eb list | shows all servers you can connect to |
eb ssh | eb ssh _MACHINE_NAME_-stg | connect to default or a specific server (see eb list for server names) app at: /var/app/current |
eb printenv | ||
eb setenv _NAME_=_VALUE_ | set environment vars from command line | |
aws logs | ||
awselasticbeanstalk restart-app-server | aws elasticbeanstalk restart-app-server --environment-name my-env |
Article: Update Bundler on AWS Elastic Beanstalk
In app on laptop (e.g. CUL-IT/qa_server)
/.ebextensions/upgrade_bundler.config
config/locales/qa_server.en.yml
CHANGELOG.md
(e.g. "update bundler to 2.1.4 on AWS" )At app root in terminal on laptop
gem install bundler -v 2.1.4)
bundle update qa_server)
BUNDLED WITH 2.1.4
) Commit