Skip to main content
Search

Solr-diagnostics: How to use it and what it collects

Radu Gheorghe Radu Gheorghe on

If you’re running Solr and have to troubleshoot it (or maybe you just want a good overview!), then you’d probably want to collect logs, configs, maybe a snapshot of metrics and some system data, like top or netstat.

We created a small tool for this exact task, creatively named solr-diagnostics. It’s been out there for almost two years, and we found it useful in our Solr consulting and production support engagements. So we thought it’s about time to spread the word 🙂

How to use solr-diagnostics tool

You can download solr-diagnostics from its GitHub releases page. Then you’d run it (as root, if you want to collect everything) from the Solr node you’re interested in:

java -jar solr-diagnostics-VERSION.jar

The tool will politely say what it collects, then pack everything in a zip archive under /tmp. You can change this location by adding -outputdir /some/other/path

By default, solr-diagnostics will try to get all Solr logs. You can skip this by adding -noSolrLogs. Similarly, you can collect everything from /var/log (they are not fetched by default) by adding -getVarLog. Speaking of collecting data…

What solr-diagnostics tool collects

The list will keep expanding, but you can find an updated version in the solr-diagnostics github repository. At the time of writing this, it collects:

  • ps output
  • dmesg output
  • netstat output
  • sysctl output
  • uname output
  • top output
  • Solr logs and GC logs
  • (optionally) syslog
  • process limits
  • java version
  • solr.xml
  • configs
  • (Legacy Solr only) cores status
  • (SolrCloud only) collections list
  • (SolrCloud only) cluster status
  • (SolrCloud only) aliases
  • (SolrCloud only) overseer status
  • metrics snapshot

Didn’t find something that you need? Feel free to contribute or suggest an improvement.

Contributing

As it is with open source (yes, this is Apache 2 licensed), feel free to open issues, submit PRs or anything else that you’d find helpful.

If you’re generally interested in Solr, you’ll find our Solr training classes useful (either public or tailored for your company). Or if you already know Solr and would like to join us, we’re hiring wolrdwide!