Remove existing solr service using nssm

  1. Press Win+R, type services.msc and press Enter.
    Figure 1. Enabling Solr as Windows Service (cont.)
    A screenshot of a computer error Description automatically generated
  2. Search for Solr Server service and click on it.
  3. Click Stop the service on the left panel to start the service.
    Figure 2. Enabling Solr as Windows Service (cont.)
    C:\Users\veena-m\AppData\Local\Microsoft\Windows\INetCache\Content.Word\Solr Server.PNG
  4. Right click on the service name “Solr Server” and select “Properties”
    Figure 3. Enabling Solr as Windows Service (cont.)
    A screenshot of a computer Description automatically generated
  5. Copy the value in Service name

    For example: In above figure ‘solrservice’ is the service name.

  6. Go to Control Panel > System and Security > Advanced System Settings. > Environment Variables. A new dialog box appears.
  7. In System Variables search for Variable name SOLR_HOME, Variable value will have the Solr installation path.
  8. Go to the SOLR_HOME\bin path. Open the Command Prompt as Administrator.
  9. Execute the command below:
    nssm remove [Service name]
     example:
     nssm remove solrservice
  10. A new pop-up will occur to Remove the service, Click “Yes”.
    Figure 4. Enabling Solr as Windows Service (cont.)
    A screenshot of a computer error Description automatically generated
  11. 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.)
    A screenshot of a computer Description automatically generated
    Figure 6. Figure 215 - Enabling Solr as Windows Service (cont.)
  12. 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.

  13. Download the folder solr-9.5.0.zip file from the Path mentioned in source field of Apache SOLR Requirements.
  14. Extract zip file to desired location.

    e.g.: C:\ solr-9.5.0

  15. 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
  16. Proceed with the installation if the Java version is displayed. If not, please install Java as mentioned in IIS Java.
  17. Set SOLR_HOME environment variable and add to PATH environment variable. Follow the steps below to set the SOLR_HOME and PATH.
    1. Go to Control Panel  System and Security  Advanced System Settings.
    2. Click Environment Variables. A new dialog box appears.

    3. Select Path in the System Variables and add the respective path of Solr mentioned above.

      Figure 7. Installation of SOLR without HA
      A screenshot of a computer Description automatically generated
    4. Set the environment variable as depicted in the image above.

    5. Add %SOLR_HOME%\bin to PATH environment variable.

      Figure 8. Installation of SOLR without HA (Cont.)
  18. Navigate to SOLR_HOME\bin and open the file “solr.in.cmd” in notepad/notepad++.
  19. 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
  20. 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
  21. 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
  22. Create a folder named MyOrgSolr in the directory path SOLR_HOME\server\solr\configsets.
  23. 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.
  24. Copy the two conf folders to the ‘MyOrgSolr’ folder created in previous steps.
  25. 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.)
    A screenshot of a computer Description automatically generated
    • 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