ELK介绍

ELK是三个开源软件的缩写,即elasticsearch、logstack、kibana。

Elasticsearch:开源分布式搜索引擎,提供搜集、分析、存储数据三大功能。它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格接口,多数据源,自动搜索负载等。(搜索引擎)

Logstash:主要是用来日志的搜集、分析、过滤日志的工具,支持大量的数据获取方式。一般工作方式为c/s架构,client端安装在需要收集日志的主机上,server端负责将收到的各节点日志进行过滤、修改等操作在一并发往elasticsearch上去。(日志搜集器)

Kibana :一个开源和免费的工具,Kibana可以为 Logstash 和 ElasticSearch 提供的日志分析友好的 Web 界面,可以帮助汇总、分析和搜索重要数据日志。(可视化)

利用ELK可替代原始的MySQL/Oracle + ECharts方案,极大减少人工成本。

背景

elasticsearch-5.5.2 rpm 包

5台机器搭建,IP分别为:

192.168.33.232   node4

192.168.33.233   node5

192.168.33.235   node7

192.168.33.236   node8

192.168.33.230   node11

其中 node4为主节点,结构为1主5从。

硬件:4C6G

软件:redhat7.4 jdk1.8.0_144

1. 系统设置(5台机器统一)

sed -e '$a vm.max_map_count = 262144' -i /etc/sysctl.conf

sysctl -p

echo "ulimit -SHn 1048576" >> /etc/rc.local

sed -e '$a DefaultLimitCORE=infinity\nDefaultLimitNOFILE=1048576\nDefaultLimitNPROC=1048576' -i /etc/systemd/system.conf

cat >> /etc/security/limits.conf << EOF

*           soft   nofile       1048576

*           hard   nofile       1048576

*           soft   nproc        1048576

*           hard   nproc        1048576

EOF

sed -i 's/4096/1048576/' /etc/security/limits.d/20-nproc.conf

sed -e '/root       soft    nproc     unlimited/a\*           soft   nofile       1048576\n*           hard   nofile       1048576' -i /etc/security/limits.d/20-nproc.conf

  1. 修改elasticsearch.yml文件

192.168.33.232   node4

#-----

cluster.name: es-application

node.name: node-1 #其他节点用另外的名称

network.host: 192.168.33.232 #其他节点写上对应的ip

http.port: 9200

http.cors.enabled: true

http.cors.allow-origin: "*"

node.master: true #其他节点改成false

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.33.232", "192.168.33.233","192.168.33.235","192.168.33.236","192.168.33.230"]#其他节点也写这个ip

bootstrap.system_call_filter: false

#----

192.168.33.233   node5

#-----

cluster.name: es-application

node.name: node-2 #其他节点用另外的名称

network.host: 192.168.33.233 #其他节点写上对应的ip

http.port: 9200

http.cors.enabled: true

http.cors.allow-origin: "*"

node.master: true #其他节点改成false

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.33.232", "192.168.33.233","192.168.33.235","192.168.33.236","192.168.33.230"]#其他节点也写这个ip

bootstrap.system_call_filter: false

#----

192.168.33.235   node7

#-----

cluster.name: es-application

node.name: node-3 #其他节点用另外的名称

network.host: 192.168.33.235 #其他节点写上对应的ip

http.port: 9200

http.cors.enabled: true

http.cors.allow-origin: "*"

node.master: true #其他节点改成false

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.33.232", "192.168.33.233","192.168.33.235","192.168.33.236","192.168.33.230"]#其他节点也写这个ip

bootstrap.system_call_filter: false

#----

192.168.33.236   node8

#-----

cluster.name: es-application

node.name: node-4 #其他节点用另外的名称

network.host: 192.168.33.236 #其他节点写上对应的ip

http.port: 9200

http.cors.enabled: true

http.cors.allow-origin: "*"

node.master: true #其他节点改成false

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.33.232", "192.168.33.233","192.168.33.235","192.168.33.236","192.168.33.230"]#其他节点也写这个ip

bootstrap.system_call_filter: false

#----

192.168.33.230   node11

#-----

cluster.name: es-application

node.name: node-5 #其他节点用另外的名称

network.host: 192.168.33.230 #其他节点写上对应的ip

http.port: 9200

http.cors.enabled: true

http.cors.allow-origin: "*"

node.master: true #其他节点改成false

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.33.232", "192.168.33.233","192.168.33.235","192.168.33.236","192.168.33.230"]#其他节点也写这个ip

bootstrap.system_call_filter: false

#----

至此,超级简单版本的elasticsearch1主5从的分布式集群搭建完毕。

测试:

-->查看集群监看状态

curl '192.168.33.232:9200/_cat/health?v'

-->查看集群节点

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

-->查看所有索引

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

界面:

最新文章

  1. Web大前端时代之:HTML5+CSS3入门系列
  2. input固定在底部
  3. WPF 札记
  4. mima开发实列
  5. QT中QWS的含义 (转至 宋金时的专栏
  6. javascript:让表单 文本框 只读,不可编辑的方法
  7. Oracle TNS配置浅析
  8. Codeforces Round #264 (Div. 2)
  9. 第三百二十八天 how can I 坚持
  10. log4cxx在linux下的编译和使用
  11. PHP操作Oracle数据库
  12. wpf Content数据绑定StringFormat起作用的原理和解决(转)
  13. 快速排序(Quicksort)的Javascript实现
  14. Cookie、sessionStorage、localStorage的区别
  15. Unity 利用UGUI打包图集,动态加载sprite资源
  16. 【原创】大数据基础之Flume(2)kudu sink
  17. ElasticSearch搜索解析
  18. 一种消息和任务队列——beanstalkd
  19. Vue 1组件的使用
  20. Windows Phone开发手记-WinRT下自定义圆形ItemsControl

热门文章

  1. 初探CSS - 5 创建
  2. 在docker容器中为elasticsearch配置跨域访问
  3. Maven项目构建利器05——Maven的生命周期
  4. 万兴神剪手 Wondershare Filmora v9.2.11.6 简体中文版
  5. MathType 7.4.2.480
  6. 五、vue中export和export default的使用
  7. Linux系统,无法收到组播消息的问题
  8. 线段树优化建图 || CF786B Legacy
  9. C#基础知识之理解Cookie和Session机制
  10. 一张图明白jenkins和docker作用