elasticsearch+metricbeat+kibana安装配置

来源:互联网 发布:网络视听制作许可证 编辑:程序博客网 时间:2024/06/05 09:33

elasticsearch+metricbeat+kibana安装配置

软件官网下载地址:

https://www.elastic.co/downloads点击打开链接

iP1:192.168.199.128
iP2:192.168.199.129

一、安装:

  • 安装JDK1.8以上版本

yum install java-1.8.0-openjdk.x86_64

  • 安装elasticsearch

rpm -ivh elasticsearch-5.4.0.rpm 

  • 安装kibana

rpm -ivh kibana-5.4.0-x86_64.rpm

  • 安装metricbeat

rpm -ivh metricbeat-5.4.0-x86_64.rpm


二、配置:

  • 修改elasticsearch配置文件

vim /etc/elasticsearch/elasticsearch.yml 

cluster.name: my-application

node.master: true

node.name: node-1

bootstrap.system_call_filter:false

network.host: 192.168.199.128

http.port: 9200

discovery.zen.ping.unicast.hosts:["192.168.199.128","192.168.199.129”]


修改elasticsearch最大线程数

vi /etc/security/limits.conf,末尾处加入如下参数:

elasticsearch - nproc 2048


启动elasticsearch

/etc/init.d/elasticsearch start 


 启动成功后,执行如下命令,查看集群

curl -XGET'http://192.168.199.128:9200/_cluster/health?pretty'


 *说明:

启动时会报一个WARN级别错误:seccomp unavailable,这个错误不会影响es的正常使用,有关说明请参考:https://discuss.elastic.co/t/ upgrading-es-from-1-7-1-to-2-x-issue/35997。

 

  • 修改kibana配置文件

vim /etc/kibana/kibana.ym

server.port: 5601

server.host: "192.168.199.128"

elasticsearch.url: "http://192.168.199.128:9200"

 启动kibana

/etc/init.d/kibana start


  • 修改metricbeat配置文件

vim /etc/metricbeat/metricbeat.yml

修改

output.elasticsearch:

  hosts: ["192.168.199.128:9200"]

 

修改hosts字段,填写被监控机IP地址

# Array of hosts to connectto.

  hosts: ["192.168.199.199:9200"]

 

启动metricbeat

/etc/init.d/metricbeat start 启动服务


三、 配置kibana管理页面

安装结束后,登录kibana管理页面(http://192.168.199.128:5601)

1.创建索引

   索引用“metricbeat-*”

2.导入自带的dashboard模板

/usr/share/metricbeat/scripts/import_dashboards -es http://192.168.199.128:9200


内容待续。。。。。。。。


 附录

 常用命令

1.集群状态:

curl -XGET'http://192.168.199.123:9200/_cluster/health?pretty'

2.查看所有节点:

curl'192.168.199.123:9200/_cat/nodes?v'

3.查看所有索引:

curl '192.168.199.123:9200/_cat/indices?v'

4.删除索引:

curl -XDELETE'localhost:9200/customer?pretty'

5._search搜索:

URL                              说明

/_search                       搜索所有的索引和类型

/gb/_search                  搜索索引gb中的所有类型

/gb,us/_search               搜索索引gb以及us中的所有类型

/g*,u*/_search                搜索所有以g或u开头的索引中的所有类型

/gb/user/_search             搜索索引gb中类型user内的所有文档

/gb,us/user,tweet/_search    搜索索引gb和 索引us中类型user以及类型tweet内的所有文档

/_all/user,tweet/_search     搜索所有索引中类型为user以及tweet内的所有文档

6._search分页搜索:

GET /_search?size=5&from=10

7._search查询精简语句:

GET/_all/tweet/_search?q=tweet:elasticsearch

GET/_all/tweet/_search?q=+name:john +tweet:mary

 

*前缀"+"表示必须要满足我们的查询匹配条件,而前缀"-"则表示绝对不能匹配条件。没有+或者-的表示可选条件。

kibana常用功能

discover :用于交互式探索数据,可以通过一下命令语句查看服务器的一些状态

Visualize:数据可视化(将收集来的信息,通过图形的模式显示出来)

Dashboard:仪表盘(将可视化的图形,统一的规制在一起显示出来)

 

常用网址

https://www.elastic.co/learn

https://www.gitbook.com/book/chenryn/elk-stack-guide-cn/details

http://shgy.gitbooks.io/mastering-elasticsearch/content/

http://zhaoyanblog.com/archives/732.html

 


0 0
原创粉丝点击