Remove existing solr service using nssm
- Press Win+R, type services.msc and press Enter.
Figure 1. Enabling Solr as Windows Service (cont.)
- Search for Solr Server service and click on it.
- Click Stop the
service on the left panel to start the service.
Figure 2. Enabling Solr as Windows Service (cont.)
- Right click on the service name “Solr Server” and select “Properties”
Figure 3. Enabling Solr as Windows Service (cont.)
- Copy the value in Service name
For example: In above figure ‘solrservice’ is the service name.
- Go to Control Panel > System and Security > Advanced System Settings. > Environment Variables. A new dialog box appears.
- In System Variables search for Variable name SOLR_HOME, Variable value will have the Solr installation path.
- Go to the SOLR_HOME\bin path. Open the Command Prompt as Administrator.
- Execute the command
below:
nssm remove [Service name] example: nssm remove solrservice - A new pop-up will occur to Remove the service, Click “Yes”.
Figure 4. Enabling Solr as Windows Service (cont.)
- Click “Yes”. solrservice will be removed. Now confirm again in services.msc that service
“Solr Server” is not present.
Figure 5. Enabling Solr as Windows Service (cont.)
Figure 6. Figure 215 - Enabling Solr as Windows Service (cont.)
- After deleting service go to SOLRHOME path in Environmental system variable and rename
SOLR_HOME->SOLR_HOME_OLD
For example: Change the existing SOLR_HOME -> SOLR_HOME_OLD and click ok.
- Download the folder solr-9.5.0.zip file from the Path mentioned in source field of Apache SOLR Requirements.
- Extract zip file to desired location.
e.g.: C:\ solr-9.5.0
- Ensure that Java version 21
or higher is configured in the system and JAVA_HOME variable is set. To check
the same, open the Command Prompt as Administrator and type the command
below:
java -version - Proceed with the installation if the Java version is displayed. If not, please install Java as mentioned in IIS Java.
- Set SOLR_HOME environment variable and add to PATH environment variable.
Follow the steps below to set the SOLR_HOME and PATH.
- Go to Control Panel System and Security Advanced System Settings.
-
Click Environment Variables. A new dialog box appears.
-
Select Path in the System Variables and add the respective path of Solr mentioned above.
Figure 7. Installation of SOLR without HA
-
Set the environment variable as depicted in the image above.
-
Add %SOLR_HOME%\bin to PATH environment variable.
Figure 8. Installation of SOLR without HA (Cont.)
- Navigate to SOLR_HOME\bin and open the file “solr.in.cmd” in notepad/notepad++.
- Uncomment the two lines mentioned below, if commented and do the following changes. Save
the file.
Original: REM set SOLR_JETTY_HOST=127.0.0.1 REM set SOLR_ZK_EMBEDDED_HOST=127.0.0.1 Modified: set SOLR_JETTY_HOST=0.0.0.0 set SOLR_ZK_EMBEDDED_HOST=0.0.0.0 - Open the Command Prompt in Administrator mode, Navigate to
SOLR_HOME\bin and execute the below
command:
solr start -m 2g -cloud -h <SOLR_IP> -p <SOLR_PORT> -s SOLR_HOME\server\solr - Enter the IP address and the Port as the example below states in the
respective fields.
e.g. – solr start -m 2g -cloud -h 10.x.x.x -p 8983 -s C:\solr-9.5.0\server\solr Here, -p for port, you can choose another port -h for hostname/IP (Avoid using localhost) -m for memory -s for path where solr.xml and zoo.cfg is present SOLR_HOME is solr path till / solr-9.5.0 - Create a folder named MyOrgSolr in the directory path SOLR_HOME\server\solr\configsets.
- This step requires the two conf folders (that contains schema.xml and solrconfig.xml)
present in folder named “Solr_9_Prereq.zip” from path mentioned in source field of
Apache SOLR Requirements..
Please reach out to iAuto-Product-Supp@hcl.com to get access to the folder.Note:Solr start command needs to be running in the background as a result for the indexer and iScrape to run. Don’t close the terminal where solr is starting.
- Copy the two conf folders to the ‘MyOrgSolr’ folder created in previous steps.
- Navigate to SOLR_HOME\server\scripts\cloud-scripts. Open the Command Prompt as
Administrator mode and execute the command below for the zookeeper server, for each of
the two conf folders with different schema names, respectively; to upload the config for
Solr as mentioned in the following two
steps:
zkcli.bat -zkhost <SOLR_IP>:<ZOOKEEPERPORT> -cmd upconfig -confname <SCHEMA_NAME> -confdir SOLR_HOME\server\solr\configsets\MyOrgSolr\<CONF_FOLDER_NAME>Figure 9. Installation of SOLR without HA (Cont.)
- For Indexer: Enter the Solr IP and ZooKeeper Port where Solr IP
is the IP address of the solr installation server and ZooKeeper Port is SolrPort+1000.
Set the schema name as ‘documentschema’ for Advance iKnowledge conf folder
named as ‘conf_indexer’.
e.g. For Indexer- zkcli.bat –zkhost 10.x.x.x:9983 -cmd upconfig -confname documentschema -confdir C:\solr-9.5.0\server\solr\configsets\MyOrgSolr\conf_indexer Here, - zookeeperPort is (solrport+1000) - documentschema is name of config file maintain by zookeeper - confdir is directory where your schema.xml(edited) for Advance iKnowledge is present -
For iScrape: Enter the Solr IP and ZooKeeper Port where Solr IP is the IP address of the solr installation server and ZooKeeper Port is SolrPort+1000. Set the schema name as ‘ticketschema’ for BasicKnowledge and iScrape conf folder named as ‘conf_iscrape_knowledge’.
e.g. For iScrape: – zkcli.bat -zkhost 10.x.x.x:9983 -cmd upconfig -confname ticketschema -confdir C:\solr-9.5.0\server\solr\configsets\MyOrgSolr\conf_iscrape_knowledge Here, - zookeeperPort is (solrport+1000) - ticketschema is name of config file maintain by zookeeper - confdir is directory where your schema.xml(edited) is present
- For Indexer: Enter the Solr IP and ZooKeeper Port where Solr IP
is the IP address of the solr installation server and ZooKeeper Port is SolrPort+1000.
Set the schema name as ‘documentschema’ for Advance iKnowledge conf folder
named as ‘conf_indexer’.