Skip to content

Commit 9aaa01a

Browse files
committed
so much stuff
1 parent c79b7f5 commit 9aaa01a

26 files changed

+1091
-1031
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{es}} loads its configuration from the following location by default:
2+
3+
```
4+
{{es-conf}}{{slash}}elasticsearch.yml
5+
```
6+
7+
The format of this config file is explained in [](/deploy-manage/deploy/self-managed/configure-elasticsearch.md).
8+
9+
Any settings that can be specified in the config file can also be specified on the command line, using the `-E` syntax as follows:
10+
11+
```sh
12+
.\bin\elasticsearch.bat -Ecluster.name=my_cluster -Enode.name=node_1
13+
```
14+
15+
:::{note}
16+
Values that contain spaces must be surrounded with quotes. For instance `-Epath.logs="C:\My Logs\logs"`.
17+
:::
18+
19+
:::{tip}
20+
Typically, any cluster-wide settings (like `cluster.name`) should be added to the `elasticsearch.yml` config file, while any node-specific settings such as `node.name` could be specified on the command line.
21+
::::
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
The `/etc/elasticsearch` directory contains the default runtime configuration for {{es}}. The ownership of this directory and all contained files are set to `root:elasticsearch` on package installations.
22

3-
The `setgid` flag applies group permissions on the `/etc/elasticsearch` directory to ensure that {{es}} can read any contained files and subdirectories. All files and subdirectories inherit the `root:elasticsearch` ownership. Running commands from this directory or any subdirectories, such as the [elasticsearch-keystore tool](../../security/secure-settings.md), requires `root:elasticsearch` permissions.
3+
The `setgid` flag applies group permissions on the `/etc/elasticsearch` directory to ensure that {{es}} can read any contained files and subdirectories. All files and subdirectories inherit the `root:elasticsearch` ownership. Running commands from this directory or any subdirectories, such as the [elasticsearch-keystore tool](/deploy-manage/security/secure-settings.md), requires `root:elasticsearch` permissions.
44

5-
{{es}} loads its configuration from the `/etc/elasticsearch/elasticsearch.yml` file by default. The format of this config file is explained in [*Configuring {{es}}*](configure-elasticsearch.md).
5+
{{es}} loads its configuration from the `/etc/elasticsearch/elasticsearch.yml` file by default. The format of this config file is explained in [](/deploy-manage/deploy/self-managed/configure-elasticsearch.md).
66

77
The {{distro}} package also has a system configuration file (`/etc/sysconfig/elasticsearch`), which allows you to set the following parameters:
88

9-
`ES_JAVA_HOME`
10-
: Set a custom Java path to be used.
11-
12-
`ES_PATH_CONF`
13-
: Configuration file directory (which needs to include `elasticsearch.yml`, `jvm.options`, and `log4j2.properties` files); defaults to `/etc/elasticsearch`.
14-
15-
`ES_JAVA_OPTS`
16-
: Any additional JVM system properties you may want to apply.
17-
18-
`RESTART_ON_UPGRADE`
19-
: Configure restart on package upgrade, defaults to `false`. This means you will have to restart your {{es}} instance after installing a package manually. The reason for this is to ensure, that upgrades in a cluster do not result in a continuous shard reallocation resulting in high network traffic and reducing the response times of your cluster.
9+
| Parameter | Description |
10+
| --- | --- |
11+
| `ES_JAVA_HOME` | Set a custom Java path to be used. |
12+
| `ES_PATH_CONF` | Configuration file directory (which needs to include `elasticsearch.yml`, `jvm.options`, and `log4j2.properties` files); defaults to `/etc/elasticsearch`. |
13+
| `ES_JAVA_OPTS` | Any additional JVM system properties you may want to apply. |
14+
| `RESTART_ON_UPGRADE` | Configure restart on package upgrade, defaults to `false`. This means you will have to restart your {{es}} instance after installing a package manually. The reason for this is to ensure, that upgrades in a cluster do not result in a continuous shard reallocation resulting in high network traffic and reducing the response times of your cluster. |
2015

