This page describes how to configure multiple Node.js Agents on a machine to share a single, multi-tenant Java proxy.

The Node.js Agent no longer supports the proxy as of version 21.9.

Configure a Shared Proxy

  1. Stop the Node.js application.
  2. Create directories for the agent and the agent logs and for the proxy control directory. The permissions on this directory must be readable and executable by the application user that the application and writable by the proxy user. 
    For example:

    mkdir /tmp/appd /tmp/appd/logs /tmp/appd/proxy_ctrl_dir
    CODE

    When you upgrade the Node.js Agent, you may want to create these directories automatically. 

  3. Disable automatic proxy launching for each agent. In the AppDynamics require.profile() block, set proxyAutolaunchDisabled to true and set the proxyCtrlDir to the directory that you created. 
    For example:

    ...
    proxyAutolaunchDisabled: true,
    proxyCtrlDir: '/tmp/appd/proxy_ctrl_dir',
    ...
    CODE
  4. Ensure that each agent that reports to the multi-tenant proxy is configured with a unique node name.

  5. Before you start the agents, start the shared Java proxy and pass the agent control directory from the proxyCommunicationDir argument to the runproxy script. AppDynamics recommends that you configure the proxy to start on system startup. See Start the Proxy Manually for Node.js.
  6. Restart the Node.js application. The nodes should appear in the Controller UI flow maps in a couple minutes.

Proxy Sharing Limits

By default, a single proxy can handle up to ten agents. If you need to run more, you will have to adjust the maxHeapSize and maxPermSize settings in the runproxy script.

When adding agents, use debug mode and monitor the proxy.out file, which indicates whether the proxy is running out of heap. The file is visible when running in debug mode.