4 minute read
You can install the Edge Delta agent on a Linux-based operating system.
Step 1: Create a Configuration and Download the Agent
Select the Linux template option while following these steps:
- In the Edge Delta App, click Data Pipeline, and then click Agent Configs.
- Click Create Configuration.
- Select the appropriate template.
- Specify a tag to identify the agent and environment.
- Click Create Configuration.
- Optionally, modify and test the agent configuration then click Save Edits or Done.
The agent table is updated with a new agent configuration with the agent tag you specified.
Next you copy the API key:
- Locate the newly created configuration in the table, click the vertical green ellipses, and then click Deploy Instructions.
- Click Linux.
- Copy the command. This window also displays your API key. Copy this key for a later step.
Step 2: Install the Agent
There are 2 ways to install the agent:
- Option 1: Standard Installation: With this option, you will install the agent via cURL in a bash script. This installation is the standard and recommended way to install the agent.
- Option 2: Offline Installation: With this option, you will not use cURL in a bash script on your production environment. You can use this installation method if you have security concerns.
Option 1: Standard Installation
Open a terminal, use sudo and paste the command you copied from the Edge Delta Deployment Instructions. The command includes the API key, in the following example it is 12345.
sudo ED_API_KEY=12345 bash -c "$(curl -L https://release.edgedelta.com/release/install.sh)"
The installation process will deploy Edge Delta into the
/opt/edgedelta/agent/ path. Additionally, the
edgedelta system service will start automatically with default configurations.
The ED_ENV_VARS special variable can be used in the installation command to pass one or more persistent environment variables to the agent, which will run as the system service. To view a full list of variables that the agent supports, see Environment Variables.
sudo ED_API_KEY=12345 \ ED_ENV_VARS="MY_VAR1=MY_VALUE_1,MY_VAR2=MY_VALUE_2" \ bash -c "$(curl -L https://release.edgedelta.com/release/install.sh)"
The https://release.edgedelta.com/release/install.sh release package:
- Detects your architecture and operating system, and then
- Chooses and downloads the latest version of the agent self-extracting script, which includes the content to be extracted at the end of the script.
The script’s content and extractable scripts are available for inspection at https://release.edgedelta.com/release/install.sh.To check the package’s integrity, the script header will extract commands and content checksum. The script will fail if the content has been tempered with. For example, the
If the package has not been tempered with, the script will:
- Extract the agent into a temporary directory,
- Set the apikey file with the given ED_API_KEY environment variable, and then
- Run unix_install.sh.
This command will copy the content to /opt/edgedelta/agent/and then run the following commands to install edgedelta as a system service and start the service:
- ./edgedelta -s install
- ./edgedelta -s start
Option 2: Offline Installation
- Follow the steps outlined in Option 1 in a non-production machine with the same architecture and OS as the target production machine.
- Compress the agent folder:
sudo tar -czvf agent_archive.tgz /opt/edgedelta
agent_archive.tgzto the target machine via SSH or other means.
- Extract the archive under /opt/edgedelta:
sudo tar -xzvf agent_archive.tgz -C /
- Install and start the service:
sudo cd /opt/edgedelta/agent/
sudo ./edgedelta -s install
sudo ./edgedelta -s start
Step 3: Set Memory Limits for the Agent (Optional)
If the edgedelta service reaches its memory limits, then the edgedelta service will restart. If you notice that the service restarts frequently, then you may want to increase the limits. If you do not want to change your memory limits, then you can enable memory profiling and contact support with a heapdump from the profiler. To learn more, see Troubleshoot Memory Limits.
When you set memory limits, a backup file ( .bak ) of the edgedelta.service will be created in case you need to revert your changes.
This command sets memory limits to 500MB for physical and 3GB for virtual:
sed -i.bak 's/^\[Service\]/\[Service\]\nMemoryLimit=500M\nMemorySwapMax=3G/g' /etc/systemd/system/edgedelta.service
YOu can verify that the limits are enabled:
memory.limit_in_bytes displays the physical memory limit.
memory.memsw.limit_in_bytes displays the virtual memory limit.
Upgrade the Agent
To upgrade the agent, you must run the installation command that you previously used to first deploy the agent.
This action will cause the agent to restart (essentially reinstall).
The upgrade process will take 30 seconds or less to complete.
Uninstall the Agent
The following script can uninstall the agent as the root user:
#!/bin/bash set -uex BITS=$(getconf LONG_BIT) if [ "$BITS" == "32" ]; then echo "This script does not support 32 bit OS. Contact email@example.com" fi echo "Removing agent service" sudo /opt/edgedelta/agent/edgedelta -s uninstall echo "Removing agent folder" sudo rm -rf /opt/edgedelta/agent/ echo "Done"