Setting up Elastic Search on
Ubuntu Server from scratch
By: Rahul Agarwal
Sr. web developer at
Gaadi.com
Overview
● Requirement
● Solution
● Set up server
● Install Apache
● Install PHP,JAVA
● Install Elastic Search server,Composer
● Install Elastic Search PHP API
● Test php scripts with elastic search api
Requirement
● Setting Up Elastic Search on the server.
With PHP and Apache server for front end
connection.
● Setting up on Ubuntu server.
Solution
● Elastic Search configured on any new
ubuntu server.
Set up server
● Configured new server.
● Run “sudo apt-get update" on server.
Install Apache
● Run “sudo apt-get install apache2"
Install PHP
● Run “sudo apt-get install php5 libapache2-
mod-php5"
Restart Server
● Run “sudo service apache2 restart"
Test PHP
● Run “php -r 'echo "nnYour PHP installation
is working fine.nnn";' "
Install Java
● Run “add-apt-repository -y
ppa:webupd8team/java"
● Run "apt-get update"
● Run "apt-get install oracle-java8-installer"
Install ElasticSearch server
● Run “sudo wget -qO -
https://packages.elastic.co/GPG-KEY-
elasticsearch | sudo apt-key add -"
● Run "echo "deb
http://packages.elastic.co/elasticsearch/2.x/
debian stable main" | sudo tee -a
/etc/apt/sources.list.d/elasticsearch-2.x.list"
● Run "sudo apt-get update"
● Run "sudo apt-get -y install elasticsearch"
Install ElasticSearch server
● Run "sudo nano
/etc/elasticsearch/elasticsearch.yml"
● You will want to restrict outside access to
your Elasticsearch instance (port 9200), so
outsiders can't read your data or shutdown
your Elasticsearch cluster through the HTTP
API. Find the line that specifies
network.host, uncomment it, and replace its
value with "localhost" so it looks like this:
● network.host: localhost
Install ElasticSearch server
● Save and exit elasticsearch.yml.
● Run "sudo service elasticsearch restart"
● Then run the following command to start
Elasticsearch on boot up:
● Run “ sudo update-rc.d elasticsearch
defaults 95 10"
Set up Elastic Search PHP files
● Run "cd /var/www/html"
● Upload composer file “composer.json” on the
folder /var/www/html
● Run
● curl -s http://getcomposer.org/installer | php
● php /root/composer.phar install –no-dev
● sudo apt-get install php5-curl
● sudo service apache2 restart
Test Elastic Search
● Run “curl -X GET 'http://localhost:9200' "
Test basic connection files
● Upload insert.php,out.txt,search.php on
/var/www/html folder
● Go to browser and hit insert.php
● Go to browser and hit search.php and search
google
Composer.json
{
"require": {
"elasticsearch/elasticsearch": "~2.0"
}
}
Insert .php
Search . php
Out.txt

More Related Content

PPTX
Ansible intro
PDF
How to install nginx vs unicorn
PDF
[Js hcm] Deploying node.js with Forever.js and nginx
PPT
Nodejs quick start
PPTX
nginx + uwsgi emperor + bottle
PDF
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
PDF
Ajenti control panel
PPTX
Simple webapps with nginx, uwsgi emperor and bottle
Ansible intro
How to install nginx vs unicorn
[Js hcm] Deploying node.js with Forever.js and nginx
Nodejs quick start
nginx + uwsgi emperor + bottle
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Ajenti control panel
Simple webapps with nginx, uwsgi emperor and bottle

What's hot (18)

TXT
Intalacion de owncloud
ODP
Continuous delivery of Windows micro services in the cloud
PDF
How to contribute Apache CloudStack
PDF
Test Kitchen and Infrastructure as Code
PPTX
uWSGI - Swiss army knife for your Python web apps
PDF
Nginx维护手册
DOCX
Oracle WebLogic
PDF
Depende, ¿de qué depende? - Plain Concepts Dev Day
PPTX
Node.js in a heterogeneous system
PDF
How install nagios in ubuntu 15.04, 16.04
PPT
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
PPTX
Infrastructure development on windows ldn cd meetup
PDF
PDF
How To Disable IE Enhanced Security Windows PowerShell
PDF
Ansible Crash Course
PDF
Installation elasticsearch + kibana
TXT
Commands
PDF
Nginx3
Intalacion de owncloud
Continuous delivery of Windows micro services in the cloud
How to contribute Apache CloudStack
Test Kitchen and Infrastructure as Code
uWSGI - Swiss army knife for your Python web apps
Nginx维护手册
Oracle WebLogic
Depende, ¿de qué depende? - Plain Concepts Dev Day
Node.js in a heterogeneous system
How install nagios in ubuntu 15.04, 16.04
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Infrastructure development on windows ldn cd meetup
How To Disable IE Enhanced Security Windows PowerShell
Ansible Crash Course
Installation elasticsearch + kibana
Commands
Nginx3
Ad

Viewers also liked (20)

PDF
(Elastic)search in big data
PPTX
quick intro to elastic search
PPTX
Elastic search Walkthrough
PPTX
An Introduction to Elastic Search.
PPSX
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
PDF
Introduction to Elasticsearch
PDF
Elastic Search
PDF
Elastic search & patent information @ mtc
PDF
Simple search with elastic search
PPTX
Power of Elastic Search - nLocate
PPTX
Ricerche performanti con ElasticSearch sfruttando la potenza e la flessibilit...
PDF
Elk - Elasticsearch Logstash Kibana stack explained
PPTX
Elastic Search Indexing Internals
PDF
Logstash: Progetto open per l'analisi dei log in tempo reale di architetture ...
PPTX
Webinar usando graylog para la gestión centralizada de logs
PDF
Amministratori Di Sistema: Adeguamento al Garante Privacy - Log Management e ...
PPT
Lucene basics
ODP
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
PPT
How ElasticSearch lives in my DevOps life
PDF
Advanced troubleshooting linux performance
(Elastic)search in big data
quick intro to elastic search
Elastic search Walkthrough
An Introduction to Elastic Search.
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
Introduction to Elasticsearch
Elastic Search
Elastic search & patent information @ mtc
Simple search with elastic search
Power of Elastic Search - nLocate
Ricerche performanti con ElasticSearch sfruttando la potenza e la flessibilit...
Elk - Elasticsearch Logstash Kibana stack explained
Elastic Search Indexing Internals
Logstash: Progetto open per l'analisi dei log in tempo reale di architetture ...
Webinar usando graylog para la gestión centralizada de logs
Amministratori Di Sistema: Adeguamento al Garante Privacy - Log Management e ...
Lucene basics
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
How ElasticSearch lives in my DevOps life
Advanced troubleshooting linux performance
Ad

Similar to Elastic search (20)

PPTX
Nginx as a Revers Proxy for Apache on Ubuntu
PDF
Making Spinnaker Go @ Stitch Fix
PDF
Nicolas-Embleton - Deploying node.js with forever and nginx
PDF
Automating Complex Setups with Puppet
PDF
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
PPT
Ansible presentation
PDF
How to install Setup & Configure SSH Jump Server on a Linux box
PDF
Ansible is the simplest way to automate. SymfonyCafe, 2015
PDF
Deploying your rails application to a clean ubuntu 10
PPTX
Start tracking your ruby infrastructure
PPT
Calico with open stack and chef
PPTX
2-Setting Up Servers of apache and kali linux.pptx
PDF
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
PDF
Using Puppet in Small Infrastructures
PDF
Automating complex infrastructures with Puppet
PDF
Chef solo the beginning
PDF
Installing Lamp Stack on Ubuntu Instance
DOCX
How to install and configure LEMP stack
PDF
Swift configurator installation-manual
KEY
Cooking with Chef
Nginx as a Revers Proxy for Apache on Ubuntu
Making Spinnaker Go @ Stitch Fix
Nicolas-Embleton - Deploying node.js with forever and nginx
Automating Complex Setups with Puppet
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Ansible presentation
How to install Setup & Configure SSH Jump Server on a Linux box
Ansible is the simplest way to automate. SymfonyCafe, 2015
Deploying your rails application to a clean ubuntu 10
Start tracking your ruby infrastructure
Calico with open stack and chef
2-Setting Up Servers of apache and kali linux.pptx
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Using Puppet in Small Infrastructures
Automating complex infrastructures with Puppet
Chef solo the beginning
Installing Lamp Stack on Ubuntu Instance
How to install and configure LEMP stack
Swift configurator installation-manual
Cooking with Chef

Recently uploaded (20)

