lighthouse
1、文档地址
https://lighthouse-book.sigmaprime.io/installation-binaries.html
2、安装
$ cd ~
$ curl -LO https://github.com/sigp/lighthouse/releases/download/v2.5.1/lighthouse-v2.5.1-x86_64-unknown-linux-gnu.tar.gz
-------------------------
解压
$ tar xvf lighthouse-v2.5.1-x86_64-unknown-linux-gnu.tar.gz
-------------------------
启动--bn + 导入验证器
$ /usr/local/bin/lighthouse bn --network goerli account validator import --directory $HOME/staking-deposit-cli/validator_keys --datadir /var/lib/lighthouse
也可以单独使用
$ /usr/local/bin/lighthouse bn --network goerli
--directory : 验证器位置
--datadir : 导入后文件位置,可以不写, 默认在 /root/.lighthouse
-------------------------
启动--vc
$ /usr/local/bin/lighthouse vc --network goerli --datadir /var/lib/lighthouse
--datadir : 导入后文件位置,可以不写, 默认在 /root/.lighthouse 和上面的bn位置对应
Prometheuse
1、下载地址
2、安装
$ cd ~
$ curl -LO https://github.com/prometheus/prometheus/releases/download/v2.37.0/prometheus-2.37.0.linux-amd64.tar.gz
下载完成后解压到 user/local/bin
$ tar xvf prometheus-2.37.0.linux-amd64.tar.gz
$ sudo cp prometheus-2.37.0.linux-amd64/prometheus /usr/local/bin/
$ sudo cp prometheus-2.37.0.linux-amd64/promtool /usr/local/bin/
移动
$ sudo cp -r prometheus-2.37.0.linux-amd64/consoles /etc/prometheus
$ sudo cp -r prometheus-2.37.0.linux-amd64/console_libraries /etc/prometheus
3、配置文件
$ sudo vim /etc/prometheus/prometheus.yml
可以修改,如果你只有geth钱包,就只写
- job_name: geth
------------------------------------------------------
global:
scrape_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
- job_name: node_exporter
static_configs:
- targets:
- localhost:9100
- job_name: lighthouse-bn
metrics_path: /metrics
static_configs:
- targets:
- localhost:5052
- job_name: besu
metrics_path: /metrics
static_configs:
- targets:
- localhost:9545
- job_name: erigon
metrics_path: /debug/metrics/prometheus
static_configs:
- targets:
- localhost:6060
- job_name: geth
metrics_path: /debug/metrics/prometheus
static_configs:
- targets:
- localhost:6060
- job_name: nethermind
static_configs:
- targets:
- localhost:9091
4、配置权限
$ sudo vim /etc/systemd/system/prometheus.service
--------------------------------------------------------------------------
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=root---这里如果自己配置权限组的话就修改
Group=root
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.target
--------------------------------------------------------------------------
启动
$ sudo systemctl daemon-reload
$ sudo systemctl start prometheus
$ sudo systemctl status prometheus
--------------------------------------------------------------------------
服务自启动-------
$ sudo systemctl enable prometheus
Prometheuse Node Exporter
1、git 地址
2、安装
$ cd ~
$ curl -LO https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
--------------------------------------------------------------------------
解压
$ tar xvf node_exporter-1.3.1.linux-amd64.tar.gz
$ sudo cp node_exporter-1.3.1.linux-amd64/node_exporter /usr/local/bin
--------------------------------------------------------------------------
3、配置文件
配置service 服务
$ sudo vim /etc/systemd/system/node_exporter.service
--------------------------------------------------------------------------
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=root ---这里可以配置组,不想用root的话
Group=root
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
--------------------------------------------------------------------------
启动
$ sudo systemctl daemon-reload
$ sudo systemctl start node_exporter
$ sudo systemctl status node_exporter
使用日志输出检查错误
$ sudo journalctl -fu node_exporter
配置自启动
$ sudo systemctl enable node_exporter