DROP COLUMN FAMILY from cassandra CLI will not drop the CF

爷,独闯天下 提交于 2019-12-05 21:52:36

I had to deal with this issue back on Cassandra 1.1 as well. Basically, my column family had become corrupted, and the only way to alter its schema, was to drop/restore the keyspace (which DataStax walked me through, at the time).

If you have a support contract with DataStax, I would HIGHLY recommend contacting them before proceeding. The first thing they'll tell you, is that this is a bug in specific versions of Cassandra 1.1, and that you should upgrade. I haven't tested it, but according to them an in-place upgrade would allow you to modify your schema in the new version. So you might be able to fix this by upgrading to 1.2 or 2.0.

In my case (production, enterprise environment) upgrading on-the-spot was not an option. To fix this, I basically had to drop my entire keyspace, re-create it (and my column families), and recover from a snapshot. I loosely followed the instructions found here:

  • Take a snapshot of the keyspace on each node. The snapshot files should be stored in the [keyspaceName]/snapshots dir, but I copied mine to another non-Cassandra location just to be on the safe side.
  • DROP your keyspace.
  • Stop all nodes.
  • On each node, delete the .db files in the keyspace directory (but not the snapshot dir).
  • Copy the files from the snapshot directory back into the keyspace directory.
  • Restart one node
  • From that node's cassandra-cli re-create your keyspace.
  • Verify that your data is there.
  • Restart the remaining nodes.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!