Fork me on GitHub
Suzf  Blog

[Forward] Centralized logging for fun and profit

Originally posted on Centralized logging for fun and profit

Setting up a centralized log server using syslog isn't as hard as many may believe. Whether it's logs from Apache, nginx, email services, or even from your own Python applications having a central log server gives you many benefits:

Benefits to a centr...

How-to exploit apache access log with rsyslog elasticSearch and Kibana

前言 本文主要简述的如何使用 Rsyslog 实现日志的中心化,并利用 ELK Stack 实现图形搜索与数据统计。

Use Rsyslog Collect Apache Log

# diff -ruN /etc/rsyslog.conf_170420  /etc/rsyslog.conf
--- /etc/rsyslog.conf_170420	2017-04-20 11:02:43.477549484 +0800
+++ /etc/rsyslog.conf	2017-04-21 16:49:43.879806067 +0800
@@ -8,17 +8,22 @@
 # The imjournal module bellow is now used as a message source...
                
            

How-to Install Web Admin Tool On Elasticsearch 5

Head Plugin

Running as a plugin of Elasticsearch (deprecated)

for Elasticsearch 5.x: site plugins are not supported. Run as a standalone server for Elasticsearch 2.x: sudo elasticsearch/bin/plugin install mobz/elasticsearch-head open http://localhost:9200/_plugin/head/

Run as a standalone server

Install dependencies packages
...

How-to Installation and configuration ELK Stack 5

前言

本文主要讲述的是 ELK Stack 5 的简易安装和配置。 Elasticsearch - 分布式的文档(document)存储引擎。它可以实时存储并检索复杂数据结构。 Kibana - 在 Elasticsearch 中分析和搜索数据信息的 bashboard Filebeat - 为 Elasticsearch 传送日志数据的轻量级的组件(基于  Logstash-Forwarder)。 关于 Elasticsearch 5 的安装 --> How-to Install elasticsearch with RPM on CentOS7

Kib...

How-to Install Elasticsearch 5.x Cluster On CentOS7

前言

ES 群集的部署可谓是“傻瓜式”的,需要自定义的地方就是 `/etc/elasticsearch/elasticsearch.yml` 里的 cluster.name。然后,在 `Disicovery` 可达的范围内,所有的 elasticsearch node 会自动寻找和自己相同的cluster.name 的兄弟, 然后按照最朴素的先来后到的规则确定master。至此集群创建完成。

节点类型

当我们启动Elasticsearch的实例,就会启动至少一个节点。相同集群名的多个节点的连接就组成了一个集群,在默认情况下,集群中的每个节点都可以处理http请求和集群节点间的数据传输,集群中所有的节点都知道集群中其他所有的节点,可以将客户端请求转发到适当的节点。节点有以下类型:<...

How-to Deploy Django Apps with uWSGI and Nginx on Ubuntu

Django 的部署可以有很多方式,采用 nginx + uwsgi 的方式是其中比较常见的一种方式。

准备工作

安装所需软件

pip install Django
apt-get install nginx

pip install uwsgi
# 注: 在 Debian/Ubuntu 系统中需要安装 python-dev

基本测试

创建一个 test.py 的文件

# test.py
def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/ht...