cf850A

本文介绍了一种算法,用于判断五维空间中的点是否为“好点”。通过计算不同点之间的角度来确定是否存在急性角,从而判断点的好坏,并提供了一个具体的实现示例。

http://www.elijahqi.win/archives/678
A. Five Dimensional Points
time limit per test
2 seconds

memory limit per test
256 megabytes

input
standard input

output
standard output

You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.

We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vectors and is acute (i.e. strictly less than ). Otherwise, the point is called good.

The angle between vectors and in 5-dimensional space is defined as , where is the scalar product and is length of .

Given the list of points, print the indices of the good points in ascending order.

Input
The first line of input contains a single integer n (1 ≤ n ≤ 103) — the number of points.

The next n lines of input contain five integers ai, bi, ci, di, ei (|ai|, |bi|, |ci|, |di|, |ei| ≤ 103) — the coordinates of the i-th point. All points are distinct.

Output
First, print a single integer k — the number of good points.

Then, print k integers, each on their own line — the indices of the good points in ascending order.

Examples
input
6
0 0 0 0 0
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
output
1
1
input
3
0 0 1 2 0
0 0 9 2 0
0 0 5 9 0
output
0
Note
In the first sample, the first point forms exactly a angle with all other pairs of points, so it is good.

In the second sample, along the cd plane, we can see the points look as follows:

We can see that all angles here are acute, so no points are good.

我们可以知道如果90°的时候应该是最大满足条件,举个例子,二维,在四个坐标系上,正好四个

推广到k维,最多有2*k个。就本题而言,最多10个点能满足题意。也就是说n如果>=12,是一定不满足题意的,直接输出0即可。剩下的情况n很小,可以直接暴力O(n3)判断。

在评论中看到的一个想法,跟大家分享一下:算出两两点之间的连线的长度,找到最小的那条线段,记作ab,则好点一定出自a,b。其他点一定都是坏点。为什么呢?首先,如果另一点c和a,b构成了三角形abc,则小边对小角,角C一定是不大于60°的,也就是说c一定是坏点。另一种情况,a,b,c三点一线,因为ab是最短的,所以c一定在a,b同侧,所以c还是个坏点。综上,除了a,b以外的点都是坏点。我们只需判断a,b是否是好点即可。

