Configure Elasticsearch settings

After you have installed Elasticsearch, you can configure the service settings. To learn more about configuring Elasticsearch and the location of the config directory, see Configuring Elasticsearch.

The following are optional when setting up an Elasticsearch host for P4 Search:

  • By default, Elasticsearch is accessible only on localhost.

    To expose a specific node on the network, set network.host to a different address in the elasticsearch.yml file, as shown in the following example:

    network.host: 10.1.2.3

    where network.host specifies the IP address of the Elasticsearch server.

  • By default, Elasticsearch listens for HTTP traffic on the first free port it finds, starting at 9200.

    Set http.port to a specific HTTP port, as shown in the following example:

    http.port: 9200

    where http.port specifies the port number of the Elasticsearch host.

    To learn more, see the Network module documentation.

  • To run discovery when a node is started, pass an initial list of one or more hosts.

    For example:

    discovery.seed_hosts: ["host1"]

    The default list of hosts is ["127.0.0.1", "[::1]"]

  • You can bootstrap the cluster using an initial set of master-eligible nodes.

    For example:

    cluster.initial_master_nodes: ["node-1"]

    To learn more, see the discovery and cluster formation module documentation on Discovery and cluster formation.

  • In your jvmoptions file, remove the xms and xmx settings. On Ubuntu, this file can be found in:

    /usr/share/elasticsearch/config/

Related topics