Skip to content

Commit

Permalink
Merge pull request #1734 from HansBambel/use-https-per-default
Browse files Browse the repository at this point in the history
Use https protocol in local nodes per default
  • Loading branch information
dadoonet committed Dec 11, 2023
2 parents 7fe1edb + a626f0a commit 1e0b10e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions docs/source/admin/fs/elasticsearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ Node settings
^^^^^^^^^^^^^

FSCrawler is using elasticsearch REST layer to send data to your
running cluster. By default, it connects to ``http://127.0.0.1:9200``
which is the default when running a local node on your machine.
running cluster. By default, it connects to ``https://127.0.0.1:9200``
which is the default when running a local node on your machine.
Note that using ``https`` requires SSL Configuration set up.
For more information, read :ref:`ssl`.

Of course, in production, you would probably change this and connect to
a production cluster:
Expand All @@ -231,7 +233,7 @@ a production cluster:
name: "test"
elasticsearch:
nodes:
- url: "http://mynode1.mycompany.com:9200"
- url: "https://mynode1.mycompany.com:9200"
If you are using `Elasticsearch service by Elastic <https://www.elastic.co/cloud/elasticsearch-service>`_,
you can just use the ``Cloud ID`` which is available in the Cloud Console and paste it:
Expand All @@ -257,12 +259,12 @@ You can define multiple nodes:
name: "test"
elasticsearch:
nodes:
- url: "http://mynode1.mycompany.com:9200"
- url: "http://mynode2.mycompany.com:9200"
- url: "http://mynode3.mycompany.com:9200"
- url: "https://mynode1.mycompany.com:9200"
- url: "https://mynode2.mycompany.com:9200"
- url: "https://mynode3.mycompany.com:9200"
.. note::
.. versionadded:: 2.2 you can use HTTPS instead of default HTTP.
.. versionadded:: 2.2 you can use HTTPS instead of HTTP.

.. code:: yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class Elasticsearch {

protected static final Logger logger = LogManager.getLogger(Elasticsearch.class);
public static final ServerUrl NODE_DEFAULT = new ServerUrl("http://127.0.0.1:9200");
public static final ServerUrl NODE_DEFAULT = new ServerUrl("https://127.0.0.1:9200");

private List<ServerUrl> nodes = Collections.singletonList(NODE_DEFAULT);
private String index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ private void defaultSettingsTester(FsSettings settings) {
assertThat(settings.getElasticsearch().getIndex(), is("test"));
assertThat(settings.getElasticsearch().getIndexFolder(), is("test_folder"));
assertThat(settings.getElasticsearch().getNodes(), iterableWithSize(1));
assertThat(settings.getElasticsearch().getNodes().get(0).getUrl(), is("http://127.0.0.1:9200"));
assertThat(settings.getElasticsearch().getNodes().get(0).getUrl(), is("https://127.0.0.1:9200"));
assertThat(settings.getElasticsearch().getNodes().get(0).getCloudId(), is(nullValue()));
assertThat(settings.getElasticsearch().getNodes().get(0).decodedUrl(), is("http://127.0.0.1:9200"));
assertThat(settings.getElasticsearch().getNodes().get(0).decodedUrl(), is("https://127.0.0.1:9200"));

assertThat(settings.getElasticsearch().getUsername(), is(nullValue()));
assertThat(settings.getElasticsearch().getPassword(), is(nullValue()));
Expand Down

0 comments on commit 1e0b10e

Please sign in to comment.