728x90
Kafka를 Install 버전으로 설치해보자
설치
[root@search-pipe-kafka163 ~]# wget https://downloads.apache.org/kafka/2.7.0/kafka_2.13-2.7.0.tgz
--2021-05-26 10:34:18-- https://downloads.apache.org/kafka/2.7.0/kafka_2.13-2.7.0.tgz
Resolving downloads.apache.org (downloads.apache.org)... 88.99.95.219, 135.181.209.10, 135.181.214.104, ...
Connecting to downloads.apache.org (downloads.apache.org)|88.99.95.219|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 68583422 (65M) [application/x-gzip]
Saving to: ‘kafka_2.13-2.7.0.tgz’
100%[===================================================================================================================================================================================================>] 68,583,422 2.47MB/s in 34s
2021-05-26 10:34:53 (1.94 MB/s) - ‘kafka_2.13-2.7.0.tgz’ saved [68583422/68583422]
[root@search-pipe-kafka163 ~]# tar xvf kafka_2.13-2.7.0.tgz
kafka_2.13-2.7.0/
kafka_2.13-2.7.0/LICENSE
kafka_2.13-2.7.0/NOTICE
kafka_2.13-2.7.0/bin/
kafka_2.13-2.7.0/bin/kafka-delete-records.sh
...
kafka_2.13-2.7.0/libs/kafka-streams-examples-2.7.0.jar
[root@hostname ~]#
서비스 등록
- kafka.service 생성
[root@hostname ~]# vi /etc/systemd/system/kafka.service
[kafka.service]
[Unit]
Description=kafka
After=network.target
[Service]
Type=simple
User=root
Group=root
SyslogIdentifier=kafka
WorkingDirectory=/kafka
Restart=always
RestartSec=0s
ExecStart=/kafka/bin/kafka-server-start.sh /kafka/config/server.properties
ExecStop=/kafka/bin/kafka-server-stop.sh
[Install]
WantedBy=multi-user.target
- zookeeper.service 생성
vi /etc/systemd/system/zookeeper.service
[zookeeper.service]
[Unit]
Description=zookeeper
After=network.target
[Service]
Type=simple
User=root
Group=root
SyslogIdentifier=zookeeper
WorkingDirectory=/kafka
Restart=always
RestartSec=0s
ExecStart=/kafka/bin/zookeeper-server-start.sh /kafka/config/zookeeper.properties
ExecStop=/kafka/bin/zookeeper-server-stop.sh
[Install]
WantedBy=multi-user.target
서비스 등록
[root@hostname ~]# systemctl daemon-reload -> 설정 파일 reload
[root@hostname ~]# systemctl start zookeeper.service -> zookeeper service 시작
[root@hostname ~]# systemctl status zookeeper.service -> zookeeper service 상태 확인
[root@hostname ~]# systemctl enable zookeeper.service -> zookeeper 서버 리부팅시 자동 시작
[root@hostname ~]# systemctl start kafka.service -> kafka service 시작
[root@hostname ~]# systemctl status kafka.service -> kafka service 상태 확인
[root@hostname ~]# systemctl enable kafka.service -> kafka 서버 리부팅시 자동 시작
'Kafka' 카테고리의 다른 글
Consumer Lag - telegraf 설정 (0) | 2022.01.27 |
---|---|
Consumer Lag - burrow 설치 (0) | 2022.01.27 |
Spring Kafka로 토픽 구독 (0) | 2022.01.26 |
카프카 토픽명 규칙 (0) | 2022.01.26 |
토픽과 파티션, 레코드 (0) | 2022.01.26 |