No space left on device: What's the best way to remove Kafka-logs when disk is full?

4,454 views
Skip to first unread message

CRK

unread,
Feb 2, 2017, 7:28:33 PM2/2/17
to Confluent Platform
We have a small VM which we're testing Kafka on. We keep running into disk full error and Kafka service stops. We have to delete `kafka-logs` and restart the Kafka service. What's the solution for this? This is the error we run into on the Kafka service:
Caused by: java.io.IOException: No space left on device
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.FileDispatcherImpl.write(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.FileChannelImpl.write(Unknown Source)
at kafka.message.ByteBufferMessageSet.writeTo(ByteBufferMessageSet.scala:303)
at kafka.log.FileMessageSet.append(FileMessageSet.scala:297)
at kafka.log.LogSegment.append(LogSegment.scala:86)
at kafka.log.Log.append(Log.scala:386)
... 22 more

And:
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        59G  9.9G   46G  18% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
/dev/sda1       146M   44M   95M  32% /boot
/dev/sda5       4.9G  4.6G     0 100% /tmp
/dev/sda2        20G  1.2G   18G   7% /var
 

1) Can we make changes to log only ERROR or CRITICAL logs?
2) Is there a way Kafka can delete the logs on its own when the disk is almost full?

Please let me know. This is very important for us!

Thank you! 

Ewen Cheslack-Postava

unread,
Feb 3, 2017, 12:06:12 AM2/3/17
to Confluent Platform
Kafka won't monitor how full the disk is, but it does have a retention policy. If you want to set a maximum log size (which you can get a good value of based on total disk space and expected # of partitions), use the setting log.retention.bytes to make sure it cleans up when you are close to running out of space.

-Ewen

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/ff8bba7d-7e54-46d5-aeec-994d6610c2d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages