Will & Skill Developers

Will & Skill Developers


Thoughts, snippets and ideas from the team at Will & Skill AB, Stockholm.

Faisal Mahmud
Author

“The mind is not a vessel to be filled, but a fire to be kindled.” ― Plutarch

Share


How to install ElasticSearch 2.x on Ubuntu 16.04 in under 1 minute

Faisal MahmudFaisal Mahmud

I have found a simple way to install ElasticSearch on Ubuntu 16.04.

Please follow the steps described below

  1. Copy paste the lines below into a file named elasticsearch-installer.sh or whatever You prefer
  2. Run $ chmod +x elasticsearch-installer.sh
  3. Run $ ./elasticsearch-installer.sh
### Install Java
sudo add-apt-repository ppa:webupd8team/java  
sudo apt-get update  
sudo apt-get install oracle-java8-installer -y  
java -version

### Download and install the Public Signing Key
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list

### Install Elasticsearch
sudo apt-get update && sudo apt-get install elasticsearch -y

# Start elasticsearch
sudo service elasticsearch start

# Wait 10 seconds
sleep 10

### Make sure service is running
curl http://localhost:9200  

If the install was successful You should see something like the snippet below

{
  "name" : "Moon-Boy",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ePUCMPjgQkW1bj5ZttOYGg",
  "version" : {
    "number" : "2.4.4",
    "build_hash" : "fcbb46dfd45562a9cf00c604b30849a6dec6b017",
    "build_timestamp" : "2017-01-03T11:33:16Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

TIP: Run the command below to see what version of Ubuntu You are running

$ lsb_release -a

It should return something like the snippet below

No LSB modules are available.  
Distributor ID: Ubuntu  
Description:    Ubuntu 16.04.2 LTS  
Release:        16.04  
Codename:       xenial  
Faisal Mahmud
Author

Faisal Mahmud

“The mind is not a vessel to be filled, but a fire to be kindled.” ― Plutarch

Comments