23/10/25
This commit is contained in:
parent
ec6060cd2c
commit
566d3909a4
70
observabilite_VM_hardware/docker-compose.yml
Normal file
70
observabilite_VM_hardware/docker-compose.yml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
services:
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:latest
|
||||||
|
container_name: prometheus-observability
|
||||||
|
volumes:
|
||||||
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
|
command:
|
||||||
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
ports:
|
||||||
|
- "9090:9090"
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
grafana:
|
||||||
|
image: grafana/grafana:latest
|
||||||
|
container_name: grafana-observability
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
volumes:
|
||||||
|
- grafana-data:/var/lib/grafana
|
||||||
|
environment:
|
||||||
|
- GF_SECURITY_ADMIN_USER=admin
|
||||||
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
depends_on:
|
||||||
|
- loki
|
||||||
|
loki:
|
||||||
|
image: grafana/loki:2.8.2
|
||||||
|
container_name: loki-observability
|
||||||
|
ports:
|
||||||
|
- "3100:3100"
|
||||||
|
command: -config.file=/etc/loki/local-config.yaml
|
||||||
|
volumes:
|
||||||
|
- ./loki-config.yaml:/etc/loki/local-config.yaml
|
||||||
|
- ./loki-wal:/wal
|
||||||
|
- ./loki-chunks:/loki/chunks
|
||||||
|
- ./loki-index:/loki/index
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
promtail:
|
||||||
|
image: grafana/promtail:2.8.2
|
||||||
|
container_name: promtail-observability
|
||||||
|
volumes:
|
||||||
|
- ./promtail-config.yaml:/etc/promtail/config.yaml
|
||||||
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||||
|
command:
|
||||||
|
- -config.file=/etc/promtail/config.yaml
|
||||||
|
depends_on:
|
||||||
|
- loki
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
node_exporter:
|
||||||
|
image: prom/node-exporter:latest
|
||||||
|
container_name: node-exporter
|
||||||
|
restart: unless-stopped
|
||||||
|
pid: "host"
|
||||||
|
network_mode: "host"
|
||||||
|
volumes:
|
||||||
|
- /proc:/host/proc:ro
|
||||||
|
- /sys:/host/sys:ro
|
||||||
|
- /:/rootfs:ro
|
||||||
|
command:
|
||||||
|
- '--path.procfs=/host/proc'
|
||||||
|
- '--path.sysfs=/host/sys'
|
||||||
|
- '--collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"'
|
||||||
|
volumes:
|
||||||
|
grafana-data:
|
||||||
|
networks:
|
||||||
|
observability:
|
||||||
|
driver: bridge
|
||||||
38
observabilite_VM_hardware/loki-config.yaml
Normal file
38
observabilite_VM_hardware/loki-config.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
auth_enabled: false
|
||||||
|
|
||||||
|
server:
|
||||||
|
http_listen_port: 3100
|
||||||
|
|
||||||
|
ingester:
|
||||||
|
wal:
|
||||||
|
enabled: true
|
||||||
|
chunk_idle_period: 5m
|
||||||
|
chunk_retain_period: 30s
|
||||||
|
chunk_target_size: 1048576
|
||||||
|
max_transfer_retries: 0
|
||||||
|
lifecycler:
|
||||||
|
ring:
|
||||||
|
kvstore:
|
||||||
|
store: inmemory
|
||||||
|
replication_factor: 1
|
||||||
|
|
||||||
|
schema_config:
|
||||||
|
configs:
|
||||||
|
- from: 2020-10-24
|
||||||
|
store: boltdb
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v11
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 168h
|
||||||
|
|
||||||
|
storage_config:
|
||||||
|
boltdb:
|
||||||
|
directory: /loki/index
|
||||||
|
filesystem:
|
||||||
|
directory: /loki/chunks
|
||||||
|
|
||||||
|
limits_config:
|
||||||
|
enforce_metric_name: false
|
||||||
|
reject_old_samples: true
|
||||||
|
reject_old_samples_max_age: 168h
|
||||||
@ -1,25 +0,0 @@
|
|||||||
Acces a VM du Git qui est sur Azure, commande:
|
|
||||||
|
|
||||||
zinsouor@master-tc-2026-w11:~/VM_Sauvegarde/VM_Sauvegarde_Gitea$ ls
|
|
||||||
Gitea_cle.pem logs scripts tuto_install_git.txt Vagrantfile
|
|
||||||
|
|
||||||
ssh -i Gitea_cle.pem azureuser@20.19.88.39
|
|
||||||
|
|
||||||
--> le fichier qui sauvegarde le git
|
|
||||||
|
|
||||||
root@Gitea:~# ls (existe en root)
|
|
||||||
backup-gitea.sh (un crontab est fait derriere ca: 0 23 * * 4,5,6 /root/backup-gitea.sh)
|
|
||||||
|
|
||||||
--> l'endroit où c'est sauvegarder
|
|
||||||
|
|
||||||
azureuser@Gitea:~$ cd /backup/
|
|
||||||
azureuser@Gitea:/backup$ ls
|
|
||||||
gitea
|
|
||||||
azureuser@Gitea:/backup$ cd gitea/
|
|
||||||
azureuser@Gitea:/backup/gitea$ ls
|
|
||||||
azureuser@Gitea:/backup/gitea$
|
|
||||||
|
|
||||||
--> backup vers une vm-sauvegarde local
|
|
||||||
|
|
||||||
scp -i ../Gitea_cle.pem azureuser@20.19.88.39:/backup/gitea/gitea-backup-2025-10-02.tar.gz .
|
|
||||||
scp -i ../cle/Gitea_cle.pem azureuser@20.19.88.39:/backup/gitea/gitea-backup-2025-10-09.tar.gz ../backup/
|
|
||||||
16
observabilite_VM_hardware/prometheus.yml
Normal file
16
observabilite_VM_hardware/prometheus.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'prometheus'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['localhost:9090']
|
||||||
|
|
||||||
|
- job_name: 'node_exporter'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['192.168.4.4:9100']
|
||||||
|
|
||||||
|
- job_name: 'scaphandre'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['192.168.4.4:8080']
|
||||||
|
fallback_scrape_protocol: "PrometheusText1.0.0"
|
||||||
26
observabilite_VM_hardware/promtail-config.yaml
Normal file
26
observabilite_VM_hardware/promtail-config.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
server:
|
||||||
|
http_listen_port: 9080
|
||||||
|
grpc_listen_port: 0
|
||||||
|
|
||||||
|
positions:
|
||||||
|
filename: /tmp/positions.yaml
|
||||||
|
|
||||||
|
clients:
|
||||||
|
- url: http://loki:3100/loki/api/v1/push
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: docker_logs
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- localhost
|
||||||
|
labels:
|
||||||
|
job: docker
|
||||||
|
__path__: /var/lib/docker/containers/*/*.log
|
||||||
|
|
||||||
|
- job_name: system_logs
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- localhost
|
||||||
|
labels:
|
||||||
|
job: syslog
|
||||||
|
__path__: /var/log/*.log
|
||||||
Loading…
x
Reference in New Issue
Block a user