ELK5.6.4+Redis+Filebeat+Nginx(CentOS7.4)
下载地址:
Elasticsearhc: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.4.tar.gz
Logstash: https://artifacts.elastic.co/downloads/logstash/logstash-5.6.4.tar.gz
Kibana: https://artifacts.elastic.co/downloads/kibana/kibana-5.6.4-x86_64.rpm
Filebeat: https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.6.4-x86_64.rpm
Redis: v3.2.10
Nginx
主机
Elasticsearch/kibana/Nginx: 192.168.1.106
Redis: 192.168.1.107
Logstash 192.168.1.108
Filebeat: 192.168.1.109
一、环境准备
.jdk安装 Elastic需要Java8环境(logstash和elastic主机安装)
.修改文件描述符和单个用户进程数量
.cat /etc/security/limits.conf
* soft nofile
* hard nofile
* soft nproc
* hard nproc
.cat /etc/security/limits.d/-nproc.conf
* soft nproc
root soft nproc unlimited
#修改进程可以拥有的虚拟内存区域数量
.echo “vm.max_map_count=” >> /etc/sysctl.conf
.sysctl -p
Elasticsearch安装
.useradd op
.mkdir /opt/op && mkdir /data
.chown -R op:op /opt/op && chown -R op:op /data
.cd /opt/op
.su - op
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.4.tar.gz
.tar xf elasticsearch-5.6..tar.gz
.mv elasticsearch-5.6. elasticsearch
.cd elasticsearch
.vim conf/elasticsearch.yml
#绑定监听IP
network.host: 192.168.1.106
#设置对外提供http服务的端口,默认是9200
http.port:
#设置集群名字
cluster.name: buka_es_test
#节点名字
node.name: node1
#数据存储位置
path.data: /data
#日志存储目录
path.logs: /data/logs
#锁定内存
bootstrap.mlockall: true
. 启动
bin/elasticsearch -d
kibana安装
.wget https://artifacts.elastic.co/downloads/kibana/kibana-5.6.4-x86_64.rpm
.rpm -ivh kibana-5.6.-x86_64.rpm
.vim /etc/kibana/kibana.yml
server.port:
server.host: "192.168.1.106"
elasticsearch.url: "http://192.168.1.106:9002"
.启动
/etc/init.d/kibana start
systemctl enable kibana
Logstash安装
.wget https://artifacts.elastic.co/downloads/logstash/logstash-5.6.4.tar.gz
.tar xf logstash-5.6..tar.gz
.cd logstash-5.6.4
4.cat config/server.conf
input {
redis {
host => "192.168.1.108"
port => "6379"
data_type => 'list'
key => "srs"
}
}
filter {
if "srs" in [type]{
grok {
match => ["message","\[%{TIMESTAMP_ISO8601:logtime}\]\[%{WORD:level}\]\[%{INT:id1}\]\[%{INT:id2}\] source url=%{WORD:app}\/%{WORD:root}\/%{DATA:stream_id}\, ip=%{IP:source_ip}\,"]
}
date {
match => [ "logtime", "yyyy-MM-dd HH:mm:ss,SSS","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm:ss:SSS" ]
target => "@timestamp"
}
}
} output {
if "srs" in [type]{
elasticsearch {
hosts => "192.168.1.106:9002"
index => "logstash-srs-%{+YYYY.MM.dd}"
}
}
}
5.启动
nohup ./bin/logstash -f config/server.conf &
redis安装
.yum -y install redis
.vim /etc/redis.conf
bind 127.0.0.1 192.168.1.108
.systemctl start redis && systemctl enable redis
Filebeat安装
.wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.0.0-x86_64.rpm
.rpm -ivh filebeat-6.0.-x86_64.rpm
.vim /etc/filebeat/filebeat.yml
filebeat.prospectors:
- type: log
paths:
- /opt/srs/logs/srs.log
document_type: srs
output.redis:
hosts: ["192.168.1.108"]
port:
key: "rtc"
.systemctl start filebeat && systemctl enable filebeat
Nginx反向代理kibana并增加认证功能
. yum -y install nginx httpd
. 使用命令生成passfile 文件: htpasswd -c -d /etc/nginx/pass_file admin
#输入以上命令,回车输入密码,再次回车,输入确认密码
. nginx.conf 配置文件
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/pass_file;
proxy_pass http://192.168.1.106:5601;
proxy_set_header Host $host:;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
. systemctl start nginx && systemctl enable nginx
访问kibana
http://192.168.1.106



