Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
joohanhong
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JooHan Hong
joohanhong
Commits
6deec6af
Commit
6deec6af
authored
Jun 09, 2022
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kafka producer init
parent
14139fb6
Pipeline
#5740
passed with stages
in 1 minute and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
.gitkeep
DEVOPS/KAFKA/CONSUMER/.gitkeep
+0
-0
README.md
DEVOPS/KAFKA/PRODUCER/README.md
+51
-0
No files found.
DEVOPS/KAFKA/CONSUMER/.gitkeep
0 → 100644
View file @
6deec6af
DEVOPS/KAFKA/PRODUCER/README.md
0 → 100644
View file @
6deec6af
[
![logo
](
https://www.hongsnet.net/images/logo.gif
)
](https://www.hongsnet.net)
# Producer Overview
Kafka에서의
`Producer는 메시지를 생산하는 주체`
로서, 일반적으로
**개발 언어를 이용해 구성하는 것이 일반적**
이다. 단, 기본적인 Producer는 Kafka에서 제공은 된다.
# Telegraf Producer 구성
Overview에서 명시했지만, 일반적으로 Producer 개발을 통해 생산해야 하지만, Telegraf에서는 이 Producer를 Plugin 형태로 기본 제공한다.
1.
Telegraf의 플러그인 지원 확인
```
bash
# telegraf --output-list |grep kafka
kafka
```
**!참고**
: Kafka Broker로의 입수를 수행해야하므로,
**output Plugin**
을 확인해야 한다.
2.
Telegraf input plugin 설정
```
bash
# cat /etc/telegraf/telegraf.d/kafka.conf
[[
outputs.kafka]]
brokers
=
[
"broker01:9092"
,
"broker02:9092"
,
"broker03:9092"
]
topic
=
"TELEGRAF"
#data_format = "json"
data_format
=
"influx"
```
**!참고**
: InfluxDB Format과 더불어 JSON 형식으로도 출력을 지원한다.
3.
Telegraf 데몬을 재기동
```
bash
# systemctl restart telegraf
```
4.
Kafka 입수 테스트
```
bash
# telegraf --config /etc/telegraf/telegraf.conf --output-filter kafka --test
2022-06-09T02:02:21Z I! Starting Telegraf
>
swap,host
=
호스트네임,hostname
=
${
hostname
}
,idc
=
${
idc
}
,ipv4
=
${
ipv4
}
,role
=
${
role
}
,svrtype
=
${
svrtype
}
free
=
3691507712i,total
=
4294963200i,used
=
603455488i,used_percent
=
14.050306368166321 1654740141000000000
>
swap,host
=
호스트네임,hostname
=
${
hostname
}
,idc
=
${
idc
}
,ipv4
=
${
ipv4
}
,role
=
${
role
}
,svrtype
=
${
svrtype
}
in
=
484429824i,out
=
948281344i 1654740141000000000
>
system,host
=
호스트네임,hostname
=
${
hostname
}
,idc
=
${
idc
}
,ipv4
=
${
ipv4
}
,role
=
${
role
}
,svrtype
=
${
svrtype
}
load1
=
1.38,load15
=
4,load5
=
3.37,n_cpus
=
8i,n_users
=
1i 1654740141000000000
...중략
```
상기와 같이 정상적으로 생산되는 것을 확인할 수 있다.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment