On this page:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
49 rates
This page walks you through deploying a simple example application using a script provided by AppDynamics. The script takes care of the housekeeping needed to deploy with Elastic Beanstalk.

To continue, you must have

After you complete this demo, the next step is to deploy manually rather than running the script. See Deploying applications manually.

Choose monitoring and debugging options

Depending on the Controller you intend to use for monitoring, you can monitor the example application

  • with or without Analytics
  • if monitoring with Analytics, with or without Server Visibility enabled

Decide which scenario suits your purposes. Then, use the table below to identify the corresponding tutorial target directory. Later on, you will need to know this directory path.

 

AnalyticsServer VisibilityTutorial Target Directory
nonoaws-elasticbeanstalk/java
noyesaws-elasticbeanstalk/java-machine
yesyes OR noaws-elasticbeanstalk/java-machine-analytics

 

Finally, decide whether or not to SSH into the EC2 instance on which the application runs. Development, test, and staging environments require this technique more often than production environments.

Create a VPC and a Key Pair

In the AWS console:

  • Create a Virtual Private Cloud (VPC), or decide which pre-existing VPC to use.
    • Unless using the default VPC, note the ID of your chosen VPC.

If you want to SSH into EC2 instances:

  • Create a Key Pair, or decide which pre-existing Key Pair to use. 
    • Note the name of your chosen Key Pair.

Construct the test.sh command

To deploy applications with Elastic Beanstalk, you need to know the variable settings for every AppDynamics Agent your application needs. This tutorial uses the Java Agent only, which keeps the list of required settings short.

In a text editor, create a string that begins with ./test.sh

Append the script options and environment variable settings to the command string, as described in the table below. See the example command string below the table.

The completed string is your test.sh command.

Script optionEnvironment variableNotes
-c <APPDYNAMICS_CONTROLLER_HOST_NAME>
  • Fully-qualified domain name for the AppDynamics Controller with which you intend to monitor your application
-p <APPDYNAMICS_CONTROLLER_PORT>
  • Primary port used by the monitoring AppDynamics Controller
  • Default is 8090
-K<APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY>
  • the Controller under Settings > License > Account
-E

<APPDYNAMICS_ANALYTICS_EVENT_ENDPOINT>

  • Include only if your Controller has Analytics
  • Tells the Analytics plugin the target URL for the Events Service
  • The Analytics plugin sends data to the Events Service, not the Controller
-g

<APPDYNAMICS_AGENT_GLOBAL_ACCOUNT_NAME>

  • Include only if your Controller has Analytics
  • In the Controller under Settings > License > Account
-s

<APPDYNAMICS_SIM_ENABLED>

-r <REGION>
  • Must be the code for the region shown in your AWS console.
  • For example, if the console shows Ohio, the code is us-east-2
-a

<APP_NAME>

  • Name of your choice for the example application
-e <ENV_NAME>
  • Name of your choice, for the new environment that the script creates
-b

<BASE_DIR>

  • Specifies where on the local filesystem the script should copy the Sample App, after cloning it from GitHub
-k

<KEY>

  • Include only if you want to use eb ssh 
  • eb ssh allows you to log into the EC2 instance on which the script deploys the app
  • For the value, use the name of your chosen Key Pair
-i <INSTANCE>
  • Optional—if not specified, AWS uses a default
  • Must be t2.small or larger for this demo to run properly

The simplest possible test.sh command (no Analytics, no Server Visibility, no SSH) might look something like this:

./test.sh -c master-saas-controller.example.com -p 8090 -K <your-secret-key> -r us-east-2 -a tutorialapp -e tutorialenv -b /Users/exampleperson/aws-elasticbeanstalk/java -i t2.small

A note about security

Do not use the procedure as described here, with your secret key entered at the command line in plain text, in a production environment.

It may or may not be considered acceptable even for testing, depending on practices at your organization. See Best Practices for Managing AWS Access Keys.

Set up the demo and the CLI

All file paths in these examples begin with the home directory, designated by the ~ character. Replace the ~ with whatever filesystem location you prefer.

In a terminal:

  • Git clone the demo repo
  • cd into the tutorial target directory as described above.
  • (Optional) Create a virtual environment.
  • Install eb.

Run the demo script

In a terminal, still in the tutorial target directory.

  • Run the following command: cd testing
  • Run your test.sh command.
    • When prompted, provide options you omitted from the command, if any.

Verify that the EC2 Node is Registered with the Controller

In the Controller, you should see the example application under Applications.

Verify that the Application is Running in the Cloud

In the Elastic Beanstalk console, you should see the example application under All Applications and the environment you named at launch.

  • Click the URL (at bottom right in the screenshot above).
    • The Spring Music example application should open in a browser.

  • Use the +  button to add albums to the web page.
    • This is required to generate load for AppDynamics to monitor.

Monitor your Cloud Application with AppDynamics

You should be able to view the example in the Flow Map, and (if applicable) Analytics Agent and/or Server Visibility screens.

Deploying applications manually

See

 

 

 

  • No labels