23/10/25
This commit is contained in:
parent
b01e5c5f4f
commit
ec6060cd2c
60
observabilite_service/Machine_virtuelle/docker-compose.yml
Normal file
60
observabilite_service/Machine_virtuelle/docker-compose.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
services:
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:latest
|
||||||
|
container_name: prometheus
|
||||||
|
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
|
||||||
|
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
|
||||||
|
ports:
|
||||||
|
- "3100:3100"
|
||||||
|
command: -config.file=/etc/loki/local-config.yaml
|
||||||
|
volumes:
|
||||||
|
- ./loki-config.yaml:/etc/loki/local-config.yaml
|
||||||
|
- /opt/loki/wal:/wal
|
||||||
|
- /opt/loki/chunks:/loki/chunks
|
||||||
|
- /opt/loki/index:/loki/index
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
|
||||||
|
promtail:
|
||||||
|
image: grafana/promtail:2.8.2
|
||||||
|
container_name: promtail
|
||||||
|
volumes:
|
||||||
|
- ./promtail-config.yaml:/etc/promtail/config.yaml
|
||||||
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||||
|
- /var/log:/var/log:ro
|
||||||
|
command:
|
||||||
|
- -config.file=/etc/promtail/config.yaml
|
||||||
|
networks:
|
||||||
|
- observability
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
grafana-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
observability:
|
||||||
|
driver: bridge
|
||||||
59
observabilite_service/Machine_virtuelle/loki-config.yaml
Normal file
59
observabilite_service/Machine_virtuelle/loki-config.yaml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
auth_enabled: false
|
||||||
|
|
||||||
|
server:
|
||||||
|
http_listen_port: 3100
|
||||||
|
grpc_listen_port: 9096
|
||||||
|
|
||||||
|
common:
|
||||||
|
path_prefix: /loki
|
||||||
|
storage:
|
||||||
|
filesystem:
|
||||||
|
chunks_directory: /loki/chunks
|
||||||
|
rules_directory: /loki/rules
|
||||||
|
replication_factor: 1
|
||||||
|
ring:
|
||||||
|
instance_addr: 127.0.0.1
|
||||||
|
kvstore:
|
||||||
|
store: inmemory
|
||||||
|
|
||||||
|
ingester:
|
||||||
|
wal:
|
||||||
|
enabled: true
|
||||||
|
dir: /wal
|
||||||
|
flush_on_shutdown: true
|
||||||
|
chunk_idle_period: 5m
|
||||||
|
chunk_retain_period: 30s
|
||||||
|
max_chunk_age: 1h
|
||||||
|
lifecycler:
|
||||||
|
ring:
|
||||||
|
replication_factor: 1
|
||||||
|
|
||||||
|
schema_config:
|
||||||
|
configs:
|
||||||
|
- from: 2020-10-24
|
||||||
|
store: boltdb-shipper
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v11
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 24h
|
||||||
|
|
||||||
|
storage_config:
|
||||||
|
boltdb_shipper:
|
||||||
|
active_index_directory: /loki/index
|
||||||
|
cache_location: /loki/index
|
||||||
|
shared_store: filesystem
|
||||||
|
filesystem:
|
||||||
|
directory: /loki/chunks
|
||||||
|
|
||||||
|
limits_config:
|
||||||
|
enforce_metric_name: false
|
||||||
|
reject_old_samples: true
|
||||||
|
reject_old_samples_max_age: 168h
|
||||||
|
ingestion_rate_mb: 10
|
||||||
|
ingestion_burst_size_mb: 20
|
||||||
|
|
||||||
|
compactor:
|
||||||
|
working_directory: /loki/compactor
|
||||||
|
shared_store: filesystem
|
||||||
|
compaction_interval: 10m
|
||||||
15
observabilite_service/Machine_virtuelle/prometheus.yml
Normal file
15
observabilite_service/Machine_virtuelle/prometheus.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'prometheus'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['localhost:9090']
|
||||||
|
|
||||||
|
- job_name: 'node_exporter_vmservices'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['192.168.56.17:9100']
|
||||||
|
|
||||||
|
- job_name: 'apache_vmservices'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['192.168.56.17:9117']
|
||||||
30
observabilite_service/Machine_virtuelle/promtail-config.yaml
Normal file
30
observabilite_service/Machine_virtuelle/promtail-config.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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
|
||||||
|
pipeline_stages:
|
||||||
|
- docker: {}
|
||||||
|
|
||||||
|
- job_name: system_logs
|
||||||
|
static_configs:
|
||||||
|
- targets: ['localhost']
|
||||||
|
labels:
|
||||||
|
job: syslog
|
||||||
|
__path__: /var/log/syslog
|
||||||
|
- targets: ['localhost']
|
||||||
|
labels:
|
||||||
|
job: auth
|
||||||
|
__path__: /var/log/auth.log
|
||||||
@ -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/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user