Ubuntu 18.04 LTS 安装 Elasticsearch6.x
Posted tcppdu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu 18.04 LTS 安装 Elasticsearch6.x相关的知识,希望对你有一定的参考价值。
1. 添加Elasticsearch GPG Key
第一步,使用以下命令导入Elasticsearch GPG密钥:
$ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
2. 添加Elasticsearch 6.x APT存储库
第二步,导入GPG密钥后,添加apt存储库:
$ 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. 安装OpenJDK
第三步,Elasticsearch基于Java开发的,因此需要先安装JDK
$ sudo add-apt-repository ppa:webupd8team/java # 导入jdk密钥 $ sudo apt update #更新库缓存 $ sudo apt install openjdk-8-jdk #安装jdk
4. 安装Elasticsearch 6.x.
$ sudo apt install elasticsearch
安装完成后,进入 /etc/elasticsearch/elasticsearch.yml
进行参数配置
如果进入不到该文件,请将权限更改或者分配给普通用户
$ sudo chown liuf2 elasticsearch/
修改配置后,可以启动Elasticsearch:
$ sudo systemctl enable elasticsearch.service $ sudo systemctl restart elasticsearch.service
状态检查:
$ sudo systemctl status elasticsearch.service ● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo Active: inactive (dead) since Fri 2018-08-31 19:29:06 CST; 1min 59s ago Docs: http://www.elastic.co Process: 32460 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_D Main PID: 32460 (code=exited, status=143) 8月 31 19:14:09 liuf2-virtual-machine systemd[1]: Started Elasticsearch. 8月 31 19:29:05 liuf2-virtual-machine systemd[1]: Stopping Elasticsearch... 8月 31 19:29:06 liuf2-virtual-machine systemd[1]: Stopped Elasticsearch..
以上是关于Ubuntu 18.04 LTS 安装 Elasticsearch6.x的主要内容,如果未能解决你的问题,请参考以下文章