本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn

ELK是进行日志收集分析用的,具体工作、原理、作用自行google。该文只是我简单的一个搭建笔记。
[参照]:http://my.oschina.net/itblog/blog/547250

JDK安装

$ tar zxvf jdk-7u76-linux-x64.tar.gz -C  /usr/local
$ cd /usr/local
$ mv jdk1..0_21 jdk1.
vi ~/.bash_profile
JAVA_HOME=/usr/local/jdk1.
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:$JAVA_HOME/bin

安装ElasticSearch

wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.2.0/elasticsearch-2.2.0.tar.gz
tar -zxvf elasticsearch-2.2..tar.gz
cd elasticsearch-2.2.

安装Head插件(Optional):

./bin/plugin install mobz/elasticsearch-head

然后编辑ES的配置文件:

vi config/elasticsearch.yml

cluster.name=es_cluster
node.name=node0
path.data=/tmp/elasticsearch/data
path.logs=/tmp/elasticsearch/logs
#当前hostname或IP,我这里是centos2
network.host=centos2
network.port=

其他的选项保持默认,然后启动ES:

./bin/elasticsearch

访问:

http://192.168.10.141:9200/
http://192.168.10.141:9200/_plugin/head/

安装Logstash

wget https://download.elastic.co/logstash/logstash/logstash-2.2.2.tar.gz

配置Logstash:

tar -zxvf logstash-2.2..tar.gz
cd logstash-2.2. mkdir config
vi config/log4j_to_es.conf
输入以下内容: # For detail structure of this file
# Set: https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html
input {
# For detail config for log4j as input,
# See: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-log4j.html
log4j {
mode => "server"
host => "192.168.10.141"
port =>
}
}
filter {
#Only matched data are send to output.
}
output {
# For detail config for elasticsearch as output,
# See: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html
elasticsearch {
action => "index"#The operation on ES
hosts => "192.168.10.141:9200" #ElasticSearch host, can be array.
index => "ec" #The index to write data to, can be any string.
}
}

因此使用agent来启动它(使用-f指定配置文件):

./bin/logstash agent -f config/log4j_to_es.conf

安装Kibana

wget https://download.elastic.co/kibana/kibana/kibana-4.4.1-linux-x64.tar.gz

配置Kibana:

tar -zxvf kibana-4.4.-linux-x64.tar.gz
cd kibana-4.4.-linux-x64

修改以下几项(由于是单机版的,因此host的值也可以使用localhost来代替,这里仅仅作为演示):

vi config/kibana.yml

server.port:
server.host: “centos2”
elasticsearch.url: http://centos2:9200
kibana.index: “.kibana”

启动kibana:

./bin/kibana

后面用浏览器打开kibana,http://IP:5601 进行一步一步配置

最新文章

  1. ASP.NET Core 中文文档 第二章 指南(4.3)添加 View
  2. Data scientist———java实现常见的机器学习代码(跟百度深度学习研究院师兄学机器学习)
  3. Nginx配置文件nginx.conf中文详解
  4. dpkg: 处理归档 /var/cache/apt/archives/软件名 (--unpack)时出错:由于已经达到 MaxReports 限制,没有写入 apport 报告。
  5. m.Tomcat使用openssl走APR通道配置单向和双向认证
  6. openstack新建虚机、网络、路由时候对应的ovs网桥的变化
  7. js从0开始构思表情插件
  8. IOS第18天(10,核心动画-转盘,自定义buton,旋转动画)
  9. Conjugate prior relationships
  10. volatile 用法
  11. 剑指offer系列35----序列化二叉树
  12. Jack Straws(判断线段是否相交 + 并查集)
  13. java沙箱机制原理
  14. CallableStatement执行存储过程
  15. 实验吧Web-天网管理系统
  16. StatefulSet
  17. WinForm中在非UI线程更改控件值的办法
  18. 2018ddctf wp
  19. 机器人meta标签和X-Robots-Tag HTTP标头规格
  20. ngRouter和ui-router区别

热门文章

  1. vue 入门第一课
  2. [sklearn]官方例程-Imputing missing values before building an estimator 随机填充缺失值
  3. two Pass方法连通域检测
  4. 【绘图技巧】ps快捷键的用法
  5. Thrift compiler代码生成类解析
  6. xen虚拟机(Centos6.6)的创建和扩容
  7. jdbc参数
  8. ajax实现异步校验
  9. 针对Chrome谷歌等浏览器不再支持showModalDialog的解决方案
  10. 细说Django的admin