We are running influxDB v1.7.1 on 2x Servers which are behind a VIP. We use the relay to keep both DBs in sync. We have a requirement to replace one of the Servers, but are concerned about Data loss.
Is there a best practice for the migration? Anyone done it before and have lessons learnt etc?
This will be difficult to do without some sort of buffer.
If you had a buffer set up(AMQP/Kafka etc) you would follow this process
Install Influxdb on the new host
Turn off the queue reader/influx writer agent
Run a sync(rsync in example) to copy data from the old host to the new host
Update the influx output in the telegraf writer agent to the new host
Start Influxdb on the new host
Once finished starting, turn on the Telegraf writer instance
The reason this works is that the metrics get buffered in the queue until you are ready to start writing again. Without that, metrics would get dropped. Without a buffering technique or influx enterprise it will be nearly impossible to not lose data but you could minimize impact by doing something like this
install influxdb on new host
run rsync to copy data while host is alive
stop relay
run rsync to get most recent changes
update relay to point to new host
restart relay
You could potentially lose all metrics between step 3 and 6 depending on the Telegraf buffer sizes set