您的位置:首页 > 其它

ELK -elasticsearch

2016-06-01 19:47 218 查看
简介
安装

配置文件

启动

elasticsearch-servicewrapper 插件
安装启动服务

使用服务

简介

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: