码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu 18.04 LTS 安装 Elasticsearch6.x

时间:2018-08-31 21:18:56      阅读:899      评论:0      收藏:0      [点我收藏+]

标签:ppa   pen   chown   led   tps   更改   jdk   emctl   第一步   

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

标签:ppa   pen   chown   led   tps   更改   jdk   emctl   第一步   

原文地址:https://www.cnblogs.com/tcppdu/p/9567608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!