我从3.0降级到2.1.7后无法看到C * 2.1.7中的所有键空间 [英] Unable to see all keyspaces in C* 2.1.7 after I downgraded from 3.0 to 2.1.7

查看:75
本文介绍了我从3.0降级到2.1.7后无法看到C * 2.1.7中的所有键空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Cassandra 2.1.7,由于某种原因,我升级到3.0.12,后来意识到一些依赖的应用程序不能在3.0.12上运行,所以我降级了,并像以前一样使用C * 2.1.7使用之前。但是现在我看不到C *中的键空间。 (仅供参考:两个C * yaml文件中的数据目录都相同)

I've been using Cassandra 2.1.7 and For some reason I upgraded to 3.0.12 and later realized that some dependent apps won't work with 3.0.12 and I downgraded and using C* 2.1.7 as I was using before. But Now I'm not able to see Keyspaces in C*. (Just FYI: Data directory is same in both C*yaml files)

我需要进行任何更改吗?

Do I have to make any changes?

感谢您的帮助。

推荐答案

如果您尚未备份,则无需担心,因为C * 3.0不会在升级后删除较旧的数据库

以下是我为保留数据所做的操作:
自3.0以来DB名称有完全不同的命名约定,我们需要仔细区分db和DB的名称(旧版本与新版本)。

Here is what I've done to retain data: Since 3.0 has completely different naming conventions for DB names, we need to carefully distinguish db from both(Older vs newer).

对于2.X,Cassandra dbname的每个名称都有以下约定ks:

For 2.X Cassandra dbnames have the following convention for each ks:

keyspace-ColumnFamilyName-ka-ID-Data.db
keyspace-ColumnFamilyName-ka-ID-Digest.sha1
keyspace-ColumnFamilyName-ka-ID-Filter.db
keyspace-ColumnFamilyName-ka-ID-Index.db
keyspace-ColumnFamilyName-ka-ID-Statistics.db
keyspace-ColumnFamilyName-ka-ID-Summary.db
keyspace-ColumnFamilyName-ka-ID-TOC.txt

keyspace: keyspace name
ColumnFimilyname : Name of the CF under keyspace
ka: C* Internal(Haven't explored much on this)
ID: It is incremental value I see different sets of these having different id.(looks like it is an increasing factor  when it takes snapshot, not sure though)
And the last parameter is db name

因此,当我从2.1.7开始时,我会仔细阅读C中的每个日志语句*守护程序,发现系统键空间下的sstable_actiivity文件不是实际的文件,因为此文件的大小非常小。

So when I start with 2.1.7 I read through each and every log statement in of C* daemon and found out that the sstable_actiivity file under system keyspace is not the actual one as the size of this file is very less.

/data/system/sstable_activity-5a1ff267ace03f128563cfae6103c65e/system-sstable_activity-ka-145

所以我试图从快照中找到系统(键空间目录,即/ data / system /)下的最旧文件,并将其替换为上述文件。
和我在系统键空间下的 schema_keyspaces表中重复的操作。

So I tried to find the oldest file under system(keyspace directory i.e /data/system/) from snapshots and replace that with the above file. And the same I repeated for the "schema_keyspaces" table under system keyspace.

现在,我再次重新启动cassandra守护程序,幸运的是,我可以得到键空间列表运行 DESC密钥空间
但我对密钥空间执行 DESC TABLES 时看不到表列表,因为由于文件而未加载

Now I restart cassandra daemon again, luckily I could get list of keyspaces after I run "DESC KEYSPACES" But I don't see list of tables when I execute "DESC TABLES" for my keyspace as it didn't load because files were not found by sstable_activity.

现在,我一直对系统键空间下的所有其他表重复相同的过程。

Now I kept repeating the same process for all other tables under "system" keyspace. which are as below:

schema_keyspaces
schema_columnfamilies
local
schema_columns
schema_triggers
schema_usertypes

重启Cassandra之后,我能够检索到我的应用程序期望的日期。

After restarting Cassandra, I was able retrieve date that I expected for my application.

这篇关于我从3.0降级到2.1.7后无法看到C * 2.1.7中的所有键空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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