1. AddElasticsearch GPG Key
The first step is to import the Elasticsearch GPG key using the following command:
wget -qo-https://artifacts.elastic.co/gpg-key-elasticsearch | sudo apt-key add-
2. Add Elasticsearch 6.x apt repository
In the second step, after importing the GPG key, add the APT repository:
echo"Deb https:////artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee-a/etc/apt/ Sources.list.d/elastic-6.x.list
3. Installing OPENJDK
The third step, Elasticsearch, is based on Java, so you need to install the JDK first
sudo add-apt-repository ppa:webupd8team/java sudosudo Install openjdk-8-jdk #安装jdk
4. Install Elasticsearch 6.x.
sudo Install Elasticsearch
when the installation is complete, enter /etc/elasticsearch/elasticsearch.yml
Configuration of parameters
If you don't get to the file, change or assign permissions to a normal user
sudo chown liuf2 elasticsearch/
After you modify the configuration, you can start Elasticsearch:
sudosudo systemctl restart Elasticsearch.service
Status check:
$sudosystemctl status Elasticsearch.service elasticsearch.service-Elasticsearch loaded:loaded (/usr/lib/systemd/system/Elasticsearch.service; Vendo active:inactive (dead) since Fri2018- ,- to +: in: .CST 1min 59s ago Docs:http://www.elastic.coProcess:32460Execstart=/usr/share/elasticsearch/bin/elasticsearch-P ${pid_d Main PID:32460(Code=exited, status=143) August to +: -: theLiuf2-virtual-machine systemd[1]: Started elasticsearch.8 Month to +: in: toLiuf2-virtual-machine systemd[1]: Stopping Elasticsearch ... August to +: in: .Liuf2-virtual-machine systemd[1]: Stopped Elasticsearch.
Ubuntu 18.04 LTS Installation elasticsearch6.x