ELK -elasticsearch

简介

elasticsearch 是基于Apache Lucene 的搜索引擎。它是由API来驱动的,所有的行为都可以基于Restful API,用json来实现。


安装

安装elasticsearch 要尽量使用非root 用户,因为root用户是无法启动elasticsearch

  • 网址 https://www.elastic.co/downloads/elasticsearch
  • 相关文档 https://www.elastic.co/guide/index.html
  • 下载tar包安装 tar -zxvf tar包

配置文件

安装完成后只需修改config目录下的elasticsearch.yml 配置文件
注意:配置文件开头要有空格,配置项和对应值之间的冒号后面也要有空格

添加如下配置

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.timeout: 120s
client.transport.ping_timeout: 60s

修改如下配置

 cluster.name: my-application //集群的名字
 node.name: node-1 //当前机器的nodename
 discovery.zen.ping.unicast.hosts: ["ip", "ip2", "ip3"] //集群中node 的host 

要想别别的机器访问还需要配置

  network.host: IP1
  network.publish_host: IP1
  network.bind_host: IP1

启动

可以用bin/elasticsearch 启动,但这种并不是以服务的方式启动。


elasticsearch-servicewrapper 插件

https://github.com/elasticsearch/elasticsearch-servicewrapper下载该插件后,解压缩。将service目录拷贝到elasticsearch安装目录的bin目录下。

安装启动服务

sudo bin/service/elasticsearch install

使用服务

bin/service/elasticsearch start/stop/restart
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值