Syslog+Fluentd+InfluxDB日志收集系统搭建
2024-08-29 03:25:30
环境配置
节点 | 配置 | 类型 | 操作系统 |
---|---|---|---|
Sched | 2G 2CPU 50GB ens3=>192.168.200.11 | KVM虚拟机 | CentOS 7 |
Nova | 4G 2CPU 50GB ens3=>192.168.2000.12 | KVM虚拟机 | CentOS 7 |
Sched节点配置
配置InfluxDB软件源
# cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF
# yum makecache
安装InfluxDB
# yum install influxdb -y
### 设置开机启动
# systemctl start influxdb
# systemctl enable influxdb
# systemctl stop firewalld
# systemctl disable firewalld
### 查询InfluxDB默认配置
# influxd config
### 开启web访问,URL地址http://192.168.200.11:8083
# vim /etc/influxdb/influxdb.conf
[admin]
enabled = true
# systemctl restart influxdb
### 如果不是使用标准的默认目录,需要手动修改目录权限
# chown -R influxdb:influxdb /mnt/influx
# chown -R influxdb:influxdb /mnt/db
### 创建test数据库
# influx
> CREATE DATABASE test
> use test
安装Fluentd
# yum install epel-release
# yum makecache
# curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh
安装InfluxDB插件
# td-agent-gem install fluent-plugin-influxdb
配置Fluentd
# vim /etc/td-agent/td-agent.conf
<source>
type syslog
port 42185
tag system
</source>
<match system.*.*>
type influxdb
dbname test
flush_interval 10s
host 192.168.200.11
port 8086
</match>
# systemctl restart td-agent
Nova节点配置
配置rsyslog
# wget http://rpms.adiscon.com/v8-stable/rsyslog.repo -O /etc/yum.repos.d/rsyslog.repo
# yum makecache
# yum install rsyslog
# vim /etc/rsyslog.conf
*.* @192.168.200.11:42185
# systemctl restart rsyslog
验证安装
### 在Nova节点执行
# logger -p "local3.notice" "fwd test"
### 在Sched节点执行
# influx
> USE test
> SHOW MEASUREMENTS
> SELECT * FROM "system.local3.notice"
参考文档
Aggregate and Analyze Syslog with InfluxDB
influxdb的简单使用
最新文章
- &#39;java&#39;不是内部或外部命令,另一个解决办法
- Spring mvc 中使用ftl引用共通文件出错 FreeMarker template error: Error reading included file ";/WEB-INF/ftl/common/errormessage.ftl";
- angular学习的一些小笔记(中)之基础ng指令
- 夺命雷公狗ThinkPHP项目之----企业网站27之网站前台单页的完成(从百度编辑器里面取出文章数据)
- 实战网卡bond
- 【Executor】配置ThreadPoolExecutor
- com学习(四)2——用 ATL 写第一个组件(vs2003)
- zookeeper集群的安装
- 【No system images installed for this target】的解决方式
- tomcat-maven-plugin 插件使用
- 设计模式之 - 外观模式 (Facade design pattern)
- Fatal error: Class &#39;LearningPHP1\mysqli&#39; not found
- node.js 之 Hello,World in Node !
- 【Webpack的使用指南 01】Webpack入门
- Python实现爬取需要登录的网站完整示例
- 利用CodeDom 动态执行条件表达式
- Java基础85 MVC开发模式
- 微软BI 之SSAS 系列 - 在SQL Server 2012 中开发 Analysis Services Multidimensional Project
- POJ 3253 Fence Repair (哈夫曼树)
- Python装饰器高级用法
热门文章
- 大话设计模式--组合模式 Composite -- C++实现实例
- Windows Server 2008 R2 备份与恢复详细实例
- linux命令学习笔记(6):rmdir 命令
- ffmpeg处理RTMP流媒体的命令和发送流媒体的命令(UDP,RTP,RTMP)
- loj517 计算几何瞎暴力
- xcopy语法
- ACM学习历程—广东工业大学2016校赛决赛-网络赛D 二叉树的中序遍历(数据结构)
- bzoj 3514: GERALD07加强版 lct+可持久化线段树
- 浅谈Huffman树
- boost::io_service解读