ELK Stack最新版本测试一安装篇

版本

filebeat1.0.0-rc2  logstash2.0.0-1  elasticsearch2.0.0  kibana4.2

名词解释

Elasticsearch              存储索引

Kibana                       UI

Kibana dashboard      可视化思维图

Logstash Input Beats plugin     收集事件

Elasticsearch output plugin       发送事务

Filebeat                     日志数据托运人shipper

Topbeat                    轻量级服务器监控

Packetbeat                在线网络数据包分析

架构

一,客户端安装

filebeat架构

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-getting-started.html#filebeat-installation

nginx日志客户端安装filebeat

安装filebeat

curl  -L  -O https://download.elastic.co/beats/filebeat/filebeat-1.0.0-rc2-x86_64.rpm

rpm-vi filebeat-1.0.0-rc2-x86_64.rpm

配置filebeat

/etc/filebeat/filebeat.yml

Filebeat configuration:

filebeat:
  prospectors:
    -
      paths:
        - "/var/log/*.log"
      fields:
        type: syslog
output:
  elasticsearch:
    enabled: true
    hosts: ["http://localhost:5043"]

启动filebeat

[[email protected] filebeat]# curl -XPUT ‘http://192.168.0.58:9200/_template/filebeat?pretty‘ [email protected]/etc/filebeat/filebeat.template.json
{
  "acknowledged" : true

}

topbeat

https://www.elastic.co/guide/en/beats/topbeat/current/topbeat-getting-started.html

curl -L -O  https://download.elastic.co/beats/topbeat/topbeat-1.0.0-rc2-x86_64.rpm

rpm -vih topbeat-1.0.0-rc2-x86_64.rpm

packetbeat

https://www.elastic.co/guide/en/beats/packetbeat/current/packetbeat-getting-started.html

yum install libpcap

curl -L -O https://download.elastic.co/beats/packetbeat/packetbeat-1.0.0-rc2-x86_64.rpm

rpm -vi packetbeat-1.0.0-rc2-x86_64.rpm

二,服务器端安装

安装elk

https://www.elastic.co/guide/en/beats/libbeat/1.0.0-rc2/getting-started.html#logstash-setup

既可以分析日志,又可以监控服务器状态,还可以分析http协议等网络数据包。

elasticearch安装

yum install java-1.7.0-openjdk

curl -L -O https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.0.0.rpm

rpm -ivh elasticsearch-2.0.0.rpm

配置启动

cat /etc/elasticsearch/elasticsearch.yml  |grep -Ev "^$|^#"
path.data: /data
path.logs: /data/elklogs

network.host: 192.168.0.58

chmod elasticsearch:elasticsearch /data/elasticsearch/ -R

chmod elasticsearch:elasticsearch /data/elklogs/ -R

service elasticsearch start

测试elasticearch

[[email protected] ~]# curl http://127.0.0.1:9200
{
  "name" : "Redwing",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.0.0",
    "build_hash" : "de54438d6af8f9340d50c5c786151783ce7d6be5",
    "build_timestamp" : "2015-10-22T08:09:48Z",
    "build_snapshot" : false,
    "lucene_version" : "5.2.1"
  },
  "tagline" : "You Know, for Search"

}

logstash安装(102.131)

curl  -L  -O https://download.elastic.co/logstash/logstash/packages/centos/logstash-2.0.0-1.noarch.rpm

rpm -ivh logstash-2.0.0-1.noarch.rpm

logstash配置

cat nginxconf.json

input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
    hosts => "192.168.0.58:9200"
    sniffing => true
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }

}

kibana安装

curl  -L  -O https://download.elastic.co/kibana/kibana/kibana-4.2.0-linux-x64.tar.gz

tar xzvf kibana-4.2.0-linux-x64.tar.gz

cd kibana-4.2.0-linux-x64/

./bin/kibana

先修改kibana.yml 可设置端口号,elaticsearch

mv  kibana-4.2.0-linux-x64 /var/kibana

nohup /var/kibana/bin/kibana -e  http://192.168.0.58:9200 &

log   [13:14:14.588] [info][status][plugin:kibana] Status changed from uninitialized to green - Ready
  log   [13:14:14.617] [info][status][plugin:elasticsearch] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log   [13:14:14.630] [info][status][plugin:kbn_vislib_vis_types] Status changed from uninitialized to green - Ready
  log   [13:14:14.639] [info][status][plugin:markdown_vis] Status changed from uninitialized to green - Ready
  log   [13:14:14.646] [info][status][plugin:metric_vis] Status changed from uninitialized to green - Ready
  log   [13:14:14.655] [info][status][plugin:spyModes] Status changed from uninitialized to green - Ready
  log   [13:14:14.658] [info][status][plugin:statusPage] Status changed from uninitialized to green - Ready
  log   [13:14:14.661] [info][status][plugin:elasticsearch] Status changed from yellow to green - Kibana index ready

log   [13:14:14.663] [info][status][plugin:table_vis] Status changed from uninitialized to green - Ready

log   [13:14:14.675] [info][listening] Server running at http://0.0.0.0:5601

kibana dashboard加载

curl  -L  -O http://download.elastic.co/beats/dashboards/beats-dashboards-1.0.0-rc2.tar.gz

tar xzvf beats-dashboards-1.0.0-rc2.tar.gz

