Solr with Sitecore Checklist
We have been using Solr with Sitecore for our latest Sitecore implementations as it offers better index synchronization across all CD/CM servers since its a standalone web app with HTTP access, which means that all CD/CM servers will have up-to-date indexed content, unlike lucene where each Sitecore server is responsible of synchronizing its lucene index, which sometimes breaks and causes content to be out-dated.
This blog is not about how to configure Solr with Sitecore, there are many blogs talking on this subject, This blog is about some considerations and best practices that you need to take into account when you setup Solr with Sitecore.
First, Disable Indexing on CD's
With Solr/Sitecore setup, you only need to enable indexing on CM, and disable it on CD servers, By default after any publish operation, Sitecore will store (item changed/added) event into Event Queue table, and each Sitecore instance will pick that and trigger index job for that item, With Solr we only need CM to trigger index job.
To disable indexing on CD, you need to change the indexing strategy for each index to be "Manual", like :
<strategies hint="list:AddStrategy"> <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" /> </strategies>
Second, Allocated Memery
We were using bitnami Apache Solr, and by default it is configured to use 256MB for the memory heap, This is not enough for Sitecore production environment, As you will start to see errors like "OutOfMemory", I usually set the initial allocated memory to 1GB, and maximum to 8GB, you can change this based on the size of your content, To configure Bitnami Solr allocated memory you need to do the following:
- Open
/Bitnami/solr-VERSION/apache-solr/scripts/serviceinstall.bat
file, and edit (or add if does not exists) the following java options:++JvmOptions=-Xms1024M ++JvmOptions=-Xmx8192M
- Make sure SOLR is running on JAVA 64-bit runtime, By default, Bitnami SOLR will install 32-bit java version and use that if Java is not installed, which will limit the maximum Memory size that Solr can use, Download JAVA 64-bit version and install it, then in '
serviceinstall.bat
' file, you need to change :
--JavaHome="C:\Bitnami\solr-4.9.0-0\java"
TO
--JavaHome="C:\Program Files\Java\jre7"
Or to whatever your java installation folder is. - Now you need to re-install Solr service, Open command prompt (Administration mode) and run the following commands:
cd C:/Bitnami/solr-VERSION/apache-solr/scriptsserviceinstall.bat REMOVE
serviceinstall.bat INSTALL
Third, Solr Cores
With sitecore, you can use one Solr core for all of your content indexes (web, master, core), however i would advise you to use separate core for each one, this will prevent having 1 big core which keeps growing fast , instead you will have smaller cores, which improve your Indexing/Search operations, Create three separate Cores in Solr, and update Solr Index configurations, so that each index points to it's own Core.
Also, In production environment, you need to enable "Switch On Rebuild" in sitecore , so that while you rebuild your indexes, Sitecore will switch any search operation to run on a back-up core until the indexing is finished, This will keep your front end pages that uses search running without any errors.
To do this,Create a new core in Solr , name it "itembuckets_sec" for example, Then you need to change your index "type" attribute and add a new param "rebuildccore" in solr indexes configuration (usually we do this for web index) as following:
<index id="sitecore_web_index" type="Sitecore.ContentSearch.SolrProvider.SwitchOnRebuildSolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> <param desc="name">$(id)</param> <param desc="core">itembuckets</param> <param desc="rebuildcore">itembuckets_sec</param> .... .... .... </index>
Fourth, Common error
Almost on every production environment we had, we were seeing this error in Solr:
Error opening new searcher. Exceeded limit of maxWarmingSearchers=2, try again later.It appears that sitecore indexing perform lots of commits to solr concurrently, causing this error when the searchers that are warming in the background exceed 2 (the default value is 2), We usually increase that to solve the issue.
You will need to go to : "Bitnami\solr-[VERSION]\apache-solr\solr\[CORE NAME]\conf\solrconfig.xml" file and change the value in"maxWarmingSearchers" to higher value.
Have something else to add to this checklist? share it in the comments!
educational franchise in india
ReplyDeleteEducation franchises may be after school supplemental learning and tutoring services, or they may be daycare businesses that operate regularly for younger .
top 10 overseas education consultancy in india
ReplyDeleteStudying abroad gives an edge to the global viewpoint, career & personality of a student. Choosing the best Overseas Education Consultants in India
ReplyDeleteGreat experience for me by reading this blog. Thank you for the wonderful article.
java interview questions and answers for freshers
j2ee interview questions
selenium automation framework interview questions and answers
digital marketing interview questions and answers pdf
hadoop testing interview questions and answers for experienced
oracle pl sql interview questions
data scientist interview
questions and answers
"Valuable one...thanks for sharing..
ReplyDeleteSpoken English Classes in Tambaram
Spoken English Classes in Anna Nagar
Spoken English Classes in Velachery
spoken english class in t nagar
Spoken English Classes in Porur
Spoken English Classes in OMR
Spoken English Classes in Chennai
Best Car exhaust and mufflers specialists in Perth
ReplyDeleteLiên hệ Aivivu, đặt vé máy bay tham khảo
ReplyDeletesăn vé máy bay giá rẻ đi Mỹ
vé từ mỹ về việt nam
khi nào có chuyến bay từ canada về việt nam
tình hình vé máy bay từ nhật về việt nam
vé máy bay từ hàn quốc sang việt nam
Vé máy bay từ Đài Loan về VN
Good blog, it's really very informative, Thanks for sharing. Are you looking to enhance your English language skills from the comfort of your home? Ziyyara Edutech’s online English tuition classes are designed to provide personalized and effective learning opportunities for students of all levels.
ReplyDeleteFor more info visit Online english tuition
I am glad to discover this post Very valuable for me. Join our Online speaking English language class in Bahrain and embark on a journey towards fluency, confidence, and success.
ReplyDeleteBook a free demo today. Best english tutoring in bahrain