玩客云Armbian 23.8.1 Bullseye安装Prometheus&Grafana

Welcome to Armbian 23.8.1 Bullseye with bleeding edge Linux 6.4.13-edge-meson

Monitoring – How to install Prometheus/Grafana on arm – Raspberry PI/Rock64 | Blogs (mytinydc.com)

How to Run Prometheus on a Raspberry Pi – How to Raspberry

Ubuntu and Debian(ARMv7)SHA256: 8fa847587f482ea06b077c8791e3fc350b1fa012349c1e476e178f4a9ad7a6fb
sudo apt-get install -y adduser libfontconfig1 musl
wget https://dl.grafana.com/enterprise/release/grafana-enterprise_9.3.16_armhf.deb
sudo dpkg -i grafana-enterprise_9.3.16_armhf.deb


 

prometheus
参考
Monitoring – How to install Prometheus/Grafana on arm – Raspberry PI/Rock64 | Blogs (mytinydc.com)

cd /usr/local/src

wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-armv7.tar.gz

tar xfz prometheus-2.6.0.linux-armv7.tar.gz
rm prometheus-2.6.6.0.linux-armv7.tar.gz
cd prometheus-2.6.6.0.linux-armv7/

ln -s prometheus-2.6.6.0.linux-armv7 prometheus

vi prometheus.yml

global:# Default is every 1 minute.
   scrape_configs:
  # server prometheus listens on TCP/9090
  - job_name:'prometheus'.
         #metrics_path defaults to "/metrics
         #scheme defaults to "http".
      static_configs:
        - targets: ['localhost:9090']

  # Exporters: client servers
  - job_name:'nodes'.
     scrape_interval: 1m # Override the default global interval for this job
     scrape_timeout: 10s # Override the default global timeout for this job
     static_configs:
     - targets: ['localhost:9100']





cat prometheus.yml
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
  # Exporters: client servers
  - job_name: 'nodes'
    static_configs:
    - targets: ['localhost:9100']



或者
 cat prometheus.yml
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
  # Exporters: client servers
  - job_name: 'nodes'
    scrape_interval: 1m # Override the default global interval for this job
    scrape_timeout: 10s # Override the default global timeout for this job
    static_configs:
    - targets: ['localhost:9100']




nohup ./prometheus &
或者
nohup /usr/local/src/prometheus-2.6.0.linux-armv7/prometheus &
或者
cat /etc/profile.d/prometheus.sh 
#!/bin/bash
cd /usr/local/src/prometheus-2.6.0.linux-armv7/ && nohup ./prometheus & 

node_exporter

wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-armv7.tar.gz

node_exporter.service

cd /usr/local/src

ln -s node_exporter-0.17.0.linux-armv7/ node_exporter

cat /etc/systemd/system/node_exporter.service
[Unit]
Description=node_export
Documentation=https://github.com/prometheus/node_exporter

[Service]
ExecStart=/usr/local/src/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable node_exporter.service --now

ip:9090/targets

ip:9100

ip:3000

admin

默认密码admin,进去先改密码

8919

11074

 


多主机

cd /usr/local/src

wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-386.tar.gz

tar zxvf tar zxvf node_exporter-1.8.2.linux-386.tar.gz ln -s node_exporter-1.8.2.linux-386/ node_exporter


 

cat /etc/systemd/system/node_exporter.service
[Unit]
Description=node_export
Documentation=https://github.com/prometheus/node_exporter
 
[Service]
ExecStart=/usr/local/src/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target

systemctl daemon-reload && systemctl enable node_exporter.service --now

cat /usr/local/src/prometheus.yml
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
  # Exporters: client servers
  - job_name: 'nodes'
    scrape_interval: 1m # Override the default global interval for this job
    scrape_timeout: 10s # Override the default global timeout for this job
    static_configs:
      - targets: ['localhost:9100','192.168.1.97:9100']

server端重启Prometheus,重启node_exporter

grafana模板使用8919

开机启动Prometheus 

cd /etc/profile.d
cat prometheus.sh 
#!/bin/bash
cd /usr/local/src/prometheus-2.6.0.linux-armv7/ && nohup ./prometheus &

<think>好的,我现在需要帮助用户解决关于客云设备刷入Armbian系统后更换软件源的问题。首先,我需要确认用户的需求。用户已经成功刷入Armbian,现在想更换软件源,可能因为默认源速度慢或不可用,想换成国内镜像源,比如清华源、阿里云等。 接下来,我应该回想更换软件源的一般步骤。对于基于Debian的系统,通常是修改`/etc/apt/sources.list`文件,替换里面的仓库地址。Armbian作为Debian的衍生版,应该也是类似的方法。但可能需要确认具体的版本代号,比如buster、bullseye等,因为不同版本对应的源不同。 然后,用户可能需要具体的操作步骤。首先备份原文件,防止出错。然后使用sed命令或者nano编辑器替换源。同时,还要考虑是否需要更新软件列表,执行`apt update`。可能还需要更换其他源,比如Docker源或Python源,但用户的问题主要集中在软件源,也就是APT源。 另外,用户可能遇到的问题包括:权限不足,需要使用sudo;编辑器不熟悉,推荐使用nano;替换源后出现错误,如何排查;或者版本不匹配导致的问题。这些可能需要给出相应的解决建议。 需要确保提供的命令准确无误,比如正确的sed替换命令,正确的镜像源URL。例如,清华源的地址是否正确,是否支持Armbian的架构(armhf或arm64)。可能需要检查清华源或其他镜像源的官方文档,确认支持情况。 此外,用户可能需要验证是否更换成功,比如执行更新后没有错误,或者速度有明显提升。还可以建议用户测试安装软件包是否正常。 最后,生成相关问题,可能涉及如何安装特定软件、优化系统性能、配置中文环境等,这些是用户可能接下来会问的问题。 总结步骤: 1. 备份原sources.list 2. 替换为国内镜像源 3. 更新软件列表 4. 处理可能的问题,如版本代号错误、网络问题等 需要注意使用中文回答,行内公式用$...$,独立公式用$$...$$,但这个问题可能不太涉及数学公式,更多是命令行操作。但要确保LaTeX语法正确,如果有代码块的话用反引号包裹。 现在组织回答,确保结构清晰,分步骤说明,并提供验证方法和常见问题解决。同时,添加相关问题,帮助用户进一步了解。</think>### 客云Armbian更换软件源教程 #### 步骤说明 1. **连接设备** 通过SSH登录客云Armbian系统,例如: ```bash ssh root@设备IP地址 ``` 2. **备份原软件源** ```bash sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. **替换为国内镜像源** 使用以下命令替换默认源(以清华源为例,适用于Debian 11 "bullseye"版本): ```bash sudo sed -i 's@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list ``` 4. **更新软件列表** ```bash sudo apt update ``` 5. **验证更新** 若输出显示从清华源拉取数据且无报错,则更换成功。 #### 常见问题解决 - **版本不匹配** 使用`lsb_release -a`查看系统版本,替换命令中的`bullseye`为实际版本代号[^1]。 - **网络连接失败** 检查`ping mirrors.tuna.tsinghua.edu.cn`是否通顺,或尝试其他镜像源(如阿里云、中科大)。 #### 其他镜像源配置 - **阿里云源** ```bash sudo sed -i 's@http://deb.debian.org@https://mirrors.aliyun.com@g' /etc/apt/sources.list ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值