2116
::::{note}
22-
Distributions that use `systemd` require that system resource limits be configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch` file. See [Systemd configuration](setting-system-settings.md#systemd) for more information.
17+
Distributions that use `systemd` require that system resource limits be configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch` file. See [Systemd configuration](/deploy-manage/deploy/self-managed/setting-system-settings.md#systemd) for more information.
2318
::::
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
::::{note}
2+
{{es}} includes a bundled version of [OpenJDK](https://openjdk.java.net) from the JDK maintainers (GPLv2+CE). To use your own version of Java, see the [JVM version requirements](installing-elasticsearch.md#jvm-version).
3+
::::
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Before you install {{es}}, do the following:
2+
3+
* Review the [supported operating systems](https://www.elastic.co/support/matrix). {{es}} is tested on the listed platforms, but it is possible that it will work on other platforms too.
4+
* Configure your operating system using the [](/deploy-manage/deploy/self-managed/important-system-configuration.md) guidelines.

deploy-manage/deploy/self-managed/_snippets/security-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
When you install {{es}}, the following certificates and keys are generated in the {{es}} configuration directory, which are used to connect a {{kib}} instance to your secured {{es}} cluster and to encrypt internode communication. The files are listed here for reference.
1+
When you install {{es}}, the following certificates and keys are generated in the {{es}} configuration directory. These files are used to connect a {{kib}} instance to your secured {{es}} cluster and to encrypt internode communication. The files are listed here for reference.
22

33
`http_ca.crt`
44
: The CA certificate that is used to sign the certificates for the HTTP layer of this {{es}} cluster.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
::::{note}
2-
On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g., `vm.max_map_count`); you can skip this by masking the systemd-sysctl.service unit.
2+
On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g., `vm.max_map_count`). You can skip this by masking the `systemd-sysctl.service` unit.
33
::::
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
::::{warning}
2+
**DO NOT USE THESE INSTRUCTIONS FOR PRODUCTION DEPLOYMENTS**
3+
4+
The instructions on this page are for **local development only**. Do not use this configuration for production deployments, because it is not secure. Refer to [deployment options](../../get-started/deployment-options.md) for a list of production deployment options.
5+
6+
::::
7+
8+
Quickly set up {{es}} and {{kib}} in Docker for local development or testing, using the [`start-local` script](https://github.com/elastic/start-local?tab=readme-ov-file#-try-elasticsearch-and-kibana-locally).
9+
10+
This setup comes with a one-month trial license that includes all Elastic features. After the trial period, the license reverts to **Free and open - Basic**. Refer to [Elastic subscriptions](https://www.elastic.co/subscriptions) for more information.
11+
12+
## Prerequisites [local-dev-prerequisites]
13+
14+
* If you don’t have Docker installed, [download and install Docker Desktop](https://www.docker.com/products/docker-desktop) for your operating system.
15+
* If you’re using Microsoft Windows, then install [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install).
16+
17+
## Run `start-local` script [local-dev-quick-start]
18+
19+
To set up {{es}} and {{kib}} locally, run the `start-local` script:
20+
21+
```sh
22+
curl -fsSL https://elastic.co/start-local | sh
23+
```
24+
25+
This script creates an `elastic-start-local` folder containing configuration files and starts both {{es}} and {{kib}} using Docker.
26+
27+
After running the script, you can access Elastic services at the following endpoints:
28+
29+
* **{{es}}**: [http://localhost:9200](http://localhost:9200)
30+
* **{{kib}}**: [http://localhost:5601](http://localhost:5601)
31+
32+
The script generates a random password for the `elastic` user, and an API key, stored in the `.env` file.
33+
34+
::::{warning}
35+
This setup is for local testing only. HTTPS is disabled, and Basic authentication is used for {{es}}. For security, {{es}} and {{kib}} are accessible only through `localhost`.
36+
37+
::::
38+
39+
## Learn more [local-dev-additional-info]
40+
41+
For more detailed information about the `start-local` setup, refer to the [README on GitHub](https://github.com/elastic/start-local). Learn about customizing the setup, logging, and more.
42+
43+
44+
## Next steps [local-dev-next-steps]
45+
46+
Use our [quick start guides](https://www.elastic.co/guide/en/elasticsearch/reference/current/quickstart.html) to learn the basics of {{es}}.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
By default, the {{es}} service doesn’t log information in the `systemd` journal. To enable `journalctl` logging, the `--quiet` option must be removed from the `ExecStart` command line in the `elasticsearch.service` file.
2+
3+
When `systemd` logging is enabled, the logging information are available using the `journalctl` commands:
4+
5+
To tail the journal:
6+
7+
```sh
8+
sudo journalctl -f
9+
```
10+
11+
To list journal entries for the elasticsearch service:
12+
13+
```sh
14+
sudo journalctl --unit elasticsearch
15+
```
16+
17+
To list journal entries for the elasticsearch service starting from a given time:
18+
19+
```sh
20+
sudo journalctl --unit elasticsearch --since "2016-10-30 18:17:16"
21+
```
22+
23+
Check `man journalctl` or [https://www.freedesktop.org/software/systemd/man/journalctl.html](https://www.freedesktop.org/software/systemd/man/journalctl.md) for more command line options.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
::::{admonition} Startup timeouts with older systemd versions
2+
:class: tip
3+
4+
By default {{es}} sets the `TimeoutStartSec` parameter to `systemd` to `900s`. If you are running at least version 238 of `systemd`, then {{es}} can automatically extend the startup timeout, and will do so repeatedly until startup is complete even if it takes longer than 900s.
5+
6+
Versions of `systemd` prior to 238 do not support the timeout extension mechanism and will terminate the {{es}} process if it has not fully started up within the configured timeout. If this happens, {{es}} will report in its logs that it was shut down normally a short time after it started:
7+
8+
```text
9+
[2022-01-31T01:22:31,077][INFO ][o.e.n.Node ] [instance-0000000123] starting ...
10+
...
11+
[2022-01-31T01:37:15,077][INFO ][o.e.n.Node ] [instance-0000000123] stopping ...
12+
```
13+
14+
However the `systemd` logs will report that the startup timed out:
15+
16+
```text
17+
Jan 31 01:22:30 debian systemd[1]: Starting {{es}}...
18+
Jan 31 01:37:15 debian systemd[1]: elasticsearch.service: Start operation timed out. Terminating.
19+
Jan 31 01:37:15 debian systemd[1]: elasticsearch.service: Main process exited, code=killed, status=15/TERM
20+
Jan 31 01:37:15 debian systemd[1]: elasticsearch.service: Failed with result 'timeout'.
21+
Jan 31 01:37:15 debian systemd[1]: Failed to start {{es}}.
22+
```
23+
24+
To avoid this, upgrade your `systemd` to at least version 238. You can also temporarily work around the problem by extending the `TimeoutStartSec` parameter.
25+
26+
::::
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
To configure {{es}} to start automatically when the system boots up, run the following commands:
2+
3+
```sh
4+
sudo /bin/systemctl daemon-reload
5+
sudo /bin/systemctl enable elasticsearch.service
6+
```

0 commit comments

Comments
 (0)