How To Install Apache Solr On Windows 7

JAVA is the first requirement for Solr establishment. JAVA SE 8 or Later is required to.

  1. How To Install Apache Solr On Windows 7 Virtualbox
  2. How To Install Apache Solr On Windows 7 64-bit

NetX relies on Apache Solr to provide robust search capability. Starting in version 9, NetX requires the use of Solr 7, and no longer bundles the application with the NetX upgrade packs. System administrators need to install and maintain a separate instance of Solr during the upgrade of the NetX platform to version 9. This guide provides instructions on the steps necessary to install the new version of Solr and remove the legacy Solr files from an existing NetX installation.

Installing Solr 7

System administrators need to install and maintain a separate instance of Solr during the upgrade of the NetX platform to version 9. This guide provides instructions on the steps necessary to install the new version of Solr and remove the legacy Solr files from an existing NetX installation. Installing Solr 7. Download Tomcat 7 from Apache Solr Download Page. We’ll be using Apache Tomcat 7 32-bit/64-bit Windows Service Installer. Once downloaded, execute the downloaded file and follow the Apache Tomcat Setup Wizard. Proceed further with clicking on Next. Note: prior to the Solr 4.1 release, all distribution and artifact filenames contained an apache- prefix. Installing and Configuring Apache Solr 7.3. Let’s unpack downloaded archive of the Apache Solr 7.3. $ unzip -q solr-7.3.1.zip. You can see about Solr’s directory layout into your machine as following diagram.

  1. This tutorial assumes that you have already downloaded and run the NetX 9+ installer to upgrade your existing NetX application files. If you have not done so, see Upgrading NetX on Windows.
  2. Download the Solr installation package from http://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.zip
  3. Create a Solr folder. In this example, we will create C:Program FilesSolr.
  4. Extract or copy the contents of the zip file into C:Program FilesSolr.
  5. You now need to copy the Solr core from the NetXposure application folder into the Solr folder. Copy the C:Program FilesNetXposuresolr-cores7netx folder into C:Program FilesSolrserversolr. When you are finished, you should have a C:Program FilesSolrserversolrnetx folder that contains the Solr cores.
  6. Copy your existing synonyms.txt file from C:Program FilesNetXposuresolrnetxconf into C:Program FilesSolrserversolrnetxconf and overwrite the default file if requested. If you have a synonyms-custom.txt file inside of your NetX application directory, that file should be copied instead of synonyms.txt and renamed to synonyms.txt once it has been copied into the Solr application folder. Synonyms-custom.txt is no longer a supported filename.
  7. Now it's time to start Solr. Open Powershell, and run this command: 'C:Program FilesSolrbinsolr.cmd' start

  8. Now that Solr has successfully started, You should be able to log into the Solr admin console using the port number shown when you start the engine. Open a web browser and type http://localhost:8983/solr/.


  9. Click Core Admin to make sure Solr is able to load the NetX core.
  10. To inform the NetX application where to find the new Solr installation, edit the exogen-config.xml file and correct the value for the property below:

    PropertyExample valueDescription
    searchEngine.solrUrlhttp://127.0.0.1:8983/solr/netx

    This value tells NetX where to locate the NetX service.

Solr memory settings

By default, the bin/solr script sets the maximum Java heap size to 512M (-Xmx512m). For production, you’ll want to increase the maximum heap size; we recommend starting with at least 2 GB. To do this, open the C:Program FilesSolrbinsolr.in.cmd file and edit the SOLR_JAVA_MEM variable as such:

Remember to restart Solr after changing the memory settings. Open Powershell and run these commands:

Removing old Solr files

Now that you have a separate instance of Solr, you can safely remove the old Solr application files that were bundled with the NetX installation.

  1. Remove the Solr WAR file. By default, this is located in C:Program FilesNetXposurewebappssolr.war.
  2. If there is an unpacked WAR, remove C:Program FilesNetXposurewebappssolr as well.
  3. Remove the configuration descriptor: C:Program FilesNetXposureconfCatalinalocalhostsolr.xml
  4. Back up the old index data, found here: C:Program FilesNetXposuresolrnetxdata. After the data has been backed up, you can delete the C:Program FilesNetXposuresolr directory.

Starting NetX

Now that Solr 7 has been installed and started, you can start the NetX service.

  1. Open the Services console on your Windows server.
  2. Find the NetX service, right-click and hit Start.
  3. Wait for the status to report that the service has been started.

