rsyslog传输type
Rsyslog远程传输的几种方式
基本介绍
Rsyslog是一个syslogd的多线程增强版,rsyslog vs. syslog-ng 链接是rsyslog官方和syslog特性和性能上的一些对比,目前大部分Linux发行版本默认也是使用rsyslog记录日志。这里介绍rsyslog远程传输的几种方式,对远程日志传输可以有一个了解。
rsyslog提供三个远程日志传输方式:
- UDP: 数据包传输可信度不高
- TCP: 数据包传输可信度比较高
- RELP: 数据包传输可信度最高,避免数据丢失,比较新的协议,目前应用较少
以下为man手册对RELP协议的一个介绍:
RELP can be used instead of UDP or plain TCP syslog to provide reliable delivery of syslog messages. Please note that plain TCP syslog does NOT provide truly reliable delivery, with it messages may be lost when there is a connection problem or the server shuts down. RELP prevents message loss in hose cases.
关于RELP的更进一步了解可以参考 Using TLS with RELP RELP Input Module RELP Output Module (omrelp)
相关配置
To forward messages to another host via UDP, prepend the hostname with the at sign (“@”). To forward it via plain tcp, prepend two at signs (“@@”). To forward via RELP, prepend the string “:omrelp:” in front of the hostname.
UDP传输
Server端配置
/etc/rsyslog.conf
1 |
|
或者把以上配置单独存放在/etc/rsyslog.d/中的xxx.conf配置文件中,尽量避免修改主配置文件,当然如果要独立文件主配置文件中必须含有以下配置
1 |
|
Client端配置
/etc/rsyslog.conf
1 |
|
以上配置完成之后/etc/init.d/rsyslog restart
TCP传输
TCP配置和UDP类似,如下
Server端配置
/etc/rsyslog.conf
1 |
|
Client端配置
/etc/rsyslog.conf
1 |
|
客户端和服务端重启相关服务即可
关于TCP和UDP的传输方式,rsyslog官方推荐使用TCP传输方式
In general, we suggest to use TCP syslog. It is way more reliable than UDP syslog and still pretty fast. The main reason is, that UDP might suffer of message loss. This happens when the syslog server must receive large bursts of messages. If the system buffer for UDP is full, all other messages will be dropped. With TCP, this will not happen. But sometimes it might be good to have a UDP server configured as well. That is, because some devices (like routers) are not able to send TCP syslog by design. In that case, you would need both syslog server types to have everything covered. If you need both syslog server types configured, please make sure they run on proper ports. By default UDP syslog is received on port 514. TCP syslog needs a different port because often the RPC service is using this port as well.
RELP传输
RELP需要安装rsyslog-relp相应模块
1 |
|
Server端配置
/etc/rsyslog.conf
1 |
|
Client端配置
/etc/rsyslog.conf
1 |
|
客户端和服务端重启相关服务即可
参考和拓展资料
- Using TLS with RELP
- RELP Input Module
- RELP Output Module (omrelp)
- Rsyslog remote logging using RELP
- UDP Rsyslog
- TCP Rsyslog
–EOF–
rsyslog传输type的更多相关文章
- rsyslog 传输mysql 日志
在另外一种环境中,让我们假定你已经在机器上安装了一个名为"foobar"的应用程序,它会在/var/log下生成foobar.log日志文件.现在,你想要将它的日志定向到rsysl ...
- rsyslog 传输日志
nginx 服务器: front-end:/usr/local/nginx/logs# cat /etc/rsyslog.conf | grep -v "^$" | grep -v ...
- <二>ELK-6.5.3学习笔记–使用rsyslog传输管理nginx日志
http://www.eryajf.net/2362.html 转载于 本文预计阅读时间 28 分钟 文章目录[隐藏] 1,nginx日志json化. 2,发送端配置. 3,接收端配置. 4,配置lo ...
- rsyslog传输指定目录下的全部日志数据
准备: 两台Linux电脑 server(A):10.1.75.177 client(B):10.1.75.229 目的: 将B上的/usr/local/record目录下的所有日志数据传输到A的/v ...
- Rsyslog日志服务搭建
rsyslog是比syslog功能更强大的日志记录系统,可以将日志输出到文件,数据库和其它程序.Centos 6.x默认的rsyslog版本是5.x. 网上关于rsyslog的安装配置文档倒是不少,但 ...
- 003-centos7:rsyslog简单配置客户端和服务器端
实现把一个主机作为客户端,把日志发送到指定的服务器端: [服务器端] 开放tcp端口,udp端口: vim /etc/rsyslog.conf: # Provides UDP syslog recep ...
- 日志收集之rsyslog to kafka
项目需要将日志收集起来做存储分析,数据的流向为rsyslog(收集) -> kafka(消息队列) -> logstash(清理) -> es.hdfs: 今天我们先将如何利用rsy ...
- 用ElasticSearch存储日志
介绍 如果你使用elasticsearch来存储你的日志,本文给你提供一些做法和建议. 如果你想从多台主机向elasticsearch汇集日志,你有以下多种选择: Graylog2 安装在一台中心机上 ...
- jsignature 中文开发手册
2017年5月9日21:23:17,最近比较忙,没时间写博客,真的是越来越懒来了 github:https://github.com/brinley/jSignature http://www.unb ...
随机推荐
- UDP:rfc768/广播和多播/IGMP
封装情况:
- Mac 配置前端基本环境
一,sublime 下载一个版本,替换packages,要想shift command p管用,得在sublime里面control -,然后把 import urllib.request,os,h ...
- Android编程 EditView 中如何设置最多可以输入的字符数量 属性 android:ems 与 android:maxLength 的区别
最近有一个新的感悟,那就是工作的时候千万不要遇到那种特要人无语的领导,很不幸我现在就遇到了这样的一个领导,说是要给领导认识的一个熟人家的孩子写本科毕业设计预算把我给派过去给本科生写毕业设计,这事情的确 ...
- Android 百度地图2.4.2版本标注动画效果
ImageView latestMapEventImageView = null; // 更新震中位置 private void updateMapEventOverlay() { mMapEvent ...
- 原生js实现div拖拽+按下鼠标计时
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> ...
- WIN7下配置和使用解压缩版MYSQL
最近mysql出了新的GA版本——mysql5.6.11,此版本windows64位下只有解压缩版,于是在win7上进行了配置.期间碰到了一些问题,在此记录一下. 一.环境 操作系统:WIN764位 ...
- BZOJ3609 Heoi2014 人人尽说江南好【推理+结论】
BZOJ3609 Heoi2014 人人尽说江南好 Description 小 Z 是一个不折不扣的 ZRP(Zealot Round-game Player,回合制游戏狂热玩家),最近他 想起了小时 ...
- MySQL 字段基本操作
MySQL添加字段的方法并不复杂,下面将为您详细介绍MySQL添加字段和修改字段等操作的实现方法,希望对您学习MySQL添加字段方面会有所帮助. .登录数据库 >mysql -u root -p ...
- 在VS2013创建WebService并在IIS中发布和使用
创建WebService 第一步:打开VS2013,新建空项目,注意选择.NET Framework的版本.这里我选择的是.NET Framework 4 新建好项目后,在项目中添加一个WebServ ...
- 【Netty】netty学习之nio网络编程的模型
[一]NIO服务器编程结构 [二]Netty3.x服务端线程模型