Return to site

Install Apache Solr Ubuntu 16.04

broken image


Introduction

Solr is a search engine platform based on Apache Lucene. It is written in Java and uses the Lucene library to implement indexing. It can be accessed using a variety of REST APIs (e.g. XML and JSON). This is the feature list from their website: Teamspeak medal icons.

Install solr on windows
  • Advanced Full-Text Search Capabilities
  • Optimized for High Volume Web Traffic
  • Standards Based Open Interfaces - XML, JSON and HTTP
  • Comprehensive HTML Administration Interfaces
  • Server statistics exposed over JMX for monitoring
  • Linearly scalable, auto index replication, auto failover and recovery
  • Near Real-time indexing
  • Flexible and Adaptable with XML configuration
  • Extensible Plugin Architecture

Installation of Solr 6.6.0 on Ubuntu 16.04: Step 1: To update your system run following command: apt-get update && apt-get upgrade -y. Step 2: Run the Java runtime environment before installing the Solr as it is a Java application.Moreover, the python software properties are also needed to install Java 8. So, run the following command. Apache Solr is an enterprise-class open source search platform written in Java which enables you to create custom search engines that index databases, files, and websites. This tutorial will show you how to install the latest Solr version on Ubuntu 16.04 (Xenial Xerus). The steps will most likely work with later Ubuntu versions as well.

In this article, I will show you how to install Solr on Ubuntu using two different methods. The first one will be the simple method and the second the more advanced method. I recommend the second method because it installs a newer version of Solr on all Ubuntu versions, even in the most recent version 14.04 at time of writing.

Ubuntu

Installing Solr using apt-get (easy way)

If you want to install Solr the easy way, you should use this section of the article. Solr doesn't work alone; it needs a Java servlet container such as Tomcat or Jetty. In this article, we'll use Jetty, although Tomcat is just as easy. First, we should install the Java JDK. If you want to install a custom version, please see this article. If you want a simple installation, execute the following commands:

Ubuntu provides 3 Solr packages by default: solr-common, the package that contains the actual Solr code; solr-tomcat, Solr integrated with Tomcat; and solr-jetty, which is just like solr-tomcat but with the Jetty web server. In this article, we will install solr-tomcat, so execute the following command:

Your Solr instance should now be available at http://YOUR_IP:8080/solr. Skip the next section on installing manually if you want to configure Solr.

Installing Solr Manually

To install Solr manually, you will need a little more time. First, we should install the Java JDK. If you want to install a custom version, please see this article. For this section, we will be using Jetty instead of Tomcat. If you want a simple installation, execute the following command:

We can now start the real installation of Solr. First, download all files and uncompress them:

Check if it works by visiting http://YOUR_IP:8983/solr. When it works, go back into your SSH session and close the window with Ctrl+C. Then open the /etc/default/jetty file (nano /etc/default/jetty) and paste this into it:

Save it and open the file /opt/solr/etc/jetty-logging.xml (nano /opt/solr/etc/jetty-logging.xml) and paste this into it:

Apache Solr Download










Solr
Solr
Apache solr vs apache lucene
  • Advanced Full-Text Search Capabilities
  • Optimized for High Volume Web Traffic
  • Standards Based Open Interfaces - XML, JSON and HTTP
  • Comprehensive HTML Administration Interfaces
  • Server statistics exposed over JMX for monitoring
  • Linearly scalable, auto index replication, auto failover and recovery
  • Near Real-time indexing
  • Flexible and Adaptable with XML configuration
  • Extensible Plugin Architecture

Installation of Solr 6.6.0 on Ubuntu 16.04: Step 1: To update your system run following command: apt-get update && apt-get upgrade -y. Step 2: Run the Java runtime environment before installing the Solr as it is a Java application.Moreover, the python software properties are also needed to install Java 8. So, run the following command. Apache Solr is an enterprise-class open source search platform written in Java which enables you to create custom search engines that index databases, files, and websites. This tutorial will show you how to install the latest Solr version on Ubuntu 16.04 (Xenial Xerus). The steps will most likely work with later Ubuntu versions as well.

In this article, I will show you how to install Solr on Ubuntu using two different methods. The first one will be the simple method and the second the more advanced method. I recommend the second method because it installs a newer version of Solr on all Ubuntu versions, even in the most recent version 14.04 at time of writing.

Installing Solr using apt-get (easy way)

If you want to install Solr the easy way, you should use this section of the article. Solr doesn't work alone; it needs a Java servlet container such as Tomcat or Jetty. In this article, we'll use Jetty, although Tomcat is just as easy. First, we should install the Java JDK. If you want to install a custom version, please see this article. If you want a simple installation, execute the following commands:

Ubuntu provides 3 Solr packages by default: solr-common, the package that contains the actual Solr code; solr-tomcat, Solr integrated with Tomcat; and solr-jetty, which is just like solr-tomcat but with the Jetty web server. In this article, we will install solr-tomcat, so execute the following command:

Your Solr instance should now be available at http://YOUR_IP:8080/solr. Skip the next section on installing manually if you want to configure Solr.

Installing Solr Manually

To install Solr manually, you will need a little more time. First, we should install the Java JDK. If you want to install a custom version, please see this article. For this section, we will be using Jetty instead of Tomcat. If you want a simple installation, execute the following command:

We can now start the real installation of Solr. First, download all files and uncompress them:

Check if it works by visiting http://YOUR_IP:8983/solr. When it works, go back into your SSH session and close the window with Ctrl+C. Then open the /etc/default/jetty file (nano /etc/default/jetty) and paste this into it:

Save it and open the file /opt/solr/etc/jetty-logging.xml (nano /opt/solr/etc/jetty-logging.xml) and paste this into it:

Apache Solr Download










Then, create the Solr user and grant it permissions:

After that, download the start file and set it to automatically start up if it hasn't been done already:

Finally start Jetty/Solr:

You can now access your installation just as before at http://YOUR_IP:8983/solr.

Configuring a schema.xml for Solr

First, rename the /opt/solr/solr/collection1 to an understandable name like apples (use whatever name you'd like). (This can be skipped if you installed it using apt-get. In that case, you can execute the following command instead: cd /usr/share/solr):

Also, if you installed Solr manually, open the file core.properties (nano core.properties) and change the name to the same name.

Then, remove the data directory and change the schema.xml:

Paste your own schema.xml in here. There is a very advanced schema.xml in the Solr Repository. You can probably find a lot more of them on the internet, but I won't go into depth about that. Restart Jetty/Tomcat:

For the simple installation.

For the advanced installation.

When you now visit your Solr instance, you should see the Dashboard with the collection somewhere.

Conclusion

You have now successfully installed Solr and can start using it for your own site! If you don't know how to make a schema.xml, find a tutorial on how to do that. Then, find a library for your programming language that connects with Solr.

Drupal Apache Solr

Submitted by: Koen Vlaswinkel





broken image