头图

Solr 介绍

Solr 是一个开源的搜索平台,由 Apache 软件基金会维护。它建立在 Apache Lucene 项目之上,提供了一个完整的搜索应用服务器,具有高度可靠、可扩展和容错的特性。

监控 Solr 指标如服务器负载、内存使用、索引情况、查询性能、缓存命中率等,可以帮助了解 Solr 的运行状况,发现潜在问题,并进行相应的优化。

观测云

观测云是一款专为 IT 工程师打造的全链路可观测产品,它集成了基础设施监控、应用程序性能监控和日志管理,为整个技术栈提供实时可观察性。这款产品能够帮助工程师全面了解端到端的用户体验追踪,了解应用内函数的每一次调用,以及全面监控云时代的基础设施。此外,观测云还具备快速发现系统安全风险的能力,为数字化时代提供安全保障。

部署 DataKit

DataKit 是一个开源的、跨平台的数据收集和监控工具,由观测云开发并维护。它旨在帮助用户收集、处理和分析各种数据源,如日志、指标和事件,以便进行有效的监控和故障排查。DataKit 支持多种数据输入和输出格式,可以轻松集成到现有的监控系统中。

登录观测云控制台,在「集成」 - 「DataKit」选择对应安装方式,当前采用 Linux 主机部署 DataKit。

图片

采集器配置

进入 DataKit 安装目录下的 conf.d/db 目录,复制 solr.conf.sample 并命名为 solr.conf。示例如下:

[[inputs.solr]]
  ##(optional) collect interval, default is 10 seconds
  interval = '10s'

  ## specify a list of one or more Solr servers
  servers = ["http://localhost:8983"]

  ## Optional HTTP Basic Auth Credentials
  # username = "username"
  # password = "pa$$word"

  ## Set true to enable election
  election = true

  # [inputs.solr.log]
  # files = []
  # #grok pipeline script path
  # pipeline = "solr.p"

  [inputs.solr.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"

配置好后,重启 DataKit 即可。

关键指标

以下是一些关键的 Solr 指标,这些指标对于监控 Solr 的性能和稳定性至关重要。

MetricDescriptionTypeUnit
hitratioRatio of cache hits to lookups for the current index searcher.floatpercent
hitsNumber of hits for the current index searcher.intcount
lookupsNumber of lookups against the cache.intcount
sizeNumber of entries in the cache at that particular instance.intcount
ram_bytes_usedActual heap usage of the cache at that particular instance.intB
max_ramMaximum heap that should be used by the cache beyond which keys will be evicted.intMB
countTotal number of requests made since the Solr process was started.intcount
meanMean of all the request processing time.floatms
medianMedian of all the request processing time.floatms
p95Request processing time in milliseconds for the request which belongs to the 95th Percentile.floatms
p99Request processing time in milliseconds for the request which belongs to the 99th Percentile.floatms
rate_1minRequests per second received over the past 1 minutes.floatreq/s
rate_5minRequests per second received over the past 5 minutes.floatreq/s
rate_15minRequests per second received over the past 15 minutes.floatreq/s
num_docsThe total number of indexed documents.intcount
deleted_docsThe number of deleted documents.intcount
warmupThe time spent warming up.intms

场景视图

登录观测云控制台,点击「场景」 -「新建仪表板」,输入 “Solr”, 选择 “Solr 监控视图”,点击 “确定” 即可添加视图。

图片

监控器(告警)

Solr 实例缓存命中率小于 60% 就触发告警,提醒用户缓存配置需要优化。

图片

Solr 实例 P95 请求响应时间大于 1 秒就触发告警,提醒用户系统性能可能存在问题。

图片

Solr 实例所有请求处理平均时间大于 500 毫秒就触发告警,提醒用户系统性能可能存在问题。

图片

总结

本文从指标、可视化仪表板、监控告警等三个角度展示了如何使用观测云这个一体化观测平台对 Solr 进行全面观测,大大减少了管理多个运维工具的负担,让 DevOps 团队将更多精力投放到更高价值的工作中。


观测云
21 声望85 粉丝

云时代的系统可观测平台


引用和评论

0 条评论