How to Setup Apache Solr on ubuntu machine step by step

You might have heard solar energy that right very powerful source of energy. But here we will discuss about Solr the most widely and best search tool in industry. It’s very fast and popular open source tool based on Java. From this tool we can fetch any content or perform search activity in quick seconds.

In this tutorial you’ll install using Solr on Ubuntu 18.04 . You’ll then work with Solr to index a page and later retrive using search engine.

Table of Content

  1. What is Solr
  2. Prerequisites
  3. How to Install Solr 8.2.0 on Ubuntu 18.04 LTS
  4. Conclusion

What is Solr ?

Solr is very efficient tool when it comes to search and real time indexing. It is very optimized for high volume of internet traffic. It is very highly scalable and fault tolerant. It has internal monitoring of its own instances as it publishes its own data via JMX. It provides lots of Extensible Plugin which are used for search as well as for indexing.

Solr can be installed on both windows as well as Unix based distributions. You index your data in Solr i.e. upload or put using JSON, XML or CSV or using http & later you can retrieve it using get http.

Prerequisites

  • Ubuntu machine preferably 18.04 version + , if you don’t have any machine you can create a ec2 instance on AWS account
  • Recommended to have 4GB RAM
  • At least 5GB of drive space
  • Java version 8 or 8+ ( If Java is not installed please follow me to next step else skip it )

You may incur a small charge for creating an EC2 instance on Amazon Managed Web Service.

  • Install Java Version 11 on ubuntu 18.04 machine
sudo apt install default-jdk  # Here we are installing Java Version: Java SE 11 (LTS)
java -version               # To check the Installed Java Version
which java :         # It will locate executable file location which is /usr/bin/java 

whereis java         # It will give the location  of all the files related to Java 

The Installation directory of Java is /usr/lib/jvm/java-1.8.0-openjdk-amd64 and this confirms that Java is successfully installed on our ubuntu 18.04 machine. Now, let us install Solr Engine.

How to Install Solr 8.2.0 on Ubuntu 18.04 LTS

  • Update your system packages.
sudo apt update
  • Lets change the directory and Download the Solr package
cd /opt

sudo wget https://archive.apache.org/dist/lucene/solr/8.2.0/solr-8.2.0.tgz
  • Your downloaded package will be in tarball format , Lets extract the tarball into the folder.
sudo tar xzf solr-8.2.0.tgz solr-8.2.0/bin/install_solr_service.sh --strip-components=2
  • Execute the the installer
 sudo ./install_solr_service.sh solr-8.2.0.tgz
  • Now, Solr should be up and running, you may verify by checking the status of Solr service.
sudo service solr stop
sudo service solr start
sudo service solr status
  • Solr should be running now, lets verify by opening a browser and enter : <ip-address>:8983/solr

Conclusion

You should now have a Apache Solr 8.2.0 instance running . Your Solr should now be ready to begin helping you manage your organization’s search.

Hope this tutorial will help you in understanding and setting up Apache Solr on ubuntu machine. Please share with your friends.

Advertisement

How to Install Jenkins on Ubuntu Machine Step by Step

Are you spending a lot of time deploying code in your infrastructure and with many steps and software? Don’t worry; you are at the right place to learn about the famous open-source tool Jenkins, which helps build and deploy the code with a click of a button and has various other benefits.

In this tutorial, you will learn what is Jenkins and how can you install Jenkins on ubuntu 18.04 and setup step by step. Still Interested?

Join 50 other followers

Table of Content

  1. What is Jenkins
  2. Prerequisites
  3. How to Install Java on ubuntu 18.04 machine
  4. How to Install Jenkins on Ubuntu 18.04 LTS
  5. How to setup Jenkins on ubuntu
  6. Workflow of Jenkins and Code deployment
  7. Conclusion

What is Jenkins?

Jenkins is an open-source automated CI/CD tool where CI stands for continuous integration and CD stands for Continuous delivery. Jenkins has its own built-in Java servlet container server, which is Jetty. Jenkins can also be run in different servlet containers such as Apache tomcat or glassfish.

  • Jenkins can be deployed to the local machine or premises data center, or any cloud.
  • Jenkins takes your code, any sort of code such as python, java, or go or JS, etc., and compiles it using different compilers such as MAVEN, one of the most used compilers, and then builds your code in war or Zip format and sometimes as a docker image.
  • Jenkins deploys the code when required and integrates easily with various third-party tools.

Related: Python Flask Tutorial: All about Python flask

Prerequisites

  • Ubuntu 18.0.4 machine preferably; if you don’t have any machine, you can create an ec2 instance on the AWS account.
  • It is recommended to have 4GB of RAM
  • At least 5GB of drive space

