Goal
Get Solr 6.1 running as a Windows Service and have it recover on OutOfMemory Exceptions.Install Solr 6.1 as a Service
- Download NSSM
- Extract nssm.exe somewhere
- Create solr_start_6.1.0.cmd (this is a Windows Command file that does all of my configuration--yours will definitely be different):
C:\apache\solr-6.1.0\bin\solr start -f -h node3 -c -p 8983 -z "zk1:2181,zk2:2181,zk3:2181" -m 128m -s C:\apache\solr-6-cores
NOTE: The -f to run the script in the foreground. I set the JVM heap size to 128 MB (we want this thing to crash and burn to test out OutOfMemoryException restart!). - Test your script to make sure it starts solr and you can access your Solr Admin UI in a web browser
- Open a command window and navigate to your nssm.exe directory
- nssm.exe install "Apache - Solr 6.1"
- Application Tab
- Path: Select your solr_start_6.1.0.cmd from earlier
- Startup Directory: set it to the directory containing your script (should populate by default)
- Details Tab
- Display Name: Apache - Solr 6.1
- Startup type: Automatic
- Log on Tab
- Make sure you specify an account that has administrator-level permissions (Use your account if you're stuck here--but make sure to set it to something production-worthy later)
- I/O Tab
- I/O Redirection
- Output (stdout): Set this to something like path\to\my\solr\cmd\script\dir\solr-6.1.0-out.txt
- Error (stderr): path\to\my\solr\cmd\script\dir\solr-6.1.0-error.txt
- File rotation
- Check Rotate files
- Check Rotate while service is running
- Restrict rotation to files bigger than: (use common sense here, I did 5 MB, so 5242880 went into the box)
- Click Install Service
- Open Component Services and select Apache - Solr 6.1
- Start the service
- Validate that it came up by going to your Admin UI webpage
Make Solr Service respond to Out Of Memory Exceptions
- Navigate to this JIRA ticket
- Download oom_win.cmd and place it in your solr\bin directory next to solr.cmd
- Open solr.cmd in a text editor
- Find all the places where the script starts the server:
- Search for /solr_gc.log
- Immediately after /solr_gc.log, paste the following:
-XX:OnOutOfMemoryError="%SOLR_SERVER_DIR%\..\bin\oom_win.cmd %SOLR_PORT% !SOLR_LOGS_DIR!" - I had to replace two lines. NOTE that this is just the manual way of applying the patch file associated with the JIRA ticket above. If you want, apply it however you want.
- Now that we've made our changes, go ahead and restart our new Solr 6.1 service so it knows to kill the process on OutOfMemory errors.
- To force an OutOfMemoryError, query *:* and return 1000000 rows
- If you have a decent amount of content, this should force an OutOfMemory exception. If you don't have a lot of content, do whatever you can to make it do a lot of memory-intensive work. Perhaps consider lowering the JVM memory, too.
- You should see the web server go offline temporarily and then come back online
- Now that you've seen it restart and come back online, let's give the JVM a good amount of RAM so that it doesn't run out of memory every other request. Just edit your solr_start_6.1.0.cmd file and change the -m 128m to -m 4g (128 MB to 4 GB)
- Save and restart the service
- Confirm that you have the new amount of RAM for the JVM by visiting the Dashboard tab in the Admin UI
Logs
When the OutOfMemory Killer runs, it generates a log file in the normal log directory. Navigate to that directory and you should see a file that looks something like: solr_oom_killer-9000-2016-07-06_13_59_39. Now you can know when this script runs and hopefully anticipate it in the future or make changes to not get it.
Final step (important!)
Do a happy dance!
It's helpful! Thank you!
ReplyDeleteIt's helpful! Thank you!
ReplyDeletehi,
ReplyDeleteFollowed your instruction, but got following error
2672 ERROR (main) [ ] o.a.s.s.SolrDispatchFilter Could not start Solr. Check s
olr/home property and the logs
2703 ERROR (main) [ ] o.a.s.c.SolrCore null:org.apache.solr.common.SolrExcepti
on: Error occurred while loading solr.xml from zookeeper
Thanks
Siva
Join us in the #solr channel at freenode. There's lots of helpful people there who can probably help you through.
Deletehttp://webchat.freenode.net/?channels=#solr
I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in APACHE SOLR
ReplyDelete, kindly contact us http://www.maxmunus.com/contact
MaxMunus Offer World Class Virtual Instructor led training on APACHE SOLR . We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us:
Name : Arunkumar U
Email : arun@maxmunus.com
Skype id: training_maxmunus
Contact No.-+91-9738507310
Company Website –http://www.maxmunus.com
I really appreciate the information shared above. It’s of great help. MaxMunus provides Remote Support For Corporate and for Individuals. If anyone is facing any issue in his project of #APACHE SOLR we can support them remotely , kindly contact us http://www.maxmunus.com/contact
ReplyDeleteMaxMunus Offer World Class Industry best Consultant on# APACHE SOLR. We provide end to end Remote Support on Projects. MaxMunus is successfully doing remote support for countries like India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
Saurabh
MaxMunus
E-mail: saurabh@maxmunus.com
Skype id: saurabhmaxmunus
Ph:(0) 8553576305/ 080 - 41103383
http://www.maxmunus.com
This is great! Thank you! But one thing isn't working. I don't see the standard out and standard error files I specified. Should I be worried?
ReplyDeleteI really enjoy the blog.Much thanks again. Really Great salesforce Online course
ReplyDeleteThank you. Still works for Solr 7.4.0. :-)
ReplyDeleteadana escort - adıyaman escort - afyon escort - aksaray escort - antalya escort - aydın escort - balıkesir escort - batman escort - bitlis escort - burdur escort - bursa escort - diyarbakır escort - edirne escort - erzurum escort - eskişehir escort - eskişehir escort - eskişehir escort - eskişehir escort - gaziantep escort - gebze escort - giresun escort - hatay escort - ısparta escort - karabük escort - kastamonu escort - kayseri escort - kilis escort - kocaeli escort - konya escort - kütahya escort - malatya escort - manisa escort - maraş escort - mardin escort - mersin escort - muğla escort - niğde escort - ordu escort - osmaniye escort - sakarya escort - samsun escort - siirt escort - sincan escort - tekirdağ escort - tokat escort - uşak escort - van escort - yalova escort - yozgat escort - urfa escort - zonguldak escort
ReplyDeleteadanaescort01.com - adiyamanescortxx.com - afyonarackiralama.net - aksarayescort.net - antalyaoyunpark.com - aydinescortkiz.com - balikesirescortlar.com - batmanescortlar.com - bitlisescortlar.com - burdurescortlar.com - bursamalaysias.com - diyarbakirambar.com - edirnedespor.com - erzurumyolkosusu.com - eskisehirescortlari.com - gaziantepekspres.org - gebzeescortkiz.com - giresunmaraton.com - hataykoleji.com - ispartakpss.com - karabukteknik.com - kastamonuajans.net - kayserivalisi.com - kilisescort.com - kocaeliescortlar.com - konyaescortlar.com - kutahyaizemlak.com - malatyadataksi.com - manisaescortlar.com - marasatasoyemlak.com - mardinfanatik.com - mersinmoda.com - muglaapart.net - nigdeyapi.com - orduescortt.com - osmaniyeyorum.com - sakaryanur.com - samsunescortlar.com - siirteyatirim.com - sincanoto.com - tekirdagescortlar.com - tokatforum.com - usakbasin.com - vanescortilan.com - yalovadaemlak.com - yozgattanal.com - sanliurfadayim.com - zonguldakescort.com
ReplyDeletekayseriescortu.com - alacam.org - xescortun.com
ReplyDeleteThanks for sharing, nice post! Post really provice useful information! I would like to share more information on the same. Nextbrick, Inc is a technology services firm that provides consulting services. For over 5 years, NextBrick has worked with onboardings, performance tuning, relevancy tuning and general Apache Solr Consulting Services and Lucidworks Fusion support for enterprise search and e-commerce search solutions for Fortune 500 companies.
ReplyDeleteinstagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma