Skip to content

Installing Elasticsearch

Jack Shahhoud edited this page Jul 2, 2020 · 9 revisions

Configure Elasticsearch on Ubuntu 18.04

Prerequisites

You should have openJDK 11 installed on your machine.


Installing Elasticsearch

  1. Add the public GPG key to APT
 curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  1. Elasticsearch 6 will be installed, since FOSElasticaBundle supports currently Elasticsearch 6.
 echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
  1. Install Elasticsearch
 sudo apt update && sudo apt install elasticsearch
  1. Run sudo nano /etc/elasticsearch/elasticsearch.yml and Replace #network.host with network.host: localhost.
  2. Start Elasticsearch with sudo systemctl start elasticsearch, for auto start every time sudo systemctl enable elasticsearch .
  3. Run curl -X GET 'http://localhost:9200' for checking the connection with Elasticsearch.

FOSElasticaBundle

  • Run php bin/console fos:elastica:populate for creating indexes and php bin/console fos:elastica:reset for resetting indexes.
Clone this wiki locally