centos ELK安装
本文来自我的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 进行一步一步配置
centos ELK安装的更多相关文章
- ELK 安装Elasticsearch
章节 ELK 介绍 ELK 安装Elasticsearch ELK 安装Kibana ELK 安装Beat ELK 安装Logstash ELK栈要安装以下开源组件: Elasticsearch Ki ...
- NoSql1 在Linux(CentOS)上安装memcached及使用
前言: 今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...
- 在Ubuntu|CentOS上安装Shutter截图工具及快捷键设置
简介 Shutter前身叫GScrot,它是一款相当棒的截图软件. 通过Shutter,你可以截取包括选定区域.全屏幕.窗口.窗口内的控件甚至网页的图像.通过内置的强大插件机制,你可以在截图后,对图像 ...
- CentOS下安装hadoop
CentOS下安装hadoop 用户配置 添加用户 adduser hadoop passwd hadoop 权限配置 chmod u+w /etc/sudoers vi /etc/sudoers 在 ...
- CentOS下安装使用start-stop-daemon
CentOS下安装使用start-stop-daemon 在centos下下了个自启动的服务器脚本 执行的时候发现找不到start-stop-daemon命令 好吧 执行手动编译一下 加上这个命令 w ...
- CentOS 7 安装 Docker
CentOS 7 安装 Docker 这里介绍 ContOS 7 的安装 docker V1.2+,包括阿里云加速 docker 镜像下载的设置,这对提升使用 docker 体验至关重要.其他系统安装 ...
- centos在线安装svn
centos在线安装svn 用下列命令安装svn服务 yum install subversion 创建svn版本库目录 mkdir -p /var/svn/svnrepos 创建版本库 svnadm ...
- CentOS 7 安装 配置 MySQL
第一部分:CentOS 7安装MySQL 5.7 1.下载YUM库 shell > wget http://dev.mysql.com/get/mysql57-community-release ...
- 从零开始学 Java - CentOS 下安装 Nginx
早上下起了暴雨 闹钟还未响起就听到雨滴哗啦啦击打窗户的声音,被吵醒了.起床上班,在楼下的十字路口,暴雨大到完全看不清对面,两个穿着雨衣的交警站在路口中间指挥着过往的车辆,大家都慌慌张张.急急忙忙的打着 ...
随机推荐
- ADO.NET复习总结(3)--参数化SQL语句--防止sql注入式攻击
1.SQL 注入 2.使用参数化的方式,可以有效防止SQL注入,使用类parameter的实现类SqlParameter Command的属性parameters是一个参数集合. 3.举例<查询 ...
- IOS开发之UIView总结1
太长了,请看 http://blog.csdn.net/xdrt81y/article/details/9128695 performSelector: performSelector:withObj ...
- RocketMQ环境搭建(双master双slave模式)
1.环境准备: 准备四台主机(我这里用CentOSx64) 主机 角色 broker 192.168.192.130 Master1 BrokerServerA 192.168.192.131 Mas ...
- cursor的moveToNext()与moveToFirst()
String sql = "select count(*) as c from sqlite_master where type ='table' and name ='" + t ...
- ios GCD将异步转换为同步
在开发中有时需要等网络请求完成之后拿到数据做一些操作,而且有时是同时好几个网络请求同时发起.这时会有对异步操作进行更进一步控制的场景,不单网络请求,有时一些其他本地文件,多张图片处理等可能都会遇到这种 ...
- AM调制的FPGA实现
一.说明: 功能:AM调制 平台:Vivado 2016.4 和 Matlab R2017a 二.原理: 1. AM调制原理 AM已调信号的时域表达式: 已调信号的频域表达式: 本质上AM调制就是频谱 ...
- openvpn服务端与客户端网段互通
http://www.softown.cn/post/140.html OpenVPN安装.配置教程 http://www.softown.cn/post/137.html openvpn的serve ...
- zabbix邮件发送3.2.4
使用邮件服务发送,一般linux有两种发送方式 mail跟sendmail两款软件,我试验的时候总是会发生发送不了邮件的问题 简而便之,我两款软件都安装了,只要安装其中之一就ok了 #yum -y i ...
- 【转】shell中如何判断一个变量是否为空
判断一个脚本中的变量是否为空,我写了一个这样的shell脚本: #!/bin/sh #filename: test.sh para1= if [ ! -n $para1 ]; then echo &q ...
- javacript 组合使用构造函数模式和原型模式
构造函数模式创建对象 基本方法 function Person(name,age){ this.name=name; this.age=age; this.sayName=function(){ al ...