码迷,mamicode.com
首页 > 其他好文 > 详细

centos安装Elasticsearch

时间:2018-11-10 00:08:35      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:osi   for   com   测试   minimum   work   centos安装   sudo   命令   

一、yum安装:

  1. 在/etc/yum.repos.d/目录创建文件elasticsearch.repo

  2. 添加以下内容

[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

  3. 执行yum命令:sudo yum install elasticsearch -y

  4. 设置开机启动:sudo chkconfig --add elasticsearch

  5. 启动:sudo -i service elasticsearch start

    -- 关闭 sudo -i service elasticsearch stop

    -- 重启 sudo -i service elasticsearch restart

二、测试项目是否运行

  -- curl -X GET ‘http://localhost:9200/?pretty‘  

  返回结果类似如下显示:

{
  "name" : "Cp8oag6",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
  "version" : {
    "number" : "6.4.3",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "f27399d",
    "build_date" : "2016-03-30T09:51:41.449Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "1.2.3",
    "minimum_index_compatibility_version" : "1.2.3"
  },
  "tagline" : "You Know, for Search"
} 

三、更改配置,增加远程访问

  -- 配置文件目录:/etc/elasticsearch/

  -- elasticsearch.yml文件增加如下属性:

    - network.host: 0.0.0.0

 

centos安装Elasticsearch

标签:osi   for   com   测试   minimum   work   centos安装   sudo   命令   

原文地址:https://www.cnblogs.com/maduar/p/9937672.html

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