init
commit
28a636a47c
|
@ -0,0 +1,8 @@
|
|||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/monitor.iml" filepath="$PROJECT_DIR$/.idea/monitor.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,17 @@
|
|||
# HELP
|
||||
|
||||
##安装docker-compose
|
||||
```shell
|
||||
# 下载安装
|
||||
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||
|
||||
# 赋运行权限
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
||||
|
||||
# 查看版本
|
||||
sudo docker-compose version
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
operation:
|
||||
image: google/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
privileged: true
|
||||
expose:
|
||||
- 8080
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: always
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:rw
|
||||
- /sys:/sys:ro
|
||||
- /dev/disk/:/dev/disk:ro
|
||||
- /var/lib/docker/:/var/lib/docker:ro
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "10"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.22.0.10
|
||||
|
||||
#docker network create --driver=bridge --subnet=172.22.0.0/16 --gateway=172.22.0.1 net-devops
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
name: net-devops
|
||||
external: true
|
||||
|
||||
|
||||
#cadvisor | F0203 03:12:49.814278 1 cadvisor.go:172] Failed to start container manager: inotify_add_watch /sys/fs/cgroup/cpuacct,cpu: no such file or directory
|
||||
|
||||
# mount -o remount,rw '/sys/fs/cgroup'
|
||||
# ln -s /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct,cpu
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
operation:
|
||||
image: grafana/grafana
|
||||
container_name: grafana
|
||||
privileged: true
|
||||
expose:
|
||||
- 3000
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/grafana
|
||||
- ./data/grafana.ini:/etc/grafana/grafana.ini
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "10"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.21.0.2
|
||||
|
||||
#docker network create --driver=bridge --subnet=172.21.0.0/16 --gateway=172.21.0.1 net-devops
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
name: net-devops
|
||||
external: true
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
operation:
|
||||
image: prom/node-exporter
|
||||
container_name: node-exporter
|
||||
privileged: true
|
||||
expose:
|
||||
- 9100
|
||||
ports:
|
||||
- 9100:9100
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: always
|
||||
pid: "host"
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
- /etc/hostname:/etc/host_hostname
|
||||
command:
|
||||
- "--web.listen-address=:9100"
|
||||
- "--path.rootfs=/host"
|
||||
- "--path.procfs=/host/proc"
|
||||
- "--path.sysfs=/host/sys"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "10"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.22.0.11
|
||||
|
||||
#docker network create --driver=bridge --subnet=172.21.0.0/16 --gateway=172.21.0.1 net-devops
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
name: net-devops
|
||||
external: true
|
|
@ -0,0 +1,38 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
operation:
|
||||
image: prom/prometheus
|
||||
container_name: prometheus
|
||||
privileged: true
|
||||
expose:
|
||||
- 9090
|
||||
ports:
|
||||
- 9090:9090
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: always
|
||||
volumes:
|
||||
- /etc/hosts:/etc/host
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
command:
|
||||
- '--web.read-timeout=5m'
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.max-connections=512'
|
||||
- '--storage.tsdb.retention=30d'
|
||||
- '--query.timeout=2m'
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "10"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.21.0.3
|
||||
|
||||
#docker network create --driver=bridge --subnet=172.21.0.0/16 --gateway=172.21.0.1 net-devops
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
name: net-devops
|
||||
external: true
|
|
@ -0,0 +1,87 @@
|
|||
global:
|
||||
scrape_interval: 30s
|
||||
evaluation_interval: 30s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ['prometheus:9090']
|
||||
labels:
|
||||
instance: prometheus
|
||||
- job_name: node-exporter
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
labels:
|
||||
instance: node-exporter
|
||||
- job_name: docker-cadvisor
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
labels:
|
||||
instance: cadvisor
|
||||
- job_name: node-exporter(platform-web)
|
||||
static_configs:
|
||||
- targets: ['192.168.2.13:9100']
|
||||
labels:
|
||||
instance: node-exporter(platform-web)
|
||||
- job_name: cadvisor(platform-web)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.13:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(platform-web)
|
||||
|
||||
- job_name: node-exporter(platform-sdk)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.18:9100' ]
|
||||
labels:
|
||||
instance: node-exporter(platform-sdk)
|
||||
- job_name: cadvisor(platform-sdk)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.18:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(platform-sdk)
|
||||
|
||||
- job_name: node-exporter(dev-node-01)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.10:9100' ]
|
||||
labels:
|
||||
instance: node-exporter(dev-node-01)
|
||||
- job_name: cadvisor(dev-node-01)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.10:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(dev-node-01)
|
||||
|
||||
- job_name: node-exporter(dev-node-02)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.15:9100' ]
|
||||
labels:
|
||||
instance: node-exporter(dev-node-02)
|
||||
- job_name: cadvisor(dev-node-02)
|
||||
static_configs:
|
||||
- targets: [ '192.168.2.15:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(dev-node-02)
|
||||
|
||||
- job_name: node-exporter(master-node-01)
|
||||
static_configs:
|
||||
- targets: [ '192.168.5.211:9100' ]
|
||||
labels:
|
||||
instance: node-exporter(master-node-01)
|
||||
- job_name: cadvisor(master-node-01)
|
||||
static_configs:
|
||||
- targets: [ '192.168.5.211:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(master-node-01)
|
||||
|
||||
- job_name: node-exporter(master-node-02)
|
||||
static_configs:
|
||||
- targets: [ '192.168.5.210:9100' ]
|
||||
labels:
|
||||
instance: node-exporter(master-node-02)
|
||||
- job_name: cadvisor(master-node-02)
|
||||
static_configs:
|
||||
- targets: [ '192.168.5.210:8080' ]
|
||||
labels:
|
||||
instance: cadvisor(master-node-02)
|
||||
|
||||
|
Loading…
Reference in New Issue