Edge Delta on Linux

Installing the Edge Delta Fleet on Linux.

Overview

You can install the Edge Delta fleet on a Linux-based operating system. These instructions are applicable to any Linux installations, including bare metal and virtualized setups

Release Package

The https://release.edgedelta.com/release/install.sh release package:

  1. Detects your architecture and operating system, and then
  2. Chooses and downloads the latest version of the Fleet self-extracting script, which includes the content to be extracted at the end of the script.

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 v0.1.19/edgedelta-linux-amd64.shheader includes: CRCsum="1944320463" MD5="a98b537444f18d97a06b428b9cb223ce"

If the package has not been tempered with, the script will:

  1. Extract the Fleet into a temporary directory,
  2. Set the apikey file with the given ED_API_KEY environment variable, and then
  3. Run unix_install.sh

The unix_install.sh command will copy the contents to /opt/edgedelta/agent/, run the following commands to install Edge Delta as a system service, and start the service: ./edgedelta -s install ./edgedelta -s start

Standard Installation

Select the Linux template option while following these steps and execute the command with sudo:

  1. Click Pipelines.
  2. Click New Fleet.
  3. Select Edge Fleet.
  4. Optionally, expand Advanced Fleet Configuration and select a pipeline with a configuration you want to duplicate.
  5. Click Continue.
  6. Select the appropriate template and click Continue.
  7. Specify a name to identify the Fleet.
  8. Click Generate Config.
  9. Execute the installation commands, they include the unique ID for the Fleet.
  10. Expand the namespaces and select the input sources you want to monitor.
  11. Select the Destination Outputs you want to send processed data to, such as the Edge Delta Observability Platform.
  12. Click Continue.
  13. Click View Dashboard.

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 Fleet, which will run as the system service. To view a full list of variables that the fleet 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)"

Install in a Custom Path

You can use the ED_INSTALL_PATH environment variable to install the agent in a custom path rather than the default path. Add the environment variable to the installation instructions provided by the Edge Delta app, for example:

sudo ED_API_KEY=12345 ED_INSTALL_PATH="/opt/custom/edgedelta/agent" bash -c "$(curl -L https://release.edgedelta.com/release/install.sh)"

SELinux Configuration in Enforcing Mode

To ensure compatibility with SELinux in enforcing mode, apply the following commands after the standard installation:

sudo semanage fcontext -a -t bin_t -f f /opt/edgedelta/agent/edgedelta
sudo restorecon -v /opt/edgedelta/agent/edgedelta
sudo systemctl restart edgedelta.service

(Alternative) Offline Installation

Instead of the Standard Installation, you can use an offline installation method. With this option, you do note need to use curl in a bash script on your production environment.

  1. Follow the steps for a Standard Installation on a non-production machine with the same architecture and OS as the target production machine.
  2. Compress the agent folder:
sudo tar -czvf agent_archive.tgz /opt/edgedelta
  1. Copy agent_archive.tgz to the target machine via SSH or other means.
  2. Extract the archive under /opt/edgedelta:
sudo tar -xzvf agent_archive.tgz -C /
  1. Install and start the service:
sudo cd /opt/edgedelta/agent/
sudo ./edgedelta -s install
sudo ./edgedelta -s start

Set Memory Limits for the Fleet (Optional)

If the edgedelta service reaches its memory limits it will restart. If you notice that the service restarts frequently, you can increase the limits. If you do not want to change your memory limits, 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.

cat /sys/fs/cgroup/memory/system.slice/edgedelta.service/memory.limit_in_bytes

memory.memsw.limit_in_bytes displays the virtual memory limit.

cat /sys/fs/cgroup/memory/system.slice/edgedelta.service/memory.memsw.limit_in_bytes

Upgrade the Fleet

To upgrade the Fleet, you can run the installation command that you previously used to first deploy the Fleet. A best practice is to uninstall the fleet completely before installing a new version but in most instances this is not required.

Uninstall the Fleet

The following script uninstalls the fleet as the root user:

#!/bin/bash
set -uex

# Set the default installation path
install_path="/opt/edgedelta/agent"

# Check and update for any custom installation path
if [[ ! -z "${ED_INSTALL_PATH:-}" ]]; then
  install_path="$ED_INSTALL_PATH"
fi

# Verify the architecture is supported
BITS=$(getconf LONG_BIT)
if [ "$BITS" == "32" ]; then
  echo "This script does not support 32-bit OS. Contact info@edgedelta.com"
  exit 1
fi

echo "Stopping agent service if it is running"
if sudo $install_path/edgedelta -s stop; then
  echo "Agent service stopped successfully."
else
  echo "Failed to stop agent service or it was not running."
