This page describes how to configure multiple Node.js Agents on a machine to share a single, multi-tenant Java proxy.
Configure a Shared Proxy
Stop the Node.js application.
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:
When you upgrade the Node.js Agent, you may want to create these directories automatically.
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:
Ensure that each agent that reports to the multi-tenant proxy is configured with a unique node name.
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.
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.