节点内部磁盘迁移!
1、停broker
2、 移动topic的分区
mv /data04/kafka/data/proj-gps-30-md-testdata-sac-0-0 /data01/kafka/data/proj-gps-30-md-testdata-sac-0-0
3、备份对应磁盘的配置文件
cp /data04/kafka/data/recovery-point-offset-checkpoint /home/recovery-point-offset-checkpoint04
cp /data04/kafka/data/replication-offset-checkpoint /home/replication-offset-checkpoint04
cp /data01/kafka/data/recovery-point-offset-checkpoint /home/recovery-point-offset-checkpoint01
cp /data01/kafka/data/replication-offset-checkpoint /home/replication-offset-checkpoint01
4、data04修改recovery-point-offset-checkpoint 和 replication-offset-checkpoint 文件
—第二行数字-1
—删除移走的Partition所在行
5、data01修改recovery-point-offset-checkpoint 和 replication-offset-checkpoint 文件
—第二行数字+1
—增加移过来的Partition
6、重启broker
逐个重启集群中所有的Broker影响:
1、在重启Broker的过程中服务不会中断,但是从每个Broker重启完成之后的5分钟内消费的分区消息可能会发生乱序。
2、重启过程中已有的客户端连接可能会中断。需要您的客户端有自动重连功能,服务端的其他Broker会自动接替服务。
3、重启Broker期间,各个分区处理的消息量也会出现一定的不均衡,需要您评估一下升级变更对您业务可能产生的影响。