Solr 可观测性最佳实践

360影视 欧美动漫 2025-03-13 01:00 3

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

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

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

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

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

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

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

[[inputs.solr]]##(optional) collect interval, default is 10 secondsinterval = '10s'## specify a list of one or more Solr serversservers = ["http://localhost:8983"]## Optional HTTP Basic Auth Credentials# username = "username"# password = "pa$$word"## Set true to enable electionelection = 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 即可。

MetricDescriptionTypeUnithitratioRatio of cache hits to lookups for the current index searcher.floatpercenthitsNumber of hits for the current index searcher.intcountlookupsNumber of lookups against the cache.intcountsizeNumber of entries in the cache at that particular instance.intcountram_bytes_usedActual heap usage of the cache at that particular instance.intBmax_ramMaximum heap that should be used by the cache beyond which keys will be evicted.intMBcountTotal number of requests made since the Solr process was started.intcountmeanMean of all the request processing time.floatmsmedianMedian of all the request processing time.floatmsp95Request processing time in milliseconds for the request which belongs to the 95th Percentile.floatmsp99Request processing time in milliseconds for the request which belongs to the 99th Percentile.floatmsrate_1minRequests per second received over the past 1 minutes.floatreq/srate_5minRequests per second received over the past 5 minutes.floatreq/srate_15minRequests per second received over the past 15 minutes.floatreq/snum_docsThe total number of indexed documents.intcountdeleted_docsThe number of deleted documents.intcountwarmupThe time spent warming up.intms

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

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

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

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

来源:科学小科普

相关推荐