Apache Solr is a popular, open source enterprise search platform from the Apache Lucene project. Powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, rich document handling (For example, Word and PDF), and geospatial search are some of the features of Apache Solr. Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world largest internet sites.

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Jetty.

Prerequisites

  1. Ensure that following variable is initialized:
export ENABLE_REMOTE_JMX_OPTS=true

  1. In the bin folder, add the following lines and start Solr:
REMOTE_JMX_OPTS=('-Dcom.sun.management.jmxremote' \
    '-Dcom.sun.management.jmxremote.local.only=false' \
    '-Dcom.sun.management.jmxremote.ssl=false' \
    '-Dcom.sun.management.jmxremote.authenticate=false' \
    "-Dcom.sun.management.jmxremote.port=$RMI_PORT" \
    "-Dcom.sun.management.jmxremote.rmi.port=$RMI_PORT")
  1. For Virtual Machines, install the Linux Agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml

solr:
- name: solr
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml

- name: solr
  instance-checks:
    process-check:
      - solr
    port-check:
      - 8983
    uri-check:
      - "/solr"
  mon-type: "jmx"
  misc:
    jmx-port: "7199"

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml

- name: solr
  container-checks:
    image-check:
      - solr
    port-check:
      - 8983
  mon-type: "jmx"
  misc:
    jmx-port: "7199"

Kubernetes environment

Configure the application in config.yaml

- name: solr
  container-checks:
    image-check:
      - solr
    port-check:
      - 8983
  mon-type: "jmx"
  misc:
    jmx-port: "7199"
  • Adjust the jmx-port according to the jmx port used.
  • jmx-port is required to enable remote JMX.

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Supported metrics

OpsRamp MetricMetric Display NameUnit
solr_CACHE_cumulative_evictions

Total number of cumulative evictions
Cache Cumulative Evictionseviction
solr_CACHE_cumulative_hits

Total number of cumulative hits
Cache Cumulative Hitshits
solr_CACHE_cumulative_inserts

Total number of cumulative inserts
Cache Cumulative Insertsinserts
solr_CACHE_cumulative_lookups

Total number of cumulative lookups
Cache Cumulative Lookupslookups
solr_QUERY_requestTimes_MeanRate

Total number of search handler avg requests per second
Query Request times Mean ratereq/sec
solr_QUERY_requestTimes_Mean

Total number of search handler avg time
Query Request times Meanseconds
solr_QUERY_errors

Total number of search handler errors
Query Errorserrord
solr_QUERY_requests

Total number of search handler requests
Query Requestsrequests
solr_QUERY_totalTime

Total number of search handler totaltime
Query Total timeseconds
solr_QUERY_timeouts

Total number of search handler timeouts
Query Timeouts
solr_searcher_maxDoc

number of maxdoc
Searcher Max doc
solr_searcher_numDocs

number of numdocs
Searcher Numdocs
solr_searcher_warmupTime

Time spent warming up.
Searcher Warm uptimeseconds
solr_documentCache_cumulative_evictions

Total number of documentcache cumulative evictions
Documentcache Cumulative Evictionseviction
solr_documentCache_cumulative_inserts

Total number of documentcache cumulative inserts
Documentcache Cumulative Insertsinserts
solr_documentCache_cumulative_lookups

Total number of documentcache cumulative lookups
Documentcache Cumulative Lookupslookups
solr_documentCache_cumulative_hits

Total number of documentcache cumulative hits
Documentcache Cumulative Hitshits
solr_filterCache_cumulative_hits

Total number of filtercache cumulative hits
Filtercache Cumulative Hitshits
solr_filterCache_cumulative_lookups

Total number of filtercache cumulative lookups
Filtercache Cumulative Lookupslookups
solr_filterCache_cumulative_evictions

Total number of filtercache cumulative evections
Filtercache Cumulative Evictionsinserts
solr_filterCache_cumulative_inserts

Total number of filtercache cumulative inserts
Filtercache Cumulative Insertsinserts
solr_queryResultCache_cumulative_inserts

Total number of query result cache cumulative inserts
Queryresultcache Cumulative Insertsinserts
solr_queryResultCache_cumulative_evictions

Total number of query result cache cumulative evections
Queryresultcache Cumulative Evictionseviction
solr_queryResultCache_cumulative_hits

Total number of query result cache cumulative hits
Queryresultcache Cumulative Hitshits
solr_queryResultCache_cumulative_lookups

Total number of query result cache cumulative lookups
Queryresultcache Cumulative Lookupslookups