Cassandra节点几乎没有空间,但是nodetool清理是否增加了磁盘使用? [英] Cassandra node almost out of space, but nodetool cleanup is increasing disk use?

查看:255
本文介绍了Cassandra节点几乎没有空间,但是nodetool清理是否增加了磁盘使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一个节点的磁盘使用率达到95%,我们向集群添加了另一个节点以实现重新平衡,但是该节点上的磁盘空间并未减少。我尝试进行节点工具清理,假设节点上有多余的键,但是磁盘空间正在增加!清理实际上会减小大小吗?

One of our nodes was at 95% disk use and we added another node to the cluster to hopefully rebalance but the disk space didn't drop on the node. I tried doing nodetool cleanup assuming that excess keys were on the node, but the disk space is increasing! Will cleanup actually reduce the size?

推荐答案

是的,但是您必须小心,因为会计算压缩并生成压缩临时文件和tmp链接文件,这些文件将增加磁盘空间,直到计算出清理的压缩表为止。

Yes it will, but you have to be careful because a compaction is calculated and it generates temporary files and tmp link files that will increase disk space until the cleaned up compacted table is calculated.

所以我进入您的数据目录,弄清楚您的键空间大小正在使用

So I would go into your data directory and figure out what your keyspace sizes are using

du -h -s *  

然后分别清理较小的键空间(您可以您可以在nodetool cleanup命令中使用nodetool cleanup来指定键空间,直到您有一些开销为止。要了解释放了多少空间,请将日志和cat / grep尾随以进行清理压缩:

Then individually clean up the smaller keyspaces (you can specify a keyspace in the nodetool cleanup command with nodetool cleanup ) until you have some overhead. To get an idea of how much space is being freed, tail the log and cat/grep for cleaned compactions:

tail <system.log location> | grep 'eaned'

我建议您不要尝试清理比剩余磁盘空间的一半。希望那是可能的。

I'd recommend you don't try to cleanup a keyspace that is more that half the size of your remaining disk space. Hopefully that is possible.

如果没有足够的空间,则必须关闭节点,连接更大的磁盘,将数据文件复制到更大的磁盘上,然后重新指向yaml到新的数据目录,然后重新启动。这对于诸如SSD这类价格昂贵且体积较小的产品很有用,但主要的旋转磁盘却更便宜且更大。

If you don't have enough space you'll have to shut down the node, attach a bigger disk, copy the data files over to the bigger disk, repoint the yaml to the new data directories, then restart up. This is useful for things like SSDs that are expensive and small, but the main spinning disks are cheaper and bigger.

这篇关于Cassandra节点几乎没有空间,但是nodetool清理是否增加了磁盘使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