-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add notes about curl/prometheus
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
POST JSON | ||
|
||
```bash | ||
curl -H "Content-type: application/json" -X POST -d "{}" | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
|