You may incur a small charge for creating an EC2 instance on Amazon Managed Web Service.

How to Install Java Version 11 on ubuntu 18.04 machine

Before you dive into the installation of Jenkins on your ubuntu machine, you will need Java as a prerequisite, without which Jenkins will not work. So, let’s begin and learn how to Install Java Version 11 on an Ubuntu 18.04 machine using a few basic steps.

  • Firstly, install java using the apt install command as shown below.
sudo apt install default-jdk  # Here we are installing Java Version: Java SE 11 (LTS)
  • Next, verify the java version on your machine.
java -version               # To check the Installed Java Version
Checking the Java version
Checking the Java version
  • Check the location of java by using the which and where command.
which java :         # It will locate executable file location which is /usr/bin/java 
whereis java         # It will give the location  of all the files related to Java 
Checking the Java location
Checking the Java location

The Installation directory of Java is /usr/lib/jvm/java-1.8.0-openjdk-amd64, and this confirms that Java is successfully installed on our ubuntu 18.04 machine. Now, let us install Jenkins.

How to Install Jenkins on Ubuntu 18.04 LTS

Now that you have Java installed on your ubuntu machine. Now, it’s time to install Jenkins, an easier and more straightforward task. Let’s dive in to install Jenkins on Ubuntu 18.04 LTS machine.

  • First, update your system packages on the ubuntu machine using the below command.
sudo apt update
  • Next, add Jenkins Public key to your system so that this key can trust the jenkins.io site to download the repository or any packages.
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
  • Now, add the Jenkins repository to your system and update your system.
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
  • Now install the Jenkins package using the apt-get command.
sudo apt-get install jenkins

As of now, Jenkins service should be up and running. To check the status of Jenkins, run the below command as shown.

service jenkins status
Checking the Java Service status
Checking the Java Service status

How to setup Jenkins on ubuntu

Now that you have installed Jenkins on your ubuntu machine successfully and verified by running the service command. But the installation is just an initial stage; you will need to set the Jenkins to make it work properly. Let’s learn step by step how to set Jenkins instance.

  • Open the Jenkins instance on your favorite web browser by going to <Jenkins-installation-server-ip-address>:8080.
  • As soon as the URL is opened, it will prompt for the administrator password. The password can be found on /var/lib/Jenkins/secrets/initialAdminPassword directory, as shown below.
Unlocking the Jenkins initial password
Unlocking the Jenkins initial password
  • Now obtain the password by going to the Jenkins server and viewing the following content.
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  • After successfully adding the Jenkins admin password, you will be prompted for Plugins installation. We will select the Install Suggested Plugins option as this is the demo.
Installing Plugins in Jenkins
Installing Plugins in Jenkins
Plugins installing and Jenkins getting started
Plugins installing and Jenkins getting started.
  • Once the plugins are successfully installed, then it will prompt to create a First admin user. Please fill in the required information and keep it safe with you, as you will use this later to log in.
Creating first Admin User in Jenkins
Creating the first Admin User in Jenkins
  • Now Jenkins URL configuration screen will appear, and you can keep the default URL as it is and click on save and finish.
Configuring the Jenkins Instance
Configuring the Jenkins Instance
Jenkins is ready to be used
Jenkins is ready to be used.
  • Now Jenkins instance is ready for use. Click “Start using Jenkins.” After you click, you will see Jenkins Dashboard, where you create New Jobs by clicking on New Item.
Jenkins Dashboard
Jenkins Dashboard

Workflow of Jenkins deployment

This section is an additional section that provides you a basic overview of how a Jenkins deployment happens step by step and what Jenkins can do for you. Let’s get into it.

  • Once Jenkins is installed, install plugins as per the requirement, whether terraform, bitbucket, python, blue-ocean, etc.
  • Jenkins is configured so that it can fetch the code from any of the repositories such as GIT, bitbucket, SVN, or TFS.
  • Once you define the code repository, Jenkins pulls the code, compiles it using plugins if required, and later builds it. You can include a few test cases along with a build to test some functionalities of code.
  • Later you deploy the code on required environments such as AWS, GCP, Windows machines, Linux machines, etc.
Jenkins deployments workflow
Jenkins deployments workflow

Join 50 other followers

Conclusion

In this tutorial, you learned what Jenkins is, how to install Java on the ubuntu 18.04 machine, how to Install Jenkins on Ubuntu 18.04 LTS, and how to set up Jenkins on ubuntu and setup.

Jenkins is a handy tool for CI and CD purposes and is most widely used, which helps manage your organization’s deployments.

Now that you have Jenkins installed and set up, which application are you planning to deploy?