cd beats-dashboards-1.0.0-rc2/

./load.sh

./load.sh  http://192.168.0.58:9200
curl
Loading search Cache-transactions:
{"_index":".kibana","_type":"search","_id":"Cache-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search DB-transactions:

{"_index":".kibana","_type":"search","_id":"DB-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}

curl 192.168.0.58:9200/_cat/indices
yellow open .kibana             1 1   93 0  69kb  69kb

yellow open filebeat-2015.11.18 5 1 4109 0 2.9mb 2.9mb

时间: 2024-08-05 11:00:14

ELK Stack最新版本测试一安装篇的相关文章

ELK Stack最新版本测试二配置篇

阅读本文前请浏览 ELK Stack最新版本测试一安装篇 http://jerrymin.blog.51cto.com/3002256/1720109 详细配置如下: 一,客户端 1,nginx日志格式 log_format logstash_json '{ "@timestamp": "$time_iso8601", '                         '"host": "$server_addr", '  

利用Apache Bench进行压力测试(安装篇)

前言 API性能测试是企业级开发中非常重要的一环,API性能测试个人总结起来比较关注的两个点为: API在并发下是否会产生数据异常,比如秒杀系统的超买超卖 API极限情况下的QPS/TPS 目前比较流行的性能测试工具有LoaderRunner.Apache Bench.JMeter等,个人针对这三款性能测试工具都使用了一下,使用的感觉是: LoaderRunner是功能最强大的,压力测试后的各种报告什么都有,但是商用版本装一下时间比较长也比较麻烦,也有一定学习成本,上手用熟练需要一定时间 JMe

升级ELK到最新版本

线上ELK运行一段时间了,但是各种小问题不断,logstash经常挂掉,kibana查询缓慢等等,现在决定升级ELK组件到最新版本,看看效果. 一 升级Elasticsearch Elasticsearch原来的版本是1.7.1,Elasticsearch最新版本是2.3.3 在升级之前首先查看的就是官方文档关于升级的注意事项 1.查看Breaking Changes说明 Elasticsearch的升级总体原则就是: 大版本升级需要重启整个Elasticsearch集群 小版本升级可以一次升级

Linux下Mysql 的编译安装最新版本5.6.24和详细部署

  MySQL 5.6正式版发布了,相对于5.5版本作出了不少改进,其源码安装配置方式也有所变化,本文根据实际操作,不断尝试,精确还原了安装的具体步骤. 安装MySQL前,先确认卸载系统自带数据库 打开操作终端 输入rpm -qa|grep mysql(罗列所有数据库相关的文件) rpm –e (罗列出来的文件)--nodeps(使用该命令依次删除罗列出来的文件)--nodeps为删除与之依赖的文件. 确认Internet连接正常,以便下载安装文件. 先使用 yum -y update 指令升级

Centos7上 Nginx + ELK Stack +Kafka + Filebeat 实战 一

之前有导读部分内容,介绍了elk的及kafka的前世今生及优点,各位客官可以点击这里访问,欢迎大家批评指正交流学习共同进步:(http://blog.51cto.com/seekerwolf/2085891)OS:Centos 7 ELK Stack : 6.2.2 安装方式:源码安装我的日志收集系统是基于这样的架构来做,前端代理使用Nginx,然后是ELK 的全家桶,文件收集使用filebeat来搞定:一,系统优化,在安装ES 的主机上需要作如下系统级别的优化工作,不然启动ElasticSea

最新版本elasticsearch本地搭建入门篇

最新版本elasticsearch本地搭建入门篇 项目介绍 最近工作用到elasticsearch,主要是用于网站搜索,和应用搜索. 工欲善其事,必先利其器. 自己开始关注elasticsearch,当下最新版本的elastic,安装过程中踩了不少坑(百度出来都是 老版本),于是就整理了一下,以简单的图解方式分享给最近开始学习elastic的,少踩不必要坑,直接开始上手使用REST API,提高学习效率,值为更好的自己. elasticsearch初识-安装篇 elastic Product A

安装最新版本的kubernets(+安装插件dashboard)

一.安装docker // 安装系统工具: sudo yum install -y yum-utils device-mapper-persistent-data lvm2 // 添加docker yum repo信息: sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo // 更新并安装 docker: sudo yum makecache fast

如何在CentOS 7 / Fedora 31/30/29上安装ELK Stack

原文地址:https://computingforgeeks.com/how-to-install-elk-stack-on-centos-fedora/ 原作者: Josphat Mutai 译者:高行行 如何在 CentOS 7 / Fedora 31/30/29 上安装 ELK Stack?" ELK "是 Elasticsearch, Logstash, and Kibana 的缩写. Elasticsearch:这是一个开源的.基于 REST 和 JSON 的搜索引擎.它具有

Elasticsearch最新版本2.20特性及如何安装

版本选择:Elasticsearch最新版本2.20 Elasticsearch的更新速度实在太快了,16年2月2日更新到了2.2版本,首先看一下这个版本增加了哪些新的特性.首先是基于Lucene 5.4.1,修复了Elasticsearch 2.1.2和Elasticsearch 1.7.5版本中存在的很多bug,同时Elasticsearch 2.2.0增加了两个很棒的新功能:查询分析器和增强地理位置字段.这个版本增加了更加严格的安全性和修复了2.1的一个重大bug,就是在分片恢复的时候会非