centos安装elasticsearch

  • 安装JDK yum install -y java-1.8.0-openjdk
  • 下载安装公钥 rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  • 配置yum源 vim /etc/yum.repos.d/elasticsearch.repo,s触发编辑,复制如下内容:
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

按键ESC退出编辑,:wq保存退出。

  • yum makecache更新缓存
  • 执行下载安装yum install elasticsearch
  • 设置支持公网访问,vim /etc/elasticsearch/elasticsearch.yml,设置network.host: 0.0.0.0.
  • 启动服务
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
上一篇:Elastic Stack学习(二)


下一篇:分布式调度引擎 elastic-job3 源码分析 (四) 核心服务 I