#include<cstdio>
#include<cmath>
inline int read(){
    int x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
    while (ch<='9'&&ch>='0'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int top,q[15],p[15][6];
inline double calc(int x,int y,int z){
    int x1[6],x2[6];
    for (int i=1;i<=5;++i) x1[i]=p[y][i]-p[x][i];
    for (int i=1;i<=5;++i) x2[i]=p[z][i]-p[x][i];
    double len1=0,len2=0;
    for (int i=1;i<=5;++i) len1+=x1[i]*x1[i];len1=sqrt(len1);
    for (int i=1;i<=5;++i) len2+=x2[i]*x2[i];len1=sqrt(len2);
    int ans=0;
    for (int i=1;i<=5;++i) ans+=x1[i]*x2[i];
    return ans/(len1*len2);
}
int n;
int main(){
    freopen("cfc.in","r",stdin);
    n=read();
    if (n>11){printf("0");return 0;}
    for (int i=1;i<=n;++i) 
        for (int j=1;j<=5;++j) p[i][j]=read();
    bool flag;
    for (int i=1;i<=n;++i){
        flag=true;
        for (int j=1;j<=n;++j){
            if (i==j) continue;
            for (int z=1;z<=n;++z){
                if (j==z) continue;if (i==z) continue;
                if (calc(i,j,z)>0) {
                    flag=false;break;
                }
            }
            if (flag==false) break;
        }
        if (flag) q[++top]=i;
    }
    printf("%d\n",top);
    for (int i=1;i<=top;++i) printf("%d\n",q[i]);
    return 0;
}
// ---------------------------------------------------------------------------- // PolicyConfig.h // Undocumented COM-interface IPolicyConfig. // Use for set default audio render endpoint // @author EreTIk // ---------------------------------------------------------------------------- #pragma once interface DECLSPEC_UUID("f8679f50-850a-41cf-9c72-430f290290c8") IPolicyConfig; class DECLSPEC_UUID("870af99c-171d-4f9e-af0d-e63df40c2bc9") CPolicyConfigClient; // ---------------------------------------------------------------------------- // class CPolicyConfigClient // {870af99c-171d-4f9e-af0d-e63df40c2bc9} // // interface IPolicyConfig // {f8679f50-850a-41cf-9c72-430f290290c8} // // Query interface: // CComPtr<IPolicyConfig> PolicyConfig; // PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigClient)); // // @compatible: Windows 7 and Later // ---------------------------------------------------------------------------- interface IPolicyConfig : public IUnknown { public: virtual HRESULT GetMixFormat( PCWSTR, WAVEFORMATEX** ); virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat( PCWSTR, INT, WAVEFORMATEX** ); virtual HRESULT STDMETHODCALLTYPE ResetDeviceFormat( PCWSTR ); virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat( PCWSTR, WAVEFORMATEX*, WAVEFORMATEX* ); virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod( PCWSTR, INT, PINT64, PINT64 ); virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod( PCWSTR, PINT64 ); virtual HRESULT STDMETHODCALLTYPE GetShareMode( PCWSTR, struct DeviceShareMode* ); virtual HRESULT STDMETHODCALLTYPE SetShareMode( PCWSTR, struct DeviceShareMode* ); virtual HRESULT STDMETHODCALLTYPE GetPropertyValue( PCWSTR, const PROPERTYKEY&, PROPVARIANT* ); virtual HRESULT STDMETHODCALLTYPE SetPropertyValue( PCWSTR, const PROPERTYKEY&, PROPVARIANT* ); virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint( __in PCWSTR wszDeviceId, __in ERole eRole ); virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility( PCWSTR, INT ); }; interface DECLSPEC_UUID("568b9108-44bf-40b4-9006-86afe5b5a620") IPolicyConfigVista; class DECLSPEC_UUID("294935CE-F637-4E7C-A41B-AB255460B862") CPolicyConfigVistaClient; // ---------------------------------------------------------------------------- // class CPolicyConfigVistaClient // {294935CE-F637-4E7C-A41B-AB255460B862} // // interface IPolicyConfigVista // {568b9108-44bf-40b4-9006-86afe5b5a620} // // Query interface: // CComPtr<IPolicyConfigVista> PolicyConfig; // PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigVistaClient)); // // @compatible: Windows Vista and Later // ---------------------------------------------------------------------------- interface IPolicyConfigVista : public IUnknown { public: virtual HRESULT GetMixFormat( PCWSTR, WAVEFORMATEX** ); // not available on Windows 7, use method from IPolicyConfig virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat( PCWSTR, INT, WAVEFORMATEX** ); virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat( PCWSTR, WAVEFORMATEX*, WAVEFORMATEX* ); virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod( PCWSTR, INT, PINT64, PINT64 ); // not available on Windows 7, use method from IPolicyConfig virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod( PCWSTR, PINT64 ); // not available on Windows 7, use method from IPolicyConfig virtual HRESULT STDMETHODCALLTYPE GetShareMode( PCWSTR, struct DeviceShareMode* ); // not available on Windows 7, use method from IPolicyConfig virtual HRESULT STDMETHODCALLTYPE SetShareMode( PCWSTR, struct DeviceShareMode* ); // not available on Windows 7, use method from IPolicyConfig virtual HRESULT STDMETHODCALLTYPE GetPropertyValue( PCWSTR, const PROPERTYKEY&, PROPVARIANT* ); virtual HRESULT STDMETHODCALLTYPE SetPropertyValue( PCWSTR, const PROPERTYKEY&, PROPVARIANT* ); virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint( __in PCWSTR wszDeviceId, __in ERole eRole ); virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility( PCWSTR, INT ); // not available on Windows 7, use method from IPolicyConfig };转换为qt下可用
09-17
Xshell 8 (Build 0082) Copyright (c) 2024 NetSarang Computer, Inc. All rights reserved. Type `help' to learn how to use Xshell prompt. [C:\~]$ Connecting to 192.168.200.131:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. Last login: Wed Aug 27 04:37:33 2025 from 192.168.200.1 [yywz@localhost ~]$ su root 密码: [root@localhost yywz]# docker-compose up -d Creating network "yywz_default" with the default driver Pulling nginx (nginx:alpine)... ERROR: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) [root@localhost yywz]# sudo systemctl daemon-reload [root@localhost yywz]# sudo systemctl restart docker [root@localhost yywz]# docker-compose up -d Pulling nginx (nginx:alpine)... ERROR: Get "https://registry-1.docker.io/v2/": dial tcp 128.242.240.20:443: i/o timeout [root@localhost yywz]# sudo mkdir -p /etc/docker [root@localhost yywz]# sudo tee /etc/docker/daemon.json <<-'EOF' > { > "registry-mirrors": [ > "https://hub-mirror.c.163.com", > "https://mirror.baidubce.com", > "https://docker.mirrors.ustc.edu.cn", > "https://registry.docker-cn.com" > ], > "insecure-registries": [], > "debug": false > } > EOF { "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://mirror.baidubce.com", "https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com" ], "insecure-registries": [], "debug": false } [root@localhost yywz]# docker-compose up -d Pulling nginx (nginx:alpine)... ERROR: Get "https://registry-1.docker.io/v2/": dial tcp 108.160.170.39:443: i/o timeout [root@localhost yywz]# cat /etc/docker/daemon.json { "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://mirror.baidubce.com", "https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com" ], "insecure-registries": [], "debug": false } [root@localhost yywz]# systemctl restart docker.service [root@localhost yywz]# docker-compose up -d Pulling nginx (nginx:alpine)... ERROR: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) [root@localhost yywz]# sudo tee /etc/docker/daemon.json <<-'EOF' > { > "registry-mirrors": [ > "https://docker.211678.top", > "https://docker.1panel.live", > "https://hub.rat.dev", > "https://docker.m.daocloud.io", > "https://do.nark.eu.org", > "https://dockerpull.com", > "https://dockerproxy.cn", > "https://docker.awsl9527.cn" > ] > } > EOF { "registry-mirrors": [ "https://docker.211678.top", "https://docker.1panel.live", "https://hub.rat.dev", "https://docker.m.daocloud.io", "https://do.nark.eu.org", "https://dockerpull.com", "https://dockerproxy.cn", "https://docker.awsl9527.cn" ] } [root@localhost yywz]# sudo systemctl daemon-reload [root@localhost yywz]# systemctl restart docker.service [root@localhost yywz]# docker-compose up -d Pulling nginx (nginx:alpine)... alpine: Pulling from library/nginx 9824c27679d3: Pull complete 6bc572a340ec: Pull complete 403e3f251637: Pull complete 9adfbae99cb7: Pull complete 7a8a46741e18: Pull complete c9ebe2ff2d2c: Pull complete a992fbc61ecc: Pull complete cb1ff4086f82: Pull complete Digest: sha256:42a516af16b852e33b7682d5ef8acbd5d13fe08fecadc7ed98605ba5e3b26ab8 Status: Downloaded newer image for nginx:alpine Pulling redis (redis:alpine)... alpine: Pulling from library/redis 9824c27679d3: Already exists 9880d81ff87a: Pull complete 168694ef5d62: Pull complete f8eab6d4856e: Pull complete 1f79dac8d2d4: Pull complete 4f4fb700ef54: Pull complete 61cfb50eeff3: Pull complete Digest: sha256:987c376c727652f99625c7d205a1cba3cb2c53b92b0b62aade2bd48ee1593232 Status: Downloaded newer image for redis:alpine Creating yywz_nginx_1 ... done Creating yywz_redis_1 ... done [root@localhost yywz]# docker -v Docker version 20.10.24, build 297e128 [root@localhost yywz]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/docker.service.d └─timeout.conf Active: active (running) since 三 2025-08-27 15:14:00 CST; 4min 56s ago Docs: https://docs.docker.com Main PID: 9737 (dockerd) Tasks: 46 Memory: 138.6M CGroup: /system.slice/docker.service ├─ 9737 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock ├─10144 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.19.0.2 -... ├─10151 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -container-ip 172.19.0.2 -conta... ├─10170 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6379 -container-ip 172.19.0.3... └─10178 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6379 -container-ip 172.19.0.3 -con... 8月 27 15:14:00 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:00.853107542+08:00" level=inf....24 8月 27 15:14:00 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:00.853240645+08:00" level=inf...on" 8月 27 15:14:00 localhost.localdomain systemd[1]: Started Docker Application Container Engine. 8月 27 15:14:00 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:00.891163395+08:00" level=inf...ck" 8月 27 15:14:20 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:20.265981649+08:00" level=war...ut" 8月 27 15:14:20 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:20.266117106+08:00" level=inf...ut" 8月 27 15:14:49 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:49.034510681+08:00" level=war...ut" 8月 27 15:14:49 localhost.localdomain dockerd[9737]: time="2025-08-27T15:14:49.034659945+08:00" level=inf...ut" 8月 27 15:15:01 localhost.localdomain dockerd[9737]: time="2025-08-27T15:15:01+08:00" level=info msg="Fir...ng" 8月 27 15:15:01 localhost.localdomain dockerd[9737]: time="2025-08-27T15:15:01+08:00" level=info msg="Fir...ng" Hint: Some lines were ellipsized, use -l to show in full. [root@localhost yywz]# /opt bash: /opt: 是一个目录 [root@localhost yywz]# cd /opt [root@localhost opt]# ll 总用量 178812 -rw-r--r--. 1 root root 129115976 3月 13 15:23 boot.bak0.bz2 drwxr-xr-x. 2 root root 4096 3月 17 17:08 bt drwx--x--x 4 root root 4096 8月 19 19:23 containerd drwxr-xr-x. 2 root root 4096 2月 23 2025 mysql drwxr-xr-x 6 prometheus prometheus 4096 8月 17 21:55 prometheus drwxr-xr-x. 2 root root 4096 10月 31 2018 rh -rw-------. 1 root root 53949998 7月 14 2023 VMwareTools-10.3.26-22085142.tar.gz drwxr-xr-x. 8 root root 4096 7月 14 2023 vmware-tools-distrib drwxr-xr-x. 2 root root 4096 3月 17 14:11 webmin [root@localhost opt]# mkdir /data mkdir: 无法创建目录"/data": 文件已存在 [root@localhost opt]# ls -l 总用量 178812 -rw-r--r--. 1 root root 129115976 3月 13 15:23 boot.bak0.bz2 drwxr-xr-x. 2 root root 4096 3月 17 17:08 bt drwx--x--x 4 root root 4096 8月 19 19:23 containerd drwxr-xr-x. 2 root root 4096 2月 23 2025 mysql drwxr-xr-x 6 prometheus prometheus 4096 8月 17 21:55 prometheus drwxr-xr-x. 2 root root 4096 10月 31 2018 rh -rw-------. 1 root root 53949998 7月 14 2023 VMwareTools-10.3.26-22085142.tar.gz drwxr-xr-x. 8 root root 4096 7月 14 2023 vmware-tools-distrib drwxr-xr-x. 2 root root 4096 3月 17 14:11 webmin [root@localhost opt]# cd /data [root@localhost data]# git clone https://gitee.com/inge365/docker-prometheus.git fatal: 目标路径 'docker-prometheus' 已经存在,并且不是一个空目录。 [root@localhost data]# cd /docker-prometheus bash: cd: /docker-prometheus: 没有那个文件或目录 [root@localhost data]# cd docker-prometheus/ [root@localhost docker-prometheus]# docker-compose up -d Pulling alertmanager (prom/alertmanager:v0.25.0)... v0.25.0: Pulling from prom/alertmanager b08a0a826235: Pull complete d71d159599c3: Pull complete 05d21abf0535: Pull complete c4dc43cc8685: Pull complete aff850a11e31: Pull complete 6c477a8cc220: Pull complete Digest: sha256:fd4d9a3dd1fd0125108417be21be917f19cc76262347086509a0d43f29b80e98 Status: Downloaded newer image for prom/alertmanager:v0.25.0 Pulling cadvisor (google/cadvisor:latest)... latest: Pulling from google/cadvisor ff3a5c916c92: Pull complete 44a45bb65cdf: Pull complete 0bbe1a2fe2a6: Pull complete Digest: sha256:815386ebbe9a3490f38785ab11bda34ec8dacf4634af77b8912832d4f85dca04 Status: Downloaded newer image for google/cadvisor:latest Pulling node_exporter (prom/node-exporter:v1.5.0)... v1.5.0: Pulling from prom/node-exporter 22b70bddd3ac: Pull complete 5c12815fee55: Pull complete c0e87333d380: Pull complete Digest: sha256:39c642b2b337e38c18e80266fb14383754178202f40103646337722a594d984c Status: Downloaded newer image for prom/node-exporter:v1.5.0 Pulling prometheus (prom/prometheus:v2.37.6)... v2.37.6: Pulling from prom/prometheus 4399114b4c59: Pull complete 225de5a6f1e7: Pull complete d4fec713b49e: Pull complete 7ae184732db2: Pull complete fee9b37b7eaa: Pull complete 7bc64fbe5ac4: Pull complete c5808d9b102a: Pull complete 25611bd629bf: Pull complete e30138ae4e40: Pull complete f68b4ae50d77: Pull complete a8143b4a94e9: Pull complete 72c09123b9ad: Pull complete Digest: sha256:92ceb93400dd4c887c76685d258bd75b9dcfe3419b71932821e9dcc70288d851 Status: Downloaded newer image for prom/prometheus:v2.37.6 Pulling grafana (grafana/grafana:9.4.3)... 9.4.3: Pulling from grafana/grafana 895e193edb51: Pull complete a3e3778621b5: Pull complete e7cf2c69b927: Pull complete df40c119df08: Pull complete 3b29ea6a27af: Pull complete 3997cd619520: Pull complete 7e759f975aac: Pull complete ff133072f235: Pull complete f9a56094a361: Pull complete Digest: sha256:76dcf36e7d2a4110c2387c1ad6e4641068dc78d7780da516d5d666d1e4623ac5 Status: Downloaded newer image for grafana/grafana:9.4.3 Creating node-exporter ... Creating node-exporter ... error Creating alertmanager ... WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (ff6e14ace4a34f23421c16fb36497c92f47b4f6e68d3828dcb78f425f136bcec): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use Creating alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on e Creating cadvisor ... done proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (ff6e14ace4a34f23421c16fb36497c92f47b4f6e68d3828dcb78f425f136bcec): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (4c3949c57c7cd56926e99a458f84213040813ef5e50b04931f8e017814b69e6e): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# systemctl daemon-reload [root@localhost docker-prometheus]# [root@localhost docker-prometheus]# systemctl restart docker [root@localhost docker-prometheus]# systemctl stop firewalld [root@localhost docker-prometheus]# docker-compose up -d Starting node-exporter ... cadvisor is up-to-date Starting alertmanager ... Starting alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (655a075b63ca30d8feb55e2af3a0d90588987435d9c9e32c6d9ee74cd6da8bd2): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9093 -j DNAT --to-destination 172.18.0.3:9093 ! -i br-a6445a378290: iptables: No chain/target/match by that name. Starting node-exporter ... error WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (98bbc9308f4f561c30990777d9c07d253d0b3637ab40c49b9d3e5dd65e7ff2b3): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9100 -j DNAT --to-destination 172.18.0.4:9100 ! -i br-a6445a378290: iptables: No chain/target/match by that name. (exit status 1)) ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (655a075b63ca30d8feb55e2af3a0d90588987435d9c9e32c6d9ee74cd6da8bd2): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9093 -j DNAT --to-destination 172.18.0.3:9093 ! -i br-a6445a378290: iptables: No chain/target/match by that name. (exit status 1)) ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (98bbc9308f4f561c30990777d9c07d253d0b3637ab40c49b9d3e5dd65e7ff2b3): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9100 -j DNAT --to-destination 172.18.0.4:9100 ! -i br-a6445a378290: iptables: No chain/target/match by that name. (exit status 1)) ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# sudo systemctl restart docker [root@localhost docker-prometheus]# sudo systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/docker.service.d └─timeout.conf Active: active (running) since 三 2025-08-27 15:33:16 CST; 9s ago Docs: https://docs.docker.com Main PID: 12886 (dockerd) Tasks: 50 Memory: 33.9M CGroup: /system.slice/docker.service ├─12886 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock ├─13070 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6379 -container-ip 172.19.0.2... ├─13078 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6379 -container-ip 172.19.0.2 -con... ├─13119 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.19.0.3 -... └─13127 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -container-ip 172.19.0.3 -conta... 8月 27 15:33:14 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:14.743661358+08:00" level=in...rpc 8月 27 15:33:14 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:14.743680704+08:00" level=in...rpc 8月 27 15:33:14 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:14.763313066+08:00" level=in...y2" 8月 27 15:33:14 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:14.788019065+08:00" level=in...t." 8月 27 15:33:15 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:15.126541080+08:00" level=in...ss" 8月 27 15:33:16 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:16.049410152+08:00" level=in...e." 8月 27 15:33:16 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:16.087290259+08:00" level=in....24 8月 27 15:33:16 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:16.087475600+08:00" level=in...on" 8月 27 15:33:16 localhost.localdomain systemd[1]: Started Docker Application Container Engine. 8月 27 15:33:16 localhost.localdomain dockerd[12886]: time="2025-08-27T15:33:16.115125408+08:00" level=in...ck" Hint: Some lines were ellipsized, use -l to show in full. [root@localhost docker-prometheus]# sudo iptables -t nat -F [root@localhost docker-prometheus]# sudo iptables -t filter -F [root@localhost docker-prometheus]# sudo systemctl restart docker [root@localhost docker-prometheus]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3daac002ffaa google/cadvisor:latest "/usr/bin/cadvisor -…" 4 minutes ago Up 16 seconds 8080/tcp cadvisor fd2c63d29ec1 nginx:alpine "/docker-entrypoint.…" 19 minutes ago Up 16 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp yywz_nginx_1 cd603ef0e887 redis:alpine "docker-entrypoint.s…" 19 minutes ago Up 16 seconds 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp yywz_redis_1 [root@localhost docker-prometheus]# docker rm fd2c63d29ec1 Error response from daemon: You cannot remove a running container fd2c63d29ec116234c94487a17d6ea75d784d0cfd22b7e0d467cbab518258347. Stop the container before attempting removal or force remove [root@localhost docker-prometheus]# docker stop fd2c63d29ec1 fd2c63d29ec1 [root@localhost docker-prometheus]# docker rm fd2c63d29ec1 fd2c63d29ec1 [root@localhost docker-prometheus]# docker stop cd603ef0e887 cd603ef0e887 [root@localhost docker-prometheus]# docker rm cd603ef0e887 cd603ef0e887 [root@localhost docker-prometheus]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3daac002ffaa google/cadvisor:latest "/usr/bin/cadvisor -…" 6 minutes ago Up 2 minutes 8080/tcp cadvisor [root@localhost docker-prometheus]# docker stop 3daac002ffaa 3daac002ffaa [root@localhost docker-prometheus]# docker rm 3daac002ffaa 3daac002ffaa [root@localhost docker-prometheus]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@localhost docker-prometheus]# docker-compose up -d Starting node-exporter ... Starting alertmanager ... Starting alertmanager ... error WARNING: Host is already in use by another container ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on e Starting node-exporter ... error proxy: listen tcp4 0.0.0.0:9093: bind: address already in use WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (d918c84a550f7b946d78470572034217e4fb96b010e7e4af0b0999844abd017f): Error starting userl Creating cadvisor ... done ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (a307f195dd99a59726f03ce9fd5b6ae8b2ae07e0551548c3247604349183d622): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (d918c84a550f7b946d78470572034217e4fb96b010e7e4af0b0999844abd017f): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# sudo systemctl restart docker [root@localhost docker-prometheus]# docker-compose up -d cadvisor is up-to-date Starting node-exporter ... Starting node-exporter ... error WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (ae6db99f5f30989777bab25b89dbd620f2056a872aa85661bb8aad45032d5302): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use Starting alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (17965ccc2adb43b6158e5ddd99dd13ac17c869625c0daed3e6099ba7177f8650): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (ae6db99f5f30989777bab25b89dbd620f2056a872aa85661bb8aad45032d5302): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (17965ccc2adb43b6158e5ddd99dd13ac17c869625c0daed3e6099ba7177f8650): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# docker system prune -f Deleted Containers: 7f52ab012fe533dab192615c8d057fbc3c9305774241bdf3c49d226b858d6523 8b45998c395e05165e680ee482791a34a6287da38f18afe9c748d60e0600c45a Deleted Networks: yywz_default Total reclaimed space: 0B [root@localhost docker-prometheus]# docker-compose down Stopping cadvisor ... done Removing cadvisor ... done Removing network docker-prometheus_monitoring [root@localhost docker-prometheus]# docker-compose up -d Creating network "docker-prometheus_monitoring" with driver "bridge" Creating node-exporter ... Creating node-exporter ... error Creating cadvisor ... WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (f0abf54c178140c02db6497198b8cdd574c77323fdce7217292efd2df1b09080): Error starting userl Creating alertmanager ... error WARNING: Host is already in use by another container ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (b86c6f893b30deb2e189aba9a1a9ca972401f43bba55d8e4eb8796780e658bc1): Error starting userland Creating cadvisor ... done ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (f0abf54c178140c02db6497198b8cdd574c77323fdce7217292efd2df1b09080): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (b86c6f893b30deb2e189aba9a1a9ca972401f43bba55d8e4eb8796780e658bc1): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# docker-compose logs alertmanager Attaching to alertmanager [root@localhost docker-prometheus]# docker-compose logs node-exporter ERROR: No such service: node-exporter [root@localhost docker-prometheus]# systemctl daemon-reload [root@localhost docker-prometheus]# sudo systemctl restart docker [root@localhost docker-prometheus]# sudo systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/docker.service.d └─timeout.conf Active: active (running) since 三 2025-08-27 15:40:36 CST; 10s ago Docs: https://docs.docker.com Main PID: 16222 (dockerd) Tasks: 14 Memory: 27.6M CGroup: /system.slice/docker.service └─16222 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock 8月 27 15:40:35 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:35.582025207+08:00" level=in...rpc 8月 27 15:40:35 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:35.582038622+08:00" level=in...rpc 8月 27 15:40:35 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:35.599443534+08:00" level=in...y2" 8月 27 15:40:35 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:35.611122282+08:00" level=in...t." 8月 27 15:40:35 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:35.853104234+08:00" level=in...ss" 8月 27 15:40:36 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:36.461289460+08:00" level=in...e." 8月 27 15:40:36 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:36.495281733+08:00" level=in....24 8月 27 15:40:36 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:36.495461424+08:00" level=in...on" 8月 27 15:40:36 localhost.localdomain systemd[1]: Started Docker Application Container Engine. 8月 27 15:40:36 localhost.localdomain dockerd[16222]: time="2025-08-27T15:40:36.527032657+08:00" level=in...ck" Hint: Some lines were ellipsized, use -l to show in full. [root@localhost docker-prometheus]# docker-compose up -d Starting alertmanager ... Starting node-exporter ... Starting alertmanager ... error WARNING: Host is already in use by another container ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (8417fe6ebd4c207f2db52a925bdd7f5924c9d48f1f15d67907df06996b445fdf): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use Starting node-exporter ... error ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (8641cb448c49665ec95b7dcbdc39c78cf0f47f54ad56a6da4fac5898c1778489): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (8417fe6ebd4c207f2db52a925bdd7f5924c9d48f1f15d67907df06996b445fdf): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (8641cb448c49665ec95b7dcbdc39c78cf0f47f54ad56a6da4fac5898c1778489): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# vim docker-compose.yml [root@localhost docker-prometheus]# sudo lsof -i :9093 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME alertmana 1161 prometheus 7u IPv6 31306 0t0 TCP *:copycat (LISTEN) [root@localhost docker-prometheus]# docker ps --format "table {{.Names}}\t{{.Ports}}" NAMES PORTS cadvisor 8080/tcp [root@localhost docker-prometheus]# docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" | grep -E "(9093|9100)" [root@localhost docker-prometheus]# docker-compose up -d Starting alertmanager ... cadvisor is up-to-date Starting alertmanager ... error WARNING: Host is already in use by another container ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (c9acbc4520a2f9ab5b40b5936c3b61071c8acb445dbd858c2b126d3dcf9e101f): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use Starting node-exporter ... error ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (f46135cd7dc0aa34069a7b825c8ad09a691c6a40f429f7714a2f052f14d348d6): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (c9acbc4520a2f9ab5b40b5936c3b61071c8acb445dbd858c2b126d3dcf9e101f): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (f46135cd7dc0aa34069a7b825c8ad09a691c6a40f429f7714a2f052f14d348d6): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# sudo lsof -ti:9093 1161 [root@localhost docker-prometheus]# sudo lsof -ti:9100 714 1167 [root@localhost docker-prometheus]# udo kill -9 714 bash: udo: 未找到命令... [root@localhost docker-prometheus]# udo kill -9 <714> bash: 未预期的符号 `714' 附近有语法错误 [root@localhost docker-prometheus]# sudo kill -9 <1167> bash: 未预期的符号 `1167' 附近有语法错误 [root@localhost docker-prometheus]# sudo kill -9 1167 [root@localhost docker-prometheus]# sudo kill -9 1161 [root@localhost docker-prometheus]# sudo kill -9 714 [root@localhost docker-prometheus]# docker-compose up -d Starting node-exporter ... Starting alertmanager ... Starting node-exporter ... error WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (a1e70481732ff4211fb0830d456aba632427d7edbf1aed89182b54a2dc1ac0af): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use Starting alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (d7a7bb69496f07386701cc39d4f9da755beb85a528753132c9a70048af1c917c): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (a1e70481732ff4211fb0830d456aba632427d7edbf1aed89182b54a2dc1ac0af): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (d7a7bb69496f07386701cc39d4f9da755beb85a528753132c9a70048af1c917c): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# sudo systemctl restart docker [root@localhost docker-prometheus]# docker-compose up -d Starting node-exporter ... Starting alertmanager ... Starting node-exporter ... error WARNING: Host is already in use by another container ERROR: for node-exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (d4bd8914814c09ec94f19902075b8a0b7c2f39feba0a2efc1c6018e52fb01061): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use Starting alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (a1f8e19b7f96a87e287d4d2b33ce00e81a5d5c0d1bc2192c17f9bf39ace81f16): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: for node_exporter Cannot start service node_exporter: driver failed programming external connectivity on endpoint node-exporter (d4bd8914814c09ec94f19902075b8a0b7c2f39feba0a2efc1c6018e52fb01061): Error starting userland proxy: listen tcp4 0.0.0.0:9100: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (a1f8e19b7f96a87e287d4d2b33ce00e81a5d5c0d1bc2192c17f9bf39ace81f16): Error starting userland proxy: listen tcp4 0.0.0.0:9093: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# cd /opt [root@localhost opt]# cd /data [root@localhost data]# ks bash: ks: 未找到命令... [root@localhost data]# ls docker-prometheus [root@localhost data]# ls -l 总用量 4 drwxr-xr-x 6 root root 4096 8月 27 15:42 docker-prometheus [root@localhost data]# cd /opt [root@localhost opt]# docker-compose.yml bash: docker-compose.yml: 未找到命令... [root@localhost opt]# cd docker-compose.yml bash: cd: docker-compose.yml: 没有那个文件或目录 [root@localhost opt]# find docker-compose.yml find: ‘docker-compose.yml’: 没有那个文件或目录 [root@localhost opt]# cd /data/docker-prometheus/ [root@localhost docker-prometheus]# ls l ls: 无法访问l: 没有那个文件或目录 [root@localhost docker-prometheus]# ls -l 总用量 52 drwxr-xr-x 2 root root 4096 8月 20 15:12 alertmanager -rw-r--r-- 1 root root 2634 8月 20 14:36 docker-compose.yaml drwxr-xr-x 2 root root 4096 8月 20 14:36 grafana -rw-r--r-- 1 root root 35181 8月 20 14:36 LICENSE drwxr-xr-x 2 root root 4096 8月 22 16:45 prometheus -rw-r--r-- 1 root root 0 8月 20 14:36 README.md [root@localhost docker-prometheus]# vim docker-compose.yaml [root@localhost docker-prometheus]# docker-compose.yml bash: docker-compose.yml: 未找到命令... [root@localhost docker-prometheus]# docker-compose.yml bash: docker-compose.yml: 未找到命令... [root@localhost docker-prometheus]# sudo systemctl restart docker ^[[A[root@localhost docker-prometheudocker-compose up -d Recreating node-exporter ... Recreating alertmanager ... cadvisor is up-to-date Recreating alertmanager ... error ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on e Recreating node-exporter ... done proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (845ba9f38bf09748f96a5e67761382648b7a08f0d1ca4aea45e9d486034ee09f): Error starting userland proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# docker-compose up -d Removing alertmanager node-exporter is up-to-date Recreating 53b2433d3f44_alertmanager ... cadvisor is up-to-date Recreating 53b2433d3f44_alertmanager ... error ERROR: for 53b2433d3f44_alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (9f74c9d6ee9219aa21f3a075ee643a8da9a3ee0a7cad5d8fc5e7497c5784c400): Error starting userland proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (9f74c9d6ee9219aa21f3a075ee643a8da9a3ee0a7cad5d8fc5e7497c5784c400): Error starting userland proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# sudo lsof -i :9093 || echo "端口 9093 已释放" COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME alertmana 17952 prometheus 7u IPv6 177546 0t0 TCP *:copycat (LISTEN) [root@localhost docker-prometheus]# sudo lsof -i :9100 || echo "端口 9100 已释放" COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME prometheu 17933 prometheus 30u IPv6 179703 0t0 TCP localhost:54442->localhost:jetdirect (ESTABLISHED) node_expo 17972 prometheus 3u IPv6 177682 0t0 TCP *:jetdirect (LISTEN) node_expo 17972 prometheus 6u IPv6 177755 0t0 TCP localhost:jetdirect->localhost:54442 (ESTABLISHED) [root@localhost docker-prometheus]# sudo iptables -t nat -L -n | grep -E "(9093|9100)" MASQUERADE tcp -- 172.18.0.3 172.18.0.3 tcp dpt:9100 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9101 to:172.18.0.3:9100 [root@localhost docker-prometheus]# docker-compose down Stopping node-exporter ... done Stopping cadvisor ... done Removing alertmanager ... done Removing node-exporter ... done Removing cadvisor ... done Removing 53b2433d3f44_alertmanager ... done Removing network docker-prometheus_monitoring [root@localhost docker-prometheus]# docker-compose up -d Creating network "docker-prometheus_monitoring" with driver "bridge" Creating node-exporter ... Creating cadvisor ... Creating alertmanager ... Creating alertmanager ... error Creating node-exporter ... done Creating cadvisor ... done proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: for alertmanager Cannot start service alertmanager: driver failed programming external connectivity on endpoint alertmanager (fc63ea1fc78609d94171482fa5d1a2fb2c3ba3ed83c2d8088806b8a5613cb2ac): Error starting userland proxy: listen tcp4 0.0.0.0:9094: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" | grep 9094 [root@localhost docker-prometheus]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ede1cff2fba0 google/cadvisor:latest "/usr/bin/cadvisor -…" 56 seconds ago Up 55 seconds 8080/tcp cadvisor 1a149cda0ce5 prom/node-exporter:v1.5.0 "/bin/node_exporter …" 56 seconds ago Up 55 seconds 0.0.0.0:9101->9100/tcp, :::9101->9100/tcp node-exporter [root@localhost docker-prometheus]# vim docker-compose.yaml [root@localhost docker-prometheus]# docker-compose up -d Recreating alertmanager ... node-exporter is up-to-date Recreating alertmanager ... done Creating prometheus ... Creating prometheus ... error ERROR: for prometheus Cannot start service prometheus: driver failed programming external connectivity on endpoint prometheus (ddd41fce73c70167f23ff37ff3001e101134785f9423893a5aae147768420d6a): Error starting userland proxy: listen tcp4 0.0.0.0:9090: bind: address already in use ERROR: for prometheus Cannot start service prometheus: driver failed programming external connectivity on endpoint prometheus (ddd41fce73c70167f23ff37ff3001e101134785f9423893a5aae147768420d6a): Error starting userland proxy: listen tcp4 0.0.0.0:9090: bind: address already in use ERROR: Encountered errors while bringing up the project. [root@localhost docker-prometheus]# vim docker-compose.yaml version: '3.3' volumes: prometheus_data: {} grafana_data: {} networks: monitoring: driver: bridge services: prometheus: image: prom/prometheus:v2.37.6 container_name: prometheus restart: always volumes: - /etc/localtime:/etc/localtime:ro - ./prometheus/:/etc/prometheus/ - prometheus_data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' #热加载配置 - '--web.enable-lifecycle' #api配置 #- '--web.enable-admin-api' #历史数据最大保留时间,默认15天 - '--storage.tsdb.retention.time=30d' networks: - monitoring links: - alertmanager 34,6 顶端 怎么该
08-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值