Overview
In this article, you will learn how to install the Kaholo Agents.
Native Installation
You can either use the npm or npm and pm2.
Follow the steps below to install Kaholo Agent on your machine:
Step 1: Install Node.js LTS
For Windows OS, we recommend using Choco. Instructions on Choco can be found on this link: https://chocolatey.org/install.
After installing Choco, run this:
choco install nodejs-lts |
For any other OS, follow the Node.js instructions using this link. Remember to use LTS.
pm2 installation (optional)
If you wish to use PM2 (advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, microservice management, etc.), run the installation command below:
npm install pm2 -g |
Step 2: Install pm2 and clone Kaholo-agent
Use the command below to clone the Kaholo Agent.
git clone -b kaholo/5.0.6 https://github.com/Kaholo/kaholo-agent.git
cd kaholo-agent |
Step 3: Configuration File
Options | Description |
---|---|
SERVER_URL | The URL of the Kaholo server that you want to connect to. |
AGENT_KEY | A unique random 64 characters to identify this specific agent. |
AGENT_NAME | A unique random 64 characters to identify this specific agent. |
AMQP_URI_ACTIONS | The URI of the RabbitMQ that you want to connect to. |
AMQP_URI_RESULTS | The URI of the RabbitMQ that you want to connect to. |
AMQP_RESULT_QUEUE | Actions/Execution/TwiddlebugResult |
Fill out all the fields and save the .conf file.
Example .conf file could look like this:
SERVER_URL=http://165.30.00.11:3000 AGENT_KEY=2Pt2VPJ8UKBrjttLOBBeAuUKBrjttLOBBBBeAuUKBrjttLOBB AGENT_NAME=NtZYMzZaB6dFfTODS2hI03VqNtZYMzZaB6dFfTODS2hI03Vq AMQP_URI_ACTIONS=amqp://twiddlebugs:twiddlebugs@65.30.00.11:5672/actions AMQP_URI_RESULTS=amqp://twiddlebugs:twiddlebugs@65.30.00.11:5672/results AMQP_RESULT_QUEUE=Action/Execution/TwiddlebugResult |
Step 4: Run the Agent
After installing the Kaholo Agent, try a test run to see if it was successfully installed.
From the agent directory, run:
sudo npm install --production sudo npm run start |
or use this command if you prefer to use pm2:
sudo pm2 start app.js --name kaholo-agent |
Known Native Installation Issues
The pm2 environment is conservative and when you run a new process, the new environment variables will not be updated into the existing process. This commonly affects native installations on Windows machines.
To resolve the outdated environment variables issue, you need to restart the agent using this command:
sudo pm2 restart kaholo-agent --update-env |