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端配置
1 |
|
或者把以上配置单独存放在/etc/rsyslog.d/中的xxx.conf配置文件中,尽量避免修改主配置文件,当然如果要独立文件主配置文件中必须含有以下配置
1 |
|
Client端配置
1 |
|
以上配置完成之后/etc/init.d/rsyslog restart
TCP传输
TCP配置和UDP类似,如下
Server端配置
1 |
|
Client端配置
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端配置
1 |
|
Client端配置
1 |
|
客户端和服务端重启相关服务即可
参考和拓展资料
- Using TLS with RELP
- RELP Input Module
- RELP Output Module (omrelp)
- Rsyslog remote logging using RELP
- UDP Rsyslog
- TCP Rsyslog
–EOF–
Rsyslog远程传输的几种方式的更多相关文章
- 连接远程服务器的几种方式/Vscode + Remote
连接远程服务器的几种方式 前言 最近在尝试做网盘,使用的技术栈大概是 .net core + MVC + Mysql + Layui,主要目的是通过这个具体的项目,熟悉熟悉 .net core 开发, ...
- 设备程序远程升级采用两种方式(优先采用IP方式)
设备程序远程升级采用两种方式(优先采用IP方式): 采用应急广播TS流传输技术规范的消息内容表携带升级包数据.当辅助数据类型值为44时,消息内容表传输的数据为程序升级包. 采用IP方式传输升级包数据. ...
- Linux经常使用的文件传输的几种方式
Linux经常使用的文件传输的几种方式 1.终端新建stfp协议连接 或者命令方式: sftp -P22 root@192.168.11.100 端口可以不用填写,默认是22,端口的P是大写. 将本地 ...
- Jenkins触发远程Job的几种方式
本文叙述基于以下假设前提,将介绍三种在不同的jenkins服务器之间触发Job的方法: 本地Jenkins Server local.jenkins.com远程Jenkins Server remot ...
- Linux系统之文件传输的几种方式
Linux系统安装好以后以及能上网.能进行软件安装后,接下来可能就需要从其它机器复制一些文件或者把文件复制到其它机器,那么就涉及到文件的传输和共享,下面介绍一下常规的一些文件传输和共享方案. 1.传统 ...
- LinkServer--访问远程数据表三种方式
在TSQL中访问远程数据库有三种方式:1.OPENROWSET2.OPENDATASOURCE3.LinkServer 在使用openrowset/opendatasource前搜先要启用Ad Hoc ...
- Linux中crontab下scp文件传输的两种方式
Linux下文件传输一般有两个命令scp.ftp(工具需要下载安装) 本文主要讲讲scp的文件传输脚本 1.scp ssh-keygen -t rsa免输入密码,传输 这里假设主机A 用来获到主机B的 ...
- git 拉取指定的远程分支(三种方式)
直接拉取 git clone -b ants git@github.com:Ants-double/CareerJava.git git clone -b 远程分支名 仓库地址 本地已经有相关的仓库代 ...
- PHP获取远程文件的几种方式
1.fopen() 2.file_get_contents() 3.fsocket() 4.curl()
随机推荐
- 【转】java中创建对象的方法
有4种显式地创建对象的方式: 1.用); System.out.println("call default constructor"); } public Customer(Str ...
- 注解反射原理(IOC框架)
IOC(Inversion of Control):控制反转.采用配置文件和注解的方式,将成员变量通过反射注入,舍弃new的方式,降低了耦合度. 反射:JAVA反射机制是在运行状态中,对于任意一个类, ...
- sql之强制索引
1.今天我遇到一个问题,在处理百万级数据查询的时候,一般查询会很慢. 2.第一时间想到是建立联合索引,但是数据库存在多条索引的情况下,索引的执行是全部执行. 3.所以这里要按照特定的索引执行,就必须使 ...
- HTTP Error: 413 Request Entity Too Large的解决
昨天在使用PHP的CURL调用另一个项目的API:A时,出现了HTTP Error: 413 Request Entity Too Large的错误.而调用另一个API:B则没有这个错误. A的API ...
- 微信小程序从子页面退回父页面时的数据传递 wx.navigateBack()
我们知道,在微信小程序中,从一个页面转到另一个页面,一般情况下可以通过navigate或redirect时候的url来携带参数,然后在目标页面的onLoad函数参数中获取这些url参数.例如: // ...
- mysql为什么会慢
--2019.4.18 mysql技术大会分享--叶金荣mysql为什么会慢性能瓶颈分析.排查思路 先确认一下真的是mysql响应慢了吗导致mysql慢可能会有那些因素呢?--资源稀缺 ---cpu, ...
- 熟练的使用CIFAR-10数据集
CIFIR-10是一套包含60000张,大小为32x32的十分类图片数据集,其中50000张被分为训练数据,10000张被分为测试数据,http://www.cs.toronto.edu/~kriz/ ...
- WCF传输大数据 --断点续传(upload、download)
using System; using System.IO; using System.Runtime.Serialization; using System.ServiceModel; namesp ...
- windows下手动安装pyinstaller(python2.7)
1.首先,安装python2.7.13,官网下载msi版(windows直接安装): https://www.python.org/downloads/ 2.然后,到python包官网依次下载,fut ...
- wampserver中php版本的升级
以php5.3.10到5.4.31版本为例: 1. 停止WAMP服务器. 2. 去网站windows.php.net 下载php-5.4.31-Win32-VC9-x86.zip. 不要下载THE ...