브로커 및 파티션 추가하기
partition 추가
운영중인 kafka topic 이라면,, 매우 신중하게 결정해야함
- Partition 추가 (alter)는 재배치를 수행하게 되므로 network 사용량 증가를 발생
- Cosumer에 따라서는 재수행이 반드시 필요한 경우가 있음.
- 서비스 운영중인 Topic에 Partition 추가는 새로운 Partition 으로 메세지 rebalance 가 되는 과정에서 시스템 성능에 영향을 끼칠 수 있음. 꼭 필요하다면, 서비스 임팩터가 상대적으로 작은 시간을 선택해야 함.
- 실제 해당 Topic의 사용 사례를 고려해서, 필요시 테스트 서버에서 테스트를 해보고 실행해야함.
- 모든 메세지를 RoundRobin 방식으로 처리하고 있다면, 데이터 규모에 따른 지연시간 이후 곧 정상처리가 시작될 수 있지만, 특정 Key-partition 에 가까운 Consumer를 운영중이라면 메세지의 유실 가능성도 있다.
- 차라리 신규 Topic을 생성하여 Migration 전략을 짜는 것이 더 나은 선택인 경우가 많음
- 따라서 Topic 의 최초 생성시 데이터 확장 규모를 고려하여 partition 개수를 여유있게 설정
Broker 추가
- zookeeper를 사용한다면 Broker 에 새로운 Partitio을 추가하는 것은 매우 간단.
- 하지만, partition 추가 하는 경우가 이슈는 아래이다.
- 이 때, 자동적으로 Partition의 분산 및 재배치 되지는 않는다.
- 운영자가 수동으로 재배치를 해줘야하
- Partition 의 재배치는 reassign을 재배치할 것을 명시해야함