Kassandra ends if there is no disk space

I am using Cassandra DB in my Java application. I am using the Thrift client to connect Cassandra from my Java application. If the Cassandra drive becomes full, it automatically completes. Therefore, from my java program, I could not find the correct error, why Cassandra does not work.

So, how do you avoid Cassandra's automatic completion or is it their way to identify a complete disk error?

Also, I do not have physical access to the cassandra drive. Its launch in another remote machine.

+4
source share
2 answers

Disk errors and, generally speaking, general hardware / system errors are usually not handled properly in any application. The database should provide the highest possible strength in such scenarios, and the correct behavior is to disconnect and break as little as possible.

As for your application - if you cannot connect to the database, there is no difference in what caused the error. The application will not work.

There are special tools that can control your computer, i.e. Nagios . If you are the administrator of this server, use such applications. When the disk is full, you will receive an email or text. Use such tools and do not break the open door, introducing several hundred lines of code to handle random and very rare situations.

+3
source

Configure ssh access to the Casandra machine and use some ssh client, for example JSch, to run df /casandra/drive (if Linux) or fsutil volume diskfree c:\casandra\drive (if Windows) from your Java client. Choose an output that is simple and parsed to get free disk space. Thus, your application will monitor what is happening there, and probably should warn the user and refuse to add data if there is a problem with disk space.

You can also use standard monitoring tools or a server-side script server setup to send a message if there is not enough disk space. However, this will not stop your application from crashes, you need to take action after you see that the disk space is low.

+1
source

All Articles