Switching Kafka

LogScale uses Kafka for queuing incoming messages and for storing shared state when running LogScale in a cluster setup. It's possible for LogScale to snapshot its state and continue running using a new Kafka cluster. This can be useful in situations where you want to change infrastructure or if there are problems with the current Kafka/ZooKeeper cluster. One example could be if all ZooKeeper machines have written the disk full and afterwards ZooKeeper will not start because of file inconsistencies. This section describes the procedure for doing a Kafka switch.

Danger

All LogScale processes must be completely stopped before performing this action.

Stop Sending Data to LogScale

If it is possible, stop sending data to LogScale, then wait for LogScale to process all data on the ingest queue. The LogScale Stats dashboard in the LogScale repository have an Events Processed After Ingest Queue graph by host per second and an Ingest Latency graph. If there is data on the ingest queue after closing LogScale it will be lost as the queue is reset or another queue will be used.

You'll need to stop all LogScale processes on all machines. You'll also need to stop all Kafka processes and all ZooKeeper processes on all machines.

The next step depends on the deployment model:

Switching Kafka Recap

It's worth reviewing the steps above again. In short, to do a Kafka switch you'll need to do the following steps:

  1. Stop all LogScale processes on all nodes.

  2. Stop all Kafka processes on all nodes.

  3. Stop all ZooKeeper processes on all nodes (up to LogScale 1.107).

  4. Delete Kafka data (or use new Kafka queues).

  5. Delete ZooKeeper data (if using).

  6. Start all ZooKeeper processes on all nodes (up to LogScale 1.107).

  7. Verify the ZooKeeper cluster (up to LogScale 1.107).

  8. Start all Kafka processes on all nodes.

  9. Verify the Kafka cluster.

  10. Start one LogScale node and let it change epoch.

  11. Verify the epoch has changed.

  12. Start the other LogScale processes on all nodes.