ELK5.6.4+Redis+Filebeat+Nginx(CentOS7.4)的更多相关文章
- ELK+redis搭建nginx日志分析平台
ELK+redis搭建nginx日志分析平台发表于 2015-08-19 | 分类于 Linux/Unix | ELK简介ELKStack即Elasticsearch + Logstas ...
- 使用elk+redis搭建nginx日志分析平台
elk+redis 搭建nginx日志分析平台 logstash,elasticsearch,kibana 怎么进行nginx的日志分析呢?首先,架构方面,nginx是有日志文件的,它的每个请求的状态 ...
- centos下redis和nginx软件的安装
我们这章以redis和nginx软件为例,介绍一下centos下软件的安装. 需要软件包(可以先下载好复制到centos指定目录下,也可直接用wget命令获取): nginx-1.7.9.tar re ...
- Redis+Tomcat+Nginx集群实现Session共享,Tomcat Session共享
Redis+Tomcat+Nginx集群实现Session共享,Tomcat Session共享 ============================= 蕃薯耀 2017年11月27日 http: ...
- ELK Stack (2) —— ELK + Redis收集Nginx日志
ELK Stack (2) -- ELK + Redis收集Nginx日志 摘要 使用Elasticsearch.Logstash.Kibana与Redis(作为缓冲区)对Nginx日志进行收集 版本 ...
- Redis笔记 -- 在 Centos7.4单机中部署Redis集群(二)
0x00--背景和目的 在单台PC服务器上部署Redis集群,通过不同的TCP端口启动多实例,模拟多台独立PC组成集群. 0x01--环境描述: Centos版本:CentOS Linux relea ...
- Docker 基本操作(附 redis、nginx部署)
下载安装 Docker 也有一个月了.中间看过几次也没有深入的了解研究.就只是拉取了两个镜像简单的看了看. 昨天因一个项目中需要用到 Redis ,因为是 Windows 系统,看了下安装包比较老了有 ...
- net core+Redis+IIS+nginx实现Session共享
.Net Core Web Api实践(二).net core+Redis+IIS+nginx实现Session共享 前言:虽说公司app后端使用的是.net core+Redis+docker+ ...
- 使用elk+redis搭建nginx日志分析平台(引)
http://www.cnblogs.com/yjf512/p/4199105.html elk+redis 搭建nginx日志分析平台 logstash,elasticsearch,kibana 怎 ...
随机推荐
- keras 从txt加载预测数据
ImageDataGenerator.flow_from_directory()的用法已经非常多了,优点是简单方便,但数据量很大时,需要组织目录结构和copy数据,很浪费资源和时间 1. 训练时从tx ...
- vueX基础知识笔记
接着昨天的知识点 mutations提交时,有时候达不到想要的响应式,我们必须要将数据提前放到state中,否则不会达到响应式的效果.比如 state.info['address'] = value ...
- The meaningless Game
题目 Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting ...
- Redis系列(九):数据结构Hash源码解析和HSET、HGET命令
2.源码解析 1.相关命令如下: {"hset",hsetCommand,,"wmF",,NULL,,,,,}, {"hsetnx",hse ...
- SpringBoot开发案例之异常处理并邮件通知
前言 在项目开发中,对于异常处理我们通常有多种处理方式,比如:控制层手动捕获异常,拦截器统一处理异常.今天跟大家分享一种注解的方式,统一拦截异常并处理. 异常处理 在spring 3.2中,新增了@R ...
- C++ 自动资源释放的单例模式
代码思想就是程序结束时会自动释放静态/全局资源时删除单例资源. //.h class CSingleton { public: static CSingleton* Singleton() { ret ...
- 《 ZooKeeper : Wait-free coordination for Internet-scale systems 》论文研读
Zookeeper 研读 说明:本文为论文 < ZooKeeper : Wait-free coordination for Internet-scale systems > 的个人理解, ...
- [开源][示例更新]eCharts配置简化包OptionCreator[typescript版]
前言 eCharts作为国内优秀的开源图表工具,功能强大,但是使用中也存在一定的问题. 文档更新较慢,文档说明不详细. 前端使用的弱类型语言,数据结构在灵活的同时,也容易造成一些问题.例如某些属性到底 ...
- day04总结
print("陈少最帅!!!") 输出结果: 陈少最帅!!! 可以变,不可变数据类型#1.可变类型:list,dict#在值改变的情况下,id号不变,也就是说内存地址不变,证明就是 ...
- bugku extract 变量覆盖