Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

AWS Console → Storage → S3 → Buckets → search for app name

Table of Contents

Table of Contents


...


Logs

click Logs in left side menu

  • fetch full logs
  • download and unzip
  • interesting logs

    log/eb-commandprocessor.logshows what happened during deploy
    log/nginx/access.logshows URLs accessed for qa_server
    app/containerfiles/logs/production.lograils app log



Code Block
languagenone
eb logs      # equivalent to tail -100
eb logs -a   # download all logs to local directory  in rails app .elasticbeanstalk/l

 

ssh to AWS

  • eb init

  • eb use _machine_name_
  • eb ssh


  • locations of interest

    pathpurposeex files
     /var/app/currentnavigate to app
    /opt/elasticbeanstalk/hooks/appdeploy/prescripts to run before deploy starts10_bundle_install.sh
    /opt/elasticbeanstalk/hooks/appdeploy/postscripts to run after after deploy starts

    01_rails_support.sh

    /opt/elasticbeanstalk/supportEB_SUPPORT_DIR
    /opt/elasticbeanstalk/support/scriptsEB_SCRIPT_DIR
    /var/app/ondeckEB_APP_STAGING_DIR
    webappEB_APP_USERnot a location, but used in 10_bundle_install.sh


  •  connecting to the database

    • Code Block
      languagenone
      $ sudo mysql -h _DATABASE_HOST_  -u _DATABASE_RAILS_USER_ -p
      Enter password: _DATABASE_RAILS_USER_PW_

      Values for _DATABASE_* are in the AWS config

...

Ref: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-ssh.html

Cool commands

commandexamplecomments
eb initeb init
  • us-east-1
  • choose _MACHINE_NAME_-int
  • choose default environment (will vary)
  • type n when asked about CodeCommit
eb listeb listshows all servers you can connect to
eb ssheb 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

aws
elasticbeanstalk restart-app-server
aws elasticbeanstalk restart-app-server --environment-name my-env


Updating bundler on AWS

Article: Update Bundler on AWS Elastic Beanstalk

...