Skip to content

Instantly share code, notes, and snippets.

@bejean
Last active June 16, 2025 13:26
Show Gist options
  • Save bejean/750a94ba5d50197c9d8cc4ce76fb0bdc to your computer and use it in GitHub Desktop.
Save bejean/750a94ba5d50197c9d8cc4ce76fb0bdc to your computer and use it in GitHub Desktop.
Install script for Prometheus node and solr exporter
#!/bin/bash
# Install and configure node-exporter
useradd -d /home/prometheus prometheus
mkdir /opt/prometheus
cd /opt/prometheus
wget --no-cache -O - https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz > node_exporter-0.18.1.linux-amd64.tar.gz
tar xzf node_exporter-0.18.1.linux-amd64.tar.gz
rm -f node_exporter-0.18.1.linux-amd64.tar.gz
ln -s node_exporter-0.18.1.linux-amd64 node_exporter
wget --no-cache -O - https://gist.githubusercontent.com/bejean/c0d25a0e66ec004d019607308de2e4f8/raw/node-exporter.service > /etc/systemd/system/node-exporter.service
# Configure solr-exporter
chmod +x /opt/solr/solr/contrib/prometheus-exporter/bin/solr-exporter
wget --no-cache -O - https://gist.githubusercontent.com/bejean/772356b0b878c1aca02b7f4dc6262172/raw/solr-exporter.service > /etc/systemd/system/solr-exporter.service
# Start exporters
systemctl daemon-reload
systemctl enable node-exporter
systemctl start node-exporter
systemctl enable solr-exporter
systemctl start solr-exporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment