Solr ?
Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.
1. Prerequisite Software
· solr-4.5.1.zip (Download from https://archive.apache.org/dist/lucene/solr/4.5.1/)
2. Setup Solr Instance
2.1 Download Solr
· Download the Solr and extract it in one folder.
Ex : D:\SolrPOC\Solr\Solr-4.5.1\
· Make sure Java is installed properly
Setup Solr as Windows service using NSSM
1. NSSM - Non-Sucking Service Manager
nssm is a service helper which doesn't suck. Other service helper programs suck because they don't handle failure of the application running as a service. If you use such a program, you may see a service listed as started when in fact the application has died. nssm monitors the running service and will restart it if it dies.
Nssm also features a graphical service installation and removal facility.
2. Download nssm and install Solr as a service
· Extract nssm zip into folder D:\SolrPOC\Solr\nssm 2.24
· Run the below command in command prompt. Open cmd in administrator mode.
D:\SolrPOC\Solr\nssm-2.24\win64\nssm.exe install solr-5.4.1
· It will open NSSM service installation window as GUI
· Enter : D:\SolrPOC\Solr\Solr-4.5.1\bin\solr.cmd in Path
· Enter : D:\SolrPOC\Solr\Solr-4.5.1\\bin in Startup Directory
· Enter : start -f -p 8983 in Arguments ( Note : You can provide the port based on your requirement, default port is 8983)
· Same way, click on details tab, enter the other values, and click on “Install service” button.
· If service installed successfully then below screen will display
3 Verify the Service and Solr UI
· Verify the service in window services. Run the command (services.msc) to open the window service and verify installed service.
· Start the service (Right click and start or left top corner).
4 Create cores using Solr UI
· Click on Core Admin > Add Core
· In add core window , enter “US_master_index” in field name & instanceDir
· Click on Add Core button
· Repeat above steps to add more core
· You can verify the core in folder : D:\SolrPOC\Solr\Solr-4.5.1\server\solr
· Similarly add all the below cores for CD environment and verify it.
3. Troubleshooting
3.1 Solr Service not starting or paused
· Add / Verify JAVA_HOME System Variable
· If Solr5.4.1 service is not starting or paused in Services then verify whether JAVA_HOME system variable is added under Environment Variables or not
3.2 How to verify and add JAVA_HOME system variable?
· Go to Control PanelàClick on System àClick on Advanced System Settings
· Click on Advanced Tabà Click on Environment Variables
· Under System Variables, verify JAVA_HOME variable is there or not.
· If JAVA_HOME variable available then verify latest JRE path is used or not.
· Goto C:\Program Files (x86)\Java\ and verify JRE folders.
· Check whether latest JRE folder path is specified for JAVA_HOME or not.
· If not then enter latest JRE version’s path.
· Now try to start Solr5.4.1 service under services.
· If JAVA_HOME not available then click on New to add new variable.
· Enter JAVA_HOME as variable name
· Enter jre path (C:\Program Files (x86)\Java\jre1.8.0_66) as Variable Value.
· NOTE: If more than one jre folder is available under Java folder then specify latest jre
· Click OK
· Now try to start Solr5.4.1 service under services.
3.3 Edit/Uninstall the service using NSSM?
· NSSM Command to uninstall the Solr Service
1). Open command prompt in Admin mode
2) Type command below command
D:\SolrPOC\Solr\nssm-2.24\win64\nssm remove solr5.4.1
3) You will receive "service removed successfully" message
4) Verify the service (type services.msc)
5) If service name still is still displaying then restart the system.
· NSSM Command to uninstall the Solr Service
1). Open command prompt in Admin mode
2) Type command below command
D:\SolrPOC\Solr\nssm-2.24\win64\nssm remove solr5.4.1
3) You will receive "service removed successfully" message
4) Verify the service (type services.msc)
5) If service name still is still displaying then restart the system.
· NSSM Command to edit Solr Service:
1). Open command prompt in Admin mode
1). Open command prompt in Admin mode
2). Type command : D:\SolrPOC\Solr\nssm-2.24\win64\nssm edit solr5.4.1
3.4 How to verify solr service running on which port?
· Navigate to \solr-5.4.1\bin folder. There .port extension file available which show the running port no.
3.5 How to verify solr service running on which process ID?
· Navigate folder : \solr-5.4.1\server\solr
· Open folder hsperfdata_
· There is one file with numeric no. Note down this number
· Open task manager and navigate to details tab
· Search for Java and match the PID with above noted number.
3.6 Solr service is hanged for last 1 hour?
· Java behave differently on window, when we stop the service then it does not immediately stop. If any backend operation is, happening then it wait to finish that operation.
· Always stop and start the service for clear visibility.
· Do not immediately stop and start the service. At least gap should be 30- 60 sec.
· After waiting for a long time if service is still not responding then verify the above java PID in task manager.














Comments
Post a Comment