User Tools

Site Tools


wiki:ai:onboarding_nvidia_servers_running_ubuntu_linux_how-to

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:ai:onboarding_nvidia_servers_running_ubuntu_linux_how-to [2026/05/14 12:54] – created smadanagopalwiki:ai:onboarding_nvidia_servers_running_ubuntu_linux_how-to [2026/05/15 11:46] (current) smadanagopal
Line 204: Line 204:
 sudo dpkg -i /tmp/datadog-agent_<arch>.deb sudo dpkg -i /tmp/datadog-agent_<arch>.deb
 </code> </code>
 +
 +<note>**Note:** ''dpkg -i'' installs only the package itself. It does **not** add the Datadog APT repository or GPG key. This means ''apt upgrade'' will not find future Agent updates. To enable managed updates, complete the steps below after the initial install.</note>
 +
 +=== 5.4.1 Adding the GPG Key and APT Repository (Post-dpkg Setup) ===
 +
 +Run these commands on the air-gapped server to register the Datadog repository for future ''apt''-based updates. The GPG keyring file must be transferred from a connected machine alongside the ''.deb'' package.
 +
 +**On the connected machine — download the GPG keyring:**
 +
 +<code bash>
 +curl -fsSL https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public \
 +  | gpg --dearmor -o datadog-keyring.gpg
 +
 +# Transfer to target server alongside the .deb:
 +scp datadog-keyring.gpg user@<SERVER_IP>:/tmp/
 +</code>
 +
 +**On the air-gapped server — install the key and add the repository:**
 +
 +<code bash>
 +# Install the GPG keyring
 +sudo mv /tmp/datadog-keyring.gpg /usr/share/keyrings/datadog-archive-keyring.gpg
 +sudo chmod 644 /usr/share/keyrings/datadog-archive-keyring.gpg
 +
 +# Add the APT repository entry
 +echo "deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] \
 +  https://apt.datadoghq.com/ stable 7" \
 +  | sudo tee /etc/apt/sources.list.d/datadog.list
 +</code>
 +
 +Future updates (once connectivity is available or via an internal mirror) will be handled by ''sudo apt update && sudo apt install datadog-agent''.
 +
 +=== 5.4.2 Post-Install Configuration (datadog.yaml) ===
 +
 +When using ''dpkg -i'' directly, the installer script does **not** auto-populate ''/etc/datadog-agent/datadog.yaml''. You must configure it manually before starting the Agent.
 +
 +<code bash>
 +# Copy the example config as the working config
 +sudo cp /etc/datadog-agent/datadog.yaml.example /etc/datadog-agent/datadog.yaml
 +
 +# Set your API key
 +sudo sed -i 's/# api_key:.*/api_key: <YOUR_DD_API_KEY>/' /etc/datadog-agent/datadog.yaml
 +
 +# Set your Datadog site (default is datadoghq.com)
 +sudo sed -i 's/# site:.*/site: datadoghq.com/' /etc/datadog-agent/datadog.yaml
 +
 +# (Optional) Set a custom hostname
 +sudo sed -i 's/# hostname:.*/hostname: <YOUR_HOSTNAME>/' /etc/datadog-agent/datadog.yaml
 +
 +# Set correct ownership
 +sudo chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml
 +
 +# Enable and start the Agent
 +sudo systemctl enable datadog-agent
 +sudo systemctl start datadog-agent
 +</code>
 +
 +Verify the Agent is reporting correctly:
 +
 +<code bash>
 +sudo datadog-agent status
 +</code>
 +
 +=== 5.4.3 Recovery from Failed Installation ===
 +
 +If the installation partially fails or the Agent is misconfigured and non-functional, follow these steps to restore a clean state before retrying.
 +
 +**Step 1 — Stop and disable the Agent service (if it started):**
 +
 +<code bash>
 +sudo systemctl stop datadog-agent
 +sudo systemctl disable datadog-agent
 +</code>
 +
 +**Step 2 — Remove the package while preserving config (for diagnosis):**
 +
 +<code bash>
 +sudo dpkg -r datadog-agent
 +</code>
 +
 +Or, for a full purge including config files:
 +
 +<code bash>
 +sudo dpkg --purge datadog-agent
 +</code>
 +
 +**Step 3 — Remove residual files left outside the package manifest:**
 +
 +<code bash>
 +sudo rm -rf /etc/datadog-agent /var/log/datadog /opt/datadog-agent /run/datadog-agent
 +sudo userdel dd-agent 2>/dev/null; sudo groupdel dd-agent 2>/dev/null
 +</code>
 +
 +**Step 4 — Clear the APT state (if the repository was partially added):**
 +
 +<code bash>
 +sudo rm -f /etc/apt/sources.list.d/datadog.list
 +sudo rm -f /usr/share/keyrings/datadog-archive-keyring.gpg
 +sudo apt update
 +</code>
 +
 +**Step 5 — Reinstall.** Return to section 5.4 and repeat the download-and-install steps, or use the one-line installer (section 6) if internet access has become available.
 +
 +<note tip>Before purging, copy ''/etc/datadog-agent/'' to a backup location. If the failure was a config issue rather than a package issue, you may be able to restore the backup config after a clean reinstall rather than reconstructing it from scratch.</note>
  
 ---- ----
wiki/ai/onboarding_nvidia_servers_running_ubuntu_linux_how-to.1778763272.txt.gz · Last modified: by smadanagopal