Rebuilding the Solr index

On initial startup after the upgrade to NetX 9. NetX will attempt to build a new Solr index from scratch, since the old index is no longer valid with the new Solr version. This could take a while to complete depending on the size of your installation (number of assets and/or attributes) so you may experience missing assets or other data inconsistencies until the index is complete. If you run into issues, you may want to launch a manual reindex of your site.

Running Solr as a Windows service

Install

Since Solr is no longer managed by the NetX service, it will have to be manually started if the server reboots or is shutdown. It is possible to run Solr as a Windows service using third-party solutions, but NetX cannot guarantee support for those configurations. Do so at your own risk.

Requirements to run Solr on your computer

To follow along with this online tutorial, we will need:

  • Java 1.5 version or greater. We can get Java from Oracle, Open JDK, IBM, or Running Java -version at the command line will indicate a version number starting with 1.5. Gnu's GCJ is not supported and does not work with Solr.
  • A Solr release that is supported by your PC.

Download and Install Java

Java is available in the following three editions:

Java SE: SE stands for Standard Edition in Java SE. Java SE can be used to develop stand-alone applications, such as PC applications.

Java EE: EE stands for the Enterprise Edition in Java EE. It can be used to develop enterprise applications, such as web app., socket programming, and many more.

Java ME: In Java ME, ME stands for Micro Edition. It is used to develop mobile applications and embedded devices software, such as set-top boxes and other electronic devices.

Follow the below-given steps for the downloading and setting up Java:

Step 1: Go to the link https://www.oracle.com/in/java/technologies/javase-downloads.html. You will redirect to the Java Standard Edition (SE) Downloads page.

Step 2: Click on the Download link of JDK under the section of Oracle JDK.

When we click on the link shown in the above image, we are now redirected to the Java SE Development Kit 14 Download page, where the JDK download link for the different operating systems is available.

How To Install Apache Solr On Windows 7 Virtualbox

Step 3: Click on the available download link according to your operating system to start downloading JDK.

Here, we are using Windows operating system, so we are selecting the JDK-14.0.1_windows-x64_bin.exe file. It starts downloading the .exe file. If you wish to download the zip file, click over another link.

Step 4: Check on the box to accept the License Agreement, which activates the download option.

Step 5: Click on the Download JDK-14.0.1_windows-x64_bin.exe button. It starts downloading the JDK 14.

Step 6: Double click on the downloaded .exe file. It asks for changes on your computer. Click on the Yes button to run the setup.

Step 7: In the installation wizard window, click on the Next button.

Step 8: Click on the Change button if you want to change the installation directory. By default, it installs JDK on the location C:Program FilesJavajdk-14.0.1. Otherwise, click on the Next button. It starts the installation of JDK.

Install

Step 9: When Java is successfully installed on your system, it shows a message Java SE Developments Kit 14.0.1 (64-bit) Successfully Installed. Click on the Close button.

We have installed Java successfully. To check the Java is successfully installed or not, follow the steps given below.

Step 10: Go to the bin folder of the JDK and copy the path. In our case path is C:Program FilesJavajdk-14.0.1bin.

Step 11: Open the Command Prompt and type the following commands:

Step 12: Type the command Java? Version to check the Java version. It ensures that Java is successfully installed in your system.

Download and Install Apache Solar

Step 1: Open any of the web browsers and search for Apache Solr.

Step 2: Click on the first link appear on the google search list.

Step 3: Click on the download button on the Solr website.

Step 4: Select one of the mirror links to get an index of Apache Solr. From there, download the file named Solr-8.6.2.zip.

Step 5: Click on one of the mirror link given under the HTTP option

Windows

Step 6: After clicking the download link, select a file location from the explorer to save the .rar file.

Step 7: Extract the .rar file and save the extracted files to the desired location. In our case, I am going to save the file to the C drive.

Setting Java Environment

We can also connect with Apache Solr using Java libraries, but before accessing Solr using Java API, we are required to set the classpath for those libraries.

How To Install Apache Solr On Windows 7 64-bit

Setting the Classpath

Set the classpath to Solr libraries in the .bashrc file. Open .bashrc in any of the text editors, as shown below.

Set classpath for Solr libraries (lib folder in HBase), as shown below.

It can be done to prevent the 'class not found' exception while accessing the HBase using Java API.