DRAFT SPACE - APPDYNAMICS INTERNAL ONLY

On this page:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
47 rates

Application environments are increasingly dynamic. For example, in AWS or Rackspace hosted environments, an administrator can bring up or take down nodes quickly due to workload or other factors. The result is a environment where there can be many short-lived JVMs.  

AppDynamics recommends the following practices when monitoring Java applications in dynamic environments:

  1. Ensure that the App Agents can reach your Controller. Particularly if your Controller operates on-premises while the agents run on hosted servers, you need to ensure that the agents can access the Controller through the firewalls in your environment.

  2. Enable Node Name Reuse on the agent. This ensures that the node name (with a specified node-name prefix) gets reused for each new instance of the JVM.
    Depending on the nature of your environment, it might not make sense to track each JVM instance as a distinct node in AppDynamics. This can result in a boundless set of separate nodes for the same JVM. This usually does not best reflect the logical model of the environment.  

  3. Mark nodes as Historical immediately upon shutdown. This ensures that the node name is available for reuse immediately after the node is shut down. If this setting is not enabled, the Controller marks a node as historical after 20 days of inactivity. The node must be marked historical before the node name can be reused.

Enable Node Name Reuse

You can configure AppDynamics to reuse node names for these types of environments. With node name reuse enabled, after a node is shut down and marked as historical in AppDynamics, the name of the node becomes available for reuse in subsequently registered nodes. You can also specify a node name prefix when reusing node names to indicate the association between all concurrently running JVMs for the dynamic application. 

To configure the agent for this environment, set the following properties:  

When enabled, the Controller manages name assignments for the agents. It forms node names by appending a sequentially incremented number as the suffix to the prefix you specify. Be sure to avoid specifying the node name using any other mechanism (such as in controller-info.xml file or via a system property).

The following listing shows sample settings for the properties as they may appear in a startup script:

-Dappdynamics.agent.reuse.nodeName=true
-Dappdynamics.agent.reuse.nodeName.prefix=CloudActivator_

When you have enabled reuse node name, the Java Agent logs to standard output after starting up and before registration with the Controller. To troubleshoot agent registration failure, you may want the log files to be written to a file instead.

To configure the agent to write logs to a file, edit the log4j-unknown.xml at <agent_home>/<version_number>/conf/logging and uncomment the AgentLog Appender, as follows:

<!-- To log files to an "unknown" folder before the agent registers 
                          with the Controller, uncomment the line below -->
<appender-ref ref="AgentLogAppender"/>

This change causes the log files of an agent prior to registration to be written to a directory named "unknown" rather than standard output.   

Mark Dynamic Nodes as Historical at Shutdown

If a node has been out of contact with the Controller for a certain amount of time, the Controller marks the node as historical and suspends certain types of processing activities. See Historical and Disconnected Nodes.

In a dynamic environment, it is usually good practice for mark nodes as historical upon shutdown. This immediately frees up the node name (with node name reuse enabled) for any new instance of the JVM. You can use one of the following methods to have a node marked as historical:

  • Set the following system property at JVM startup:
    ‑Dappdynamics.jvm.shutdown.mark.node.as.historical=true
  • Set the following property in app-agent-config.xml to true, as shown:

    <app-agent-configuration>
       ...
       <configuration-properties>
          ...
          <property name="appdynamics.jvm.shutdown.mark.node.as.historical" value="true"/>

You can also invoke the mark-nodes-historical resource in the AppDynamics REST API to declare a set of nodes historical to the Controller.