XenonStack Recommends

Big Data Engineering

Apache Solr Search Engine and Architecture

Navdeep Singh Gill | 21 May 2024

Apache Solr Search Engine and Architecture

Overview of Apache Solr

Apache Solr is an application based on J2EE and uses Lucene libraries internally to provide user-friendly search as well as to generate the indexes. Solr is scalable, highly reliable and fault tolerant, providing replication, distributed indexing and load-balanced querying, recovery and automated failover, centralized configuration, and more. Solr powers the navigation and search features of internet sites.

A data warehouse system in an open Hadoop platform that is used for data analysis, summarization, and querying of the large data systems. Click to explore about, Apache Hive Data warehouse

What are the features of Apache Solr?

Apache Solr has the following features -
  • Highly Scalable and Fault Tolerant
  • Easy Monitoring
  • Comprehensive Administration Interfaces
  • Optimized for High Volume Traffic
  • Advanced Full-Text Search Capabilities
  • Extensible Plugin Architecture
  • Near Real-Time Indexing
  • Flexible and Adaptable with easy configuration
  • Standards-Based Open Interfaces - XML, JSON and HTTP

Explore Fully Managed Apache Solr Support Services and Solr Managed Solutions for On-Premises and cloud environments - AWS, GCP and Azure

What is the architecture of Apache Solr?

  • Request handlers processed request Handler -The requests made to Solr. The requests might be index update requests or query requests.
  • Search Component - Search component is a feature of search provided by Solr. It might be a query, spell checking, hit highlighting, etc.
  • Query Parser - The parser parses the queries that we pass to Solr and verifies for syntactical errors.
  • Response Writer - Response writer generates the formatted output for user queries.
  • Analyzer/Tokenizer - In Solr, an analyzer examines the text of fields and generates a Token Stream.
  • Update Request Processor - Update Request Processor is used for modifications such as adding a field, dropping in a field, etc.

An open source distributed object storage server written in Go, designed for Private Cloud infrastructure providing S3 storage functionality Click to explore about, Minio Distributed Object Storage Architecture

Apache Solr Security

Apache Solr can be secured by following methods - Enable Plugins with security.json Using security.json with Solr
  • In Standalone Mode
  • In SolrCloud Mode
Authentication
  • Enabling a Plugin
  • Available Authentication Plugins
Authorization
  • Loading a Custom Plugin
  • Available Authorization Plugins
Securing Inter-Node Requests PKI Authentication Plugin Enabling SSL If using SolrCloud, ZooKeeper Access Control

Installation of Apache Solr on AWS

You can install Apache Solr on AWS EC2 instance by doing the following steps -

Connect to your instance, using SSH.

ssh -i /path/to/key-pair.pem ec2-user@ec2-196-41-100-1.compute-1.amazonaws.com

Configure Java and download Solr

# verify default java version packaged with AWS instances is 1.7
$ java -version
$ sudo yum install java-1.8.0
$ sudo /usr/sbin/alternatives --config java
# select jdk-1.8
# verify default java version to java-1.8
$ java -version
# download desired version of Solr
$ wget http://archive.apache.org/dist/lucene/solr/7.2.0/solr-7.2.0.tgz
# untar
$ tar -zxvf solr-7.2.0.tgz
# set SOLR_HOME
$ export SOLR_HOME=$PWD/solr-7.2.0
# put the env variable in .bashrc
# vim ~/.bashrc
export SOLR_HOME=/home/ec2-user/solr-7.2.0

Change public DNS to hostname

Edit /etc/hosts, and add entries:
$ sudo vim /etc/hosts
54.3.2.1 solr-node-1

Configure Solr

$ cd $SOLR_HOME 1. # start Solr node on 8983 and connect to ZooKeeper running on first node $ bin/solr start -c -p 8983 -h solr-node-2 -z solr-node-1:9983

Inspect and verify Solr nodes from browser

Go to-http://ec2-121-3-2-1.us-east-2.compute.amazonaws.com:8983/solr (solr-node-
1:8983/solr)

A Holistic Strategy

A Highly Scalable distributed infrastructure helps Enterprises to enable AutoScaling, efficient Data Handling and building Extensive reporting interfaces. To know more about distributed platforms we recommend taking the following steps -