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’s 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.

Metrics

OpsRamp MetricMetric Display NameUnitDescription
solr_CACHE_cumulative_evictionsCache Cumulative EvictionsevictionTotal number of cumulative evictions
solr_CACHE_cumulative_hitsCache Cumulative HitshitsTotal number of cumulative hits
solr_CACHE_cumulative_insertsCache Cumulative InsertsinsertsTotal number of cumulative inserts
solr_CACHE_cumulative_lookupsCache Cumulative LookupslookupsTotal number of cumulative lookups
solr_QUERY_requestTimes_MeanRateQuery Request times Mean ratereq/secTotal number of search handler avg requests per second
solr_QUERY_requestTimes_MeanQuery Request times MeansecondsTotal number of search handler avg time
solr_QUERY_errorsQuery ErrorserrordTotal number of search handler errors
solr_QUERY_requestsQuery RequestsrequestsTotal number of search handler requests
solr_QUERY_totalTimeQuery Total timesecondsTotal number of search handler totaltime
solr_QUERY_timeoutsQuery TimeoutsTotal number of search handler timeouts
solr_searcher_maxDocSearcher Max docnumber of maxdoc
solr_searcher_numDocsSearcher Numdocsnumber of numdocs
solr_searcher_warmupTimeSearcher Warm uptimesecondsTime spent warming up.
solr_documentCache_cumulative_evictionsDocumentcache Cumulative EvictionsevictionTotal number of documentcache cumulative evictions
solr_documentCache_cumulative_insertsDocumentcache Cumulative InsertsinsertsTotal number of documentcache cumulative inserts
solr_documentCache_cumulative_lookupsDocumentcache Cumulative LookupslookupsTotal number of documentcache cumulative lookups
solr_documentCache_cumulative_hitsDocumentcache Cumulative HitshitsTotal number of documentcache cumulative hits
solr_filterCache_cumulative_hitsFiltercache Cumulative HitshitsTotal number of filtercache cumulative hits
solr_filterCache_cumulative_lookupsFiltercache Cumulative LookupslookupsTotal number of filtercache cumulative lookups
solr_filterCache_cumulative_evictionsFiltercache Cumulative EvictionsinsertsTotal number of filtercache cumulative evections
solr_filterCache_cumulative_insertsFiltercache Cumulative InsertsinsertsTotal number of filtercache cumulative inserts
solr_queryResultCache_cumulative_insertsQueryresultcache Cumulative InsertsinsertsTotal number of query result cache cumulative inserts
solr_queryResultCache_cumulative_evictionsQueryresultcache Cumulative EvictionsevictionTotal number of query result cache cumulative evections
solr_queryResultCache_cumulative_hitsQueryresultcache Cumulative HitshitsTotal number of query result cache cumulative hits
solr_queryResultCache_cumulative_lookupsQueryresultcache Cumulative LookupslookupsTotal number of query result cache cumulative lookups