add-apt-repository adds entries to the system /etc/apt/sources.list file
rather than a clean per-repository file in /etc/apt/sources.list.d

add-apt-repository is not part of the default install on many distributions
and requires a number of non-default dependencies.

Older versions of add-apt-repository always add a deb-src entry which
will cause errors because we do not provide a source package. If you have added
the deb-src entry, you will see an error like the following until you delete
the deb-src line:

Elasticsearch is not started automatically after installation. How to start
and stop Elasticsearch depends on whether your system uses SysV init or
systemd (used by newer distributions). You can tell which is being used by
running this command:

These commands provide no feedback as to whether Elasticsearch was started
successfully or not. Instead, this information will be written in the log
files located in /var/log/elasticsearch/.

By default the Elasticsearch 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.

When systemd logging is enabled, the logging information are available using
the journalctl commands:

To tail the journal:

sudo journalctl -f

To list journal entries for the elasticsearch service:

sudo journalctl --unit elasticsearch

To list journal entries for the elasticsearch service starting from a given time:

Elasticsearch defaults to using /etc/elasticsearch for runtime configuration.
The ownership of this directory and all files in this directory are set to
root:elasticsearch on package installation and the directory has the setgid
flag set so that any files and subdirectories created under /etc/elasticsearch
are created with this ownership as well (e.g., if a keystore is created using
the keystore tool). It is expected that this be maintained so
that the Elasticsearch process can read the files under this directory via the
group permissions.

Elasticsearch loads its configuration from the
/etc/elasticsearch/elasticsearch.yml file by default. The format of this
config file is explained in Configuring Elasticsearch.

The Debian package also has a system configuration file (/etc/default/elasticsearch),
which allows you to set the following parameters:

JAVA_HOME

Set a custom Java path to be used.

MAX_OPEN_FILES

Maximum number of open files, defaults to 65536.

MAX_LOCKED_MEMORY

Maximum locked memory size. Set to unlimited if you use the
bootstrap.memory_lock option in elasticsearch.yml.

MAX_MAP_COUNT

Maximum number of memory map areas a process may have. If you use mmapfs
as index store type, make sure this is set to a high value. For more
information, check the
linux kernel documentation
about max_map_count. This is set via sysctl before starting
Elasticsearch. Defaults to 262144.

Configure restart on package upgrade, defaults to false. This means you
will have to restart your Elasticsearch 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.

Distributions that use systemd require that system resource limits be
configured via systemd rather than via the /etc/sysconfig/elasticsearch
file. See Systemd configuration for more information.