软件包放置说明

软件包放置仅需在server1节点执行。

  1. 在server1创建目录“/opt/prometheus”,并下载表2要求的Go、Node、Prometheus、Node Exporter、Grafana等软件安装包,放置于该目录下。

    1
    2
    3
    4
    5
    6
    7
    mkdir -p /opt/prometheus
    cd /opt/prometheus
    wget --no-check-certificate https://go.dev/dl/go1.22.2.linux-arm64.tar.gz
    wget --no-check-certificate https://cdn.npmmirror.com/binaries/node/v19.9.0/node-v19.9.0-linux-arm64.tar.xz
    wget --no-check-certificate https://github.com/prometheus/prometheus/releases/download/v2.45.4/prometheus-2.45.4.linux-arm64.tar.gz
    wget --no-check-certificate https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-arm64.tar.gz
    wget --no-check-certificate https://dl.grafana.com/enterprise/release/grafana-enterprise-10.4.2.linux-arm64.tar.gz
    
    下载完成后目录“/opt/prometheus/”下将包含如下压缩包。
    go1.22.2.linux-arm64.tar.gz
    grafana-enterprise-10.4.2.linux-arm64.tar.gz
    node_exporter-1.7.0.linux-arm64.tar.gz
    node-v19.9.0-linux-arm64.tar.xz
    prometheus-2.45.4.linux-arm64.tar.gz

  2. 将所有压缩包解压。

    tar -zxvf go1.22.2.linux-arm64.tar.gz
    tar -zxvf grafana-enterprise-10.4.2.linux-arm64.tar.gz
    tar -zxvf node_exporter-1.7.0.linux-arm64.tar.gz
    tar -xvf node-v19.9.0-linux-arm64.tar.xz
    tar -zxvf  prometheus-2.45.4.linux-arm64.tar.gz

    解压后包含如下目录。

    1
    2
    3
    4
    5
    go
    grafana-v10.4.2
    node_exporter-1.7.0.linux-arm64
    node-v19.9.0-linux-arm64
    prometheus-2.45.4.linux-arm64
    

  3. “/opt/prometheus/”目录下Go、Node Exporter、Node安装目录复制到其他节点的“/opt/prometheus/”目录下,其他节点若无该目录请先创建。

    #目录列表
    node_exporter-1.7.0.linux-arm64
    node-v19.9.0-linux-arm64
    go
    #复制到其他节点
    scp -r node_exporter-1.7.0.linux-arm64 node-v19.9.0-linux-arm64 go agent1:/opt/prometheus/
    scp -r node_exporter-1.7.0.linux-arm64 node-v19.9.0-linux-arm64 go agent2:/opt/prometheus/
    scp -r node_exporter-1.7.0.linux-arm64 node-v19.9.0-linux-arm64 go agent3:/opt/prometheus/