From a70c6d9934d8f23b2fe2f09529359e21c54123d2 Mon Sep 17 00:00:00 2001 From: wtifs Date: Thu, 1 Aug 2024 14:55:17 +0800 Subject: [PATCH] feat: add notes about curl/prometheus --- Work/curl.md | 6 ++++++ Work/prometheus.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Work/curl.md create mode 100644 Work/prometheus.md diff --git a/Work/curl.md b/Work/curl.md new file mode 100644 index 0000000..1f37064 --- /dev/null +++ b/Work/curl.md @@ -0,0 +1,6 @@ +POST JSON + +```bash +curl -H "Content-type: application/json" -X POST -d "{}" +``` + diff --git a/Work/prometheus.md b/Work/prometheus.md new file mode 100644 index 0000000..32fef21 --- /dev/null +++ b/Work/prometheus.md @@ -0,0 +1,39 @@ +##### 安装 + +```go +mkdir -p /data/lib && cd /data/lib + +wget https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz + +tar -xvf prometheus-2.41.0.linux-amd64.tar.gz +rm -f prometheus-2.41.0.linux-amd64.tar.gz +cd prometheus-2.41.0.linux-amd64/ + +vim start.sh + +pkill -f prometheus +sleep 1 +./prometheus --web.enable-admin-api --storage.tsdb.retention.time=24h & + +chmod +x start.sh +sh start.sh + +# grafana 账密: admin/admin +yum install docker +systemctl start docker +docker run -d --net=host grafana/grafana:latest +``` + + + + + +##### 设置数据最大生命周期 + +默认为 15天,最小为 2h + +```--storage.tsdb.retention.time=1y +# 启动时增加以下参数: +--storage.tsdb.retention.time=1y +``` +