ELK环境搭建

作者: 梦想天空分为蓝 | 来源:发表于2016-08-05 14:58 被阅读413次

说明:
1.基础环境
Centos7,jdk7

2.本次使用的版本
Elasticsearch:1.6.2
Logstash:2.3.4
Kibana:3.1.3

一、 下载elk三大组件
Elasticsearch下载地址: https://www.elastic.co/downloads/elasticsearch (目前最新版本:2.1.1)
Logstash下载地址: https://www.elastic.co/downloads/logstash (目前最新版本:2.1.1)
Kibana下载地址: https://www.elastic.co/downloads/kibana (目前最新版本:4.3.1)

二、 启动elasticsearch

2.1 配置及启动
打开conf/elasticsearch.yml
添加
http.cors.enabled: true
http.cors.allow-origin: "/.*/"
为kibana访问elasticsearch配置
进入elasticsearch目录\bin
./elasticsearch start &
启动成功后,在浏览器输入http://ip:9200看到如下输出,说明安装正确
{
"status" : 200,
"name" : "Illyana Rasputin",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.6.2",
"build_hash" : "622039121e53e5f520b5ff8720fdbd3d0cb5326b",
"build_timestamp" : "2015-07-29T09:24:47Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
2.2 安装插件
在bin目录下输入
./plugin list查看当前插件列表
./plugin install pluginName

三、 logstash的启动与配置
3.1 在logstash主目录下创建conf目录,再在conf下创建logstash.conf
编辑logstash.conf
内容如下:
input{
tcp {
host => "127.0.0.1"
port => 9999
mode => "server"
tags => ["tags"]
codec => json_lines
}
stdin{}
}

output{
stdout{
codec => rubydebug
}
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "test"
}
}

3.2 启动
在logstash 的bin目录下,输入
./logstash agent -f ../conf/logstash.conf
稍等片刻,如果看到Logstash startup completed,则表示启动成功。然后另开一个终端窗口,随便找个文本编辑工具(比如:vi),向/var/opt/log/a.log里写点东西,比如:hello world之类,然后保存。观察logstash的终端运行窗口,是否有东西输出,如果有以下类似输出
{
"message" => "hello world",
"@version" => "1",
"@timestamp" => "2016-01-08T14:35:16.834Z",
"host" => "yangjunmingdeMacBook-Pro.local",
"path" => "/var/opt/log/a.log"
}

四,kibana配置及启动
4.1修改配置文件
在kibana主目录下编辑config.js
修改elasticsearch: http://ip:9200
4.2启动
下载并解压tomcat
将kibana重命名
Mv kibana-3.1.3 kibana
Cp -r kibana apache-tomcat
启动tomcat
在浏览器访问http://ip:8080/kibana

看到如下界面则安装成功

Paste_Image.png

相关文章

  • Elasticsearch 基础概念

    搭建ELK 集群,和准备环境 搭建我的ELK 7.2 文档(Document) Elasticsearch 是面...

  • ELK 搭建及实战

    ELK 搭建及实战 JDK1.8环境搭建和Kibana实战部署 ELK介绍和JDK1.8环境搭建 实战环境 Cen...

  • ELK基础 环境搭建

    一、ELK基础环境简介: ELK环境是一个日志分析系统 1、ELK基础环境搭建用到的组件:elasticsearc...

  • Elasticsearch 的基本CRUD 操作

    搭建ELK 集群,和准备环境 搭建我的ELK 7.2Elasticsearch 的基本概念 Elasticsear...

  • ELK日志管理系统搭建

    搭建ELK日志管理(Elasticsearch,Logstash,Kibana) 搭建环境要求 docker,do...

  • 基于 ELK + Filebeat 搭建日志中心

    基于ELK+Filebeat搭建日志中心本文是基于docker进行的容器化搭建ELK当前环境系统:centos7d...

  • docker-compose搭建ELK环境

    docker-compose搭建ELK环境 环境信息 CentOS 7.4 系统 Docker version 1...

  • ELK环境搭建

    一、配置 注:由于实验性搭建,选择windows系统,但选择Linux系统效果更佳 二、部署方案 1.ELK+Re...

  • ELK环境搭建

    说明:1.基础环境Centos7,jdk7 2.本次使用的版本Elasticsearch:1.6.2Logstas...

  • ELK环境搭建

    ELK环境配置 log_stash 2.2.0es 2.2.0kibana 4.4.0jre 1.8四个包内网都有...

网友评论

    本文标题:ELK环境搭建

    本文链接:https://www.haomeiwen.com/subject/vkwhsttx.html