Alinode
Preparation
The application that needs to be accessed is to be deployed in an independent service acquisition cloud environment and can access Internet services.
create service
first step
Log in to Alibaba Cloud and click to activate the service of Alibaba Cloud's Node.js Performance Platform.
Second step
Create a new app, get the App ID and App Secret.
Install monitoring dependencies
first step
Install the components required by the Node.js Performance Platform
# Install the version management tool tnvm, please refer to the installation process error: https://github.com/aliyun-node/tnvm
$ wget -O- https://raw.githubusercontent.com/aliyun-node/tnvm/master/install.sh | bash
$ source ~/.bashrc
# tnvm ls-remote alinode # View the required version
$ tnvm install alinode-v6.5.0 # Install the required version
$ tnvm use alinode-v6.5.0 # use the required version
$ npm install @alicloud/agenthub -g # install agenthub
There are three parts
- Install tnvm (alinode source)
- Use tnvm to install alinode (replace the default node)
- Install the data collector required by alinode
After the installation is complete, you can check it, you need to make sure that .tnvm
is included in the path of which node
and which agenthub
.
$ which node
/root/.tnvm/versions/alinode/v3.11.4/bin/node
$ which agenthub
/root/.tnvm/versions/alinode/v3.11.4/bin/agenthub
Save the App ID
and App Secret
obtained in Create a new application
as yourconfig.json
as shown below. For example, in the project root directory.
{
"appid": "****",
"secret": "****",
}
Start the plugin:
agenthub start yourconfig.json
start node service
In the installed server, when starting the Node service, you need to add the ENABLE_NODE_LOG=YES environment variable.
for example:
$ NODE_ENV=production ENABLE_NODE_LOG=YES node bootstrap.js
Docker container approach
For the method of docker container, please refer to document.
other
For more information, please refer to the documentation of the Alibaba Cloud Node.js Performance Platform.