Multiple indexes in one server
Solr supports running multiple cores in a single engine.
Think of each core as a separate index and configuration, and there can be many cores in a single Solr instance.
Solr支持在一個Solr Engine中運行多個core,每個core包含獨立的index和配置。
One use of Solr’s multicore support is data partitioning, such as having one core for recent documents and another core for older documents, known as chronological sharding. Another use of Solr’s multicore support is to support multitenant applications.
In our real estate application, we might use multiple cores to manage different types of listings that are different enough to justify having different indexes for each.
使用場景包括:
- 數據隔離,例如一個core包含最近的新doc,另一個core包含老的doc,即‘按時間分片’
- 不同的core支撐不同的application
- 或者用不同的core管理完全不同類型的數據
Scalable
As a first step to achieving scalability, Solr provides flexible cache-management features that help your server reuse computationally expensive data structures.
at some point you’re going to need to scale out your capacity to handle more documents and higher query throughput by adding more servers.
為了實現可伸縮,solr提供了靈活的緩存管理特性,這可以讓你的應用重用昂貴的數據結構。
同時,我們也需要動態的加減服務以處理更多的doc index和更高的query吞吐。
For higher query throughput, you add replicas of your index so that more servers can handle more requests.
為了支持更高的query吞吐,需要在多臺server上添加index的復本。
To handle more documents, you split the index into smaller chunks called shards, then distribute the searches across the shards.
為了處理更大數量級的docs,需要將index分片,同樣在搜索時,就需要跨片搜索,這里會有一個Map-Reduce的過程。
search is I/O and memory intensive, you should consider deploying Solr on higher-end hardware with high-performance disks, ideally solid-state drives(SSDs).
搜索是I/O & 內存高度敏感的應用,所以需要將solr部署在高端硬件上:大內存 & SSD。
Fault-tolerant
Beyond scalability, you need to consider what happens if one or more of your servers fails,particularly if you’re planning to deploy Solr on virtualized hardware or commodity hardware.
如果計劃將solr部署在生產環境,除了可伸縮,還需要考慮服務宕機的情況。