fi

echo "Removing agent service if it is installed"
if sudo $install_path/edgedelta -s uninstall; then
  echo "Agent service uninstalled successfully."
else
  echo "Failed to uninstall agent service or it was not installed."
fi

# Remove the installation directory
echo "Removing edgedelta folder"
if sudo rm -rf "$install_path"; then
  echo "Successfully removed the edgedelta directory."
else
  echo "Failed to remove the edgedelta directory. Manual inspection may be required."
fi

# Get the directory where the script was executed
script_dir=$(pwd)

# Remove lingering installer files from the script's directory
echo "Checking and removing lingering installer files"
for file in $script_dir/edgedelta-linux-*.sh; do
  if [ -f "$file" ]; then
    rm -f "$file"
    echo "Removed lingering installer file: $file"
  fi
done

# Remove leftover configuration and log directories
echo "Checking and removing leftover configuration files in /etc"
sudo find /etc -name '*edgedelta*' -exec rm -rf '{}' +

echo "Checking and removing leftover logs in /var/log"
sudo find /var/log -name '*edgedelta*' -exec rm -rf '{}' +

# Additional checks for other typical directories
echo "Checking and removing leftover files in /usr/local/etc, if any"
sudo find /usr/local/etc -name '*edgedelta*' -exec rm -rf '{}' + 2>/dev/null || true

echo "Checking and removing leftover files in /usr/local/var, if any"
sudo find /usr/local/var -name '*edgedelta*' -exec rm -rf '{}' + 2>/dev/null || true

# Verify no processes are still running
process_check=$(ps aux | grep '[e]dgedelta' | grep -v 'uninstall_edgedelta.sh' || true)
if [ -n "$process_check" ]; then
  echo "Warning: The following Edge Delta processes are still running:"
  echo "$process_check"
else
  echo "No running Edge Delta processes detected."
fi

echo "Edge Delta agent and all related components have been removed."

Script Functions

This Linux uninstallation script performs the following actions:

  1. Setting Defaults: Assumes the default installation path as /opt/edgedelta/agent.
  2. Check System Architecture: Ensures the OS is 64-bit, as 32-bit systems are not supported.
  3. Stop and Uninstall the Service: Attempts to stop and uninstall the Edge Delta service if it exists.
  4. Remove Installation Directory: Deletes the /opt/edgedelta/agent directory.
  5. Dynamic Path Handling: Uses the current working directory to locate and remove any lingering installer script, such as edgedelta-linux-amd64.sh.
  6. Configuration and Log Cleanup: Searches common directories (/etc, /var/log, etc.) for any remaining Edge Delta configuration and log files, removing them if found.
  7. Process Verification: Confirms no Edge Delta processes remain running after uninstallation.

Running the Script

  1. Navigate to the Directory: Open the directory where you executed the install command, which contains the edgedelta-linux-amd64.sh file.
  2. Save the Script: Save the uninstall script using a suitable name, such as uninstall_edgedelta.sh.
  3. Make the Script Executable:
chmod +x uninstall_edgedelta.sh
  1. Execute the Script:
sudo ./uninstall_edgedelta.sh

Or if you set an ED_INSTALL_PATH environment variable during installation, used a custom path:

sudo ED_INSTALL_PATH="/opt/custom/edgedelta/agent" ./uninstall_script.sh

Manual Uninstall Commands

To uninstall manually, execute the following commands one at a time in the same folder used to install the agent:

  1. Stop the Edge Delta Agent Service:
sudo /opt/edgedelta/agent/edgedelta -s stop
  1. Uninstall the Edge Delta Agent Service:
sudo /opt/edgedelta/agent/edgedelta -s uninstall
  1. Remove the Installation Directory:
sudo rm -rf /opt/edgedelta/agent
  1. Remove any Installer Files:
    • Use the path where the installer was downloaded:
rm -f edgedelta-linux-amd64.sh
  1. Clean Up Configuration and Log Files:
sudo find /etc -name '*edgedelta*' -exec rm -rf '{}' +
sudo find /var/log -name '*edgedelta*' -exec rm -rf '{}' +
sudo find /usr/local/etc -name '*edgedelta*' -exec rm -rf '{}' + 2>/dev/null || true
sudo find /usr/local/var -name '*edgedelta*' -exec rm -rf '{}' + 2>/dev/null || true
  1. Verify No Processes are Running:
ps aux | grep '[e]dgedelta'

If any processes appear (other than the grep command itself), you can kill them using:

sudo kill <PID>

Replace <PID> with the actual Process ID(s) of any Edge Delta processes listed. This process ensures thorough removal of Edge Delta components from a Linux system.