PDF
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
PDF
Performance, energy consumption and costs: a comparative analysis of automati...
PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PDF
Module 1 part 1.pdf engineering notes s7
PPTX
Solar energy pdf of gitam songa hemant k
PDF
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
PPTX
Wireless sensor networks (WSN) SRM unit 2
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
PPT
Basics Of Pump types, Details, and working principles.
PPT
Programmable Logic Controller PLC and Industrial Automation
PDF
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
PPTX
Design ,Art Across Digital Realities and eXtended Reality
PPT
Unit - I.lathemachnespct=ificationsand ppt
PDF
IAE-V2500 Engine for Airbus Family 319/320
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PPTX
SE unit 1.pptx aaahshdhajdviwhsiehebeiwheiebeiev
PPTX
SC Robotics Team Safety Training Presentation
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PPT
Comprehensive Java Training Deck - Advanced topics
PPTX
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
Performance, energy consumption and costs: a comparative analysis of automati...
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
Module 1 part 1.pdf engineering notes s7
Solar energy pdf of gitam songa hemant k
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
Wireless sensor networks (WSN) SRM unit 2
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
Basics Of Pump types, Details, and working principles.
Programmable Logic Controller PLC and Industrial Automation
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
Design ,Art Across Digital Realities and eXtended Reality
Unit - I.lathemachnespct=ificationsand ppt
IAE-V2500 Engine for Airbus Family 319/320
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
SE unit 1.pptx aaahshdhajdviwhsiehebeiwheiebeiev
SC Robotics Team Safety Training Presentation
AI-Reporting for Emerging Technologies(BS Computer Engineering)
Comprehensive Java Training Deck - Advanced topics
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS

Elastic search

  • 1. Setting up Elastic Search on Ubuntu Server from scratch By: Rahul Agarwal Sr. web developer at Gaadi.com
  • 2. Overview ● Requirement ● Solution ● Set up server ● Install Apache ● Install PHP,JAVA ● Install Elastic Search server,Composer ● Install Elastic Search PHP API ● Test php scripts with elastic search api
  • 3. Requirement ● Setting Up Elastic Search on the server. With PHP and Apache server for front end connection. ● Setting up on Ubuntu server.
  • 4. Solution ● Elastic Search configured on any new ubuntu server.
  • 5. Set up server ● Configured new server. ● Run “sudo apt-get update" on server.
  • 6. Install Apache ● Run “sudo apt-get install apache2"
  • 7. Install PHP ● Run “sudo apt-get install php5 libapache2- mod-php5"
  • 8. Restart Server ● Run “sudo service apache2 restart"
  • 9. Test PHP ● Run “php -r 'echo "nnYour PHP installation is working fine.nnn";' "
  • 10. Install Java ● Run “add-apt-repository -y ppa:webupd8team/java" ● Run "apt-get update" ● Run "apt-get install oracle-java8-installer"
  • 11. Install ElasticSearch server ● Run “sudo wget -qO - https://packages.elastic.co/GPG-KEY- elasticsearch | sudo apt-key add -" ● Run "echo "deb http://packages.elastic.co/elasticsearch/2.x/ debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list" ● Run "sudo apt-get update" ● Run "sudo apt-get -y install elasticsearch"
  • 12. Install ElasticSearch server ● Run "sudo nano /etc/elasticsearch/elasticsearch.yml" ● You will want to restrict outside access to your Elasticsearch instance (port 9200), so outsiders can't read your data or shutdown your Elasticsearch cluster through the HTTP API. Find the line that specifies network.host, uncomment it, and replace its value with "localhost" so it looks like this: ● network.host: localhost
  • 13. Install ElasticSearch server ● Save and exit elasticsearch.yml. ● Run "sudo service elasticsearch restart" ● Then run the following command to start Elasticsearch on boot up: ● Run “ sudo update-rc.d elasticsearch defaults 95 10"
  • 14. Set up Elastic Search PHP files ● Run "cd /var/www/html" ● Upload composer file “composer.json” on the folder /var/www/html ● Run ● curl -s http://getcomposer.org/installer | php ● php /root/composer.phar install –no-dev ● sudo apt-get install php5-curl ● sudo service apache2 restart
  • 15. Test Elastic Search ● Run “curl -X GET 'http://localhost:9200' "
  • 16. Test basic connection files ● Upload insert.php,out.txt,search.php on /var/www/html folder ● Go to browser and hit insert.php ● Go to browser and hit search.php and search google