Use rsync to copy files from one broker to another
Learn how to use rsync
to copy over all data from an old broker to a
new broker.
You can run rsync
command to copy over all data from an old broker to a
new broker, preserving modification times and permissions. Using rsync
allows you to avoid having to re-replicate the data from the leader.
- Ensure that the disk structures match between the two brokers, or verify the
meta.properties
file between the source and destination brokers (because there is onemeta.properties
file for each data directory).
Run the following command on destination broker:
rsync -avz
src_broker:src_data_dir
dest_data_dir
If you plan to change the broker ID, edit
dest_data_dir/meta.properties
.