See:
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/deb.html#deb-repo
Commands on a console:
{CODE(colors="shell")}
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get update && sudo apt-get install elasticsearch
{CODE}
Ubuntu 16.04 uses systemd, as it can be queried with:
{CODE()}
ps -p 1
{CODE}
Running Elasticsearch with systemd
To configure Elasticsearch to start automatically when the system boots up, run the following commands:
{CODE(colors="shell")}
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
{CODE}
Info provided in the console standard output:
{QUOTE()}
Synchronizing state of elasticsearch.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
{QUOTE}
Elasticsearch can be started and stopped as follows:
{CODE(colors="shell")}
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
{CODE}
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 ~np~--quiet~/np~ 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:
{CODE(colors="shell")}
sudo journalctl -f
{CODE}
To list journal entries for the elasticsearch service:
{CODE(colors="shell")}
sudo journalctl --unit elasticsearch
{CODE}
To list journal entries for the elasticsearch service starting from a given time:
{CODE(colors="shell")}
sudo journalctl --unit elasticsearch --since "2016-10-30 18:17:16"
{CODE}
Check man journalctl or https://www.freedesktop.org/software/systemd/man/journalctl.html for more command line options.
See:
* https://www.elastic.co/guide/en/kibana/5.0/install.html
* https://www.elastic.co/guide/en/kibana/5.0/deb.html
If you don't have that yet, see above to get the gpg-key, the apt-transport-https package and the repository url.
Commands on a console:
{CODE(colors="shell")}
sudo apt-get install elasticsearch
{CODE}
Running Kibana with systemd
To configure Elasticsearch to start automatically when the system boots up, run the following commands:
{CODE(colors="shell")}
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service
{CODE}
Info provided in the console standard output:
{QUOTE()}
Synchronizing state of kibana.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable kibana
{QUOTE}
Kibana can be started and stopped as follows:
{CODE(colors="shell")}
sudo systemctl start kibana.service
sudo systemctl stop kibana.service
{CODE}
These commands provide no feedback as to whether Kibana was started successfully or not. Instead, this information will be written in the log files located in /var/log/kibana/.