在 Linux 上安装 Grafana Alloy
您可以在 Linux 上将 Alloy 安装为 systemd 服务。
准备工作
默认情况下,某些基于 Debian 的云虚拟机未安装 GPG。要在 Linux 虚拟机中安装 GPG,请在终端窗口中运行以下命令。
sudo apt install gpg安装
要在 Linux 上安装 Alloy,请在终端窗口中运行以下命令。
导入 GPG 密钥并添加 Grafana 软件包仓库。
sudo mkdir -p /etc/apt/keyrings/ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.listwget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key echo -e '[grafana]\nname=grafana\nbaseurl=https://rpm.grafana.com\nrepo_gpgcheck=1\nenabled=1\ngpgcheck=1\ngpgkey=https://rpm.grafana.com/gpg.key\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt' | sudo tee /etc/yum.repos.d/grafana.repowget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key sudo zypper addrepo https://rpm.grafana.com grafana更新仓库。
sudo apt-get updateyum updatesudo zypper update安装 Alloy。
sudo apt-get install alloysudo dnf install alloysudo zypper -r grafana install alloy
卸载
要在 Linux 上卸载 Alloy,请在终端窗口中运行以下命令。
停止 Alloy 的 systemd 服务。
sudo systemctl stop alloy卸载 Alloy。
sudo apt-get remove alloysudo dnf remove alloysudo zypper remove alloy可选:移除 Grafana 仓库。
sudo rm -i /etc/apt/sources.list.d/grafana.listsudo rm -i /etc/yum.repos.d/rpm.grafana.reposudo zypper removerepo grafana



