gerrit/gerrit-pgm
David Pursehouse 479c50ba28 Elasticsearch: Simplify configuration of servers
Instead of configuring each server in its own section with separate
values for protocol, host and port, i.e.:

  [elasticsearch "elastic1"]
    hostname = elastic1
    protocol = https
    port = 1234

  [elasticsearch "elastic2"]
    hostname = elastic2
    protocol = https
    port = 1234

Configure them all under the main "elasticsearch" section as multiple
values, i.e.

  [elasticsearch]
    server = https://elastic1:1234
    server = https://elastic2:1234

Allow the port to be omitted, and default it to 9200.

Require at least one server to be explicitly configured and throw a
provision exception if there are none.

During init prompt for the server, defaulting to http://localhost:9200.

Since the init framework doesn't support reading or setting string lists,
if there are multiple server values it will prompt the last one. Mention
in the documentation that configuration of multiple servers must be done
manually.

Since it is not expected that Elasticsearch is being used in production
anywhere, no backwards compatibility with the previous configuration is
provided. Users must adjust their configuration to the new format.

Add a new test, ElasticConfigurationTest, which in this initial version
only tests the configuration of the elasticsearch.server. More tests may
be added in follow-up commits.

Bug: Issue 9372
Bug: Issue 9383
Change-Id: Iad2c547ae82ba89b7ede777072e0869bc77d2025
2018-07-04 13:35:52 +09:00
..