Skip to content

Instantly share code, notes, and snippets.

@tzach
Created September 22, 2024 15:24
Show Gist options
  • Save tzach/fdf51fc891f042715cf7be9b88d68399 to your computer and use it in GitHub Desktop.
Save tzach/fdf51fc891f042715cf7be9b88d68399 to your computer and use it in GitHub Desktop.
### Example for updating Prometheus targets with out restart
#!/bin/bash
echo fs.aio-max-nr=1048576 | sudo tee /etc/sysctl.d/41-aio_max_nr.conf
sudo sysctl -p /etc/sysctl.d/41-aio_max_nr.conf
docker network create -d bridge scylla
cd scylla-monitoring
mkdir prom-data
mkdir prom-targets
cat << EOF > prometheus/scylla-3-nodes.yml
- targets:
- node1
- node2
- node3
labels:
cluster: cluster1
dc: datacenter1
EOF
mv prometheus/scylla-3-nodes.yml prom-targets/scylla_servers.yml
cat << EOF > prometheus/scylla-6-nodes.yml
- targets:
- node1
- node2
- node3
- node4
- node5
- node6
labels:
cluster: cluster1
dc: datacenter1
EOF
./start-all.sh \
--no-loki --no-alertmanager --no-renderer \
--target-directory prom-targets \
-D "--network scylla"
### Update Targets
mv scylla-monitoring/prometheus/scylla-6-nodes.yml scylla-monitoring/prom-targets/scylla_servers.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment