Book Image

ElasticSearch Cookbook

By : Alberto Paro
Book Image

ElasticSearch Cookbook

By: Alberto Paro

Overview of this book

Table of Contents (20 chapters)
ElasticSearch Cookbook Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up a node


ElasticSearch allows you to customize several parameters in an installation. In this recipe, we'll see the most-used ones in order to define where to store data and improve performance in general.

Getting ready

You need a working ElasticSearch installation.

How to do it...

Perform the following steps to set up a simple node:

  1. Open the config/elasticsearch.yml file with an editor of your choice.

  2. Set up the directories that store your server data:

    • For Linux or Mac OS X:

      path.conf: /opt/data/es/conf
      path.data: /opt/data/es/data1,/opt2/data/data2
      path.work: /opt/data/work
      path.logs: /opt/data/logs
      path.plugins: /opt/data/plugins
    • For Windows:

      path.conf: c:\Elasticsearch\conf
      path.data: c:\Elasticsearch\data
      path.work: c:\Elasticsearch\work
      path.logs: c:\Elasticsearch\logs
      path.plugins: c:\Elasticsearch\plugins
  3. Set up parameters to control the standard index creation. These parameters are:

    index.number_of_shards: 5
    index.number_of_replicas: 1

How it works...

The path.conf parameter defines...