可以将Cassandra 1.2的快照导入到Cassandra 4.x集群吗?

huangapple go评论48阅读模式
英文:

Is it possible to import a Cassandra 1.2 snapshot into a Cassandra 4.x cluster?

问题

我的当前Cassandra集群设置有3个版本为1.2.x的节点。
我想将其升级到当前可用的4.x版本,并增加更多节点。
当前在现有设置中未配置虚拟节点(vnodes)。
我该如何做?

我可以简单地从现有集群中获取快照并迁移到新集群吗?

英文:

My current cassandra cluster setup has 3 nodes of version 1.2.x.
I want to upgrade it to latest version currently available as 4.x with more number of nodes
Currently vnodes is not configured in existing setup
How can i do so?

Can I simply take snapshot from existing cluster and move to new cluster ?

答案1

得分: 1

这是一个不容小觑的升级 - 需要依次经过 2.0、2.1、2.2、3.11 和 4 版本,并在每个步骤中运行 ssupgradetables。 (我不100%确定是否可以跳过其中一些 2 版本。)

如果你可以处理停机时间 - 我建议使用类似 DS Bulk 这样的工具从 1.2 版本导出数据,然后导入到一个全新的 4.x 集群中。这将比升级过程带来的痛苦和运营开销显著少。

在快照上运行 sstableloader 的选项会变得复杂,因为 4.x 不了解 1.2 版本的 sstableformat,快照 sstables 需要经过几次升级才能达到 4.x 可以理解的格式。

请注意 - 如果你的应用程序正在使用 C* 1.2 的 thrift 协议,那么你将无法升级到 4 版本,因为该协议已被移除,目前(撰写时的时间点)的最新版本是 3.11(3.11.15)。

英文:

This is a non-trivial upgrade - and would have to bounce through 2.0,2.1,2.2, 3.11, 4 with running ssupgradetables at each step. (I'm not 100% sure you can skip some of the 2 releases or not.)

If you can handle the downtime - I would recommend exporting the data from the 1.2 (with a tool like DS Bulk) and then importing into a fresh 4.x cluster set up. It will be significantly less pain / operational overhead than the upgrade process.

The option of running sstableloader on a snapshot gets tricky because 4.x has no knowledge of the sstableformat from 1.2, the snapshot sstables would need to go through a few upgrades to get to a format that 4.x can understand.

Please note - if your application is using thrift with the C* 1.2, then you will not be able to upgrade to 4, since the protocol is removed, the latest version of 3.11 (3.11.15 at the time of writing) is as far as you can upgrade to.

答案2

得分: 0

[sstable format for Cassandra 1.2 (-ic-)][1] 是最新版本的 Cassandra 太旧了。

[C* 4.0][2] 和 [C* 4.1][3] 能够读取的最早的 SSTable 格式是 -ma-(引入于 C* 3.0.0):

public static final String earliest_supported_version = "ma"; ```

支持 `-ic-` SSTable 格式的最新版本是 C* 2.0,因此需要进行多次中间升级。

从 C* 1.2 升级到 4.x 的推荐路径是:

- 小版本升级到 C* 1.2.19(SSTable 格式 `-ic-`)
- 大版本升级到 C* 2.0.17(格式 `-jb-`][5],[与 `-ic-` 兼容][4])
- 大版本升级到 C* 3.11.latest(格式 `-me-`][6],[与 `-jb-` 兼容][7])
- 大版本升级到 C* 4.0.latest, 4.1.latest(格式 `-nb-`][8],[与 `-ma-` 兼容][3])

请注意,CQL 本地二进制协议在主要版本中发生了重大变化:

- C* 1.2 - 基于本地协议 v1
- C* 2.0 - 协议 v2
- C* 2.1 - 协议 v3
- C* 2.2 - 协议 v4
- C* 4.0 - 协议 v5

根据您的应用程序,可能需要执行 Cassandra 驱动程序的中间升级(1),并且需要 [重构您的应用程序][9](2)。

例如,Cassandra Java 驱动程序的 2.1.1 版本之前的版本只与本地协议 v1 和 v2 兼容。Java 驱动程序的 3.x 版本之前的版本只与二进制协议 v1 到 v3 兼容。

有关详细信息,请参阅 [Java 驱动程序 v3.11 中的本地协议兼容性][10] 和 [Java 驱动程序 v4][11]。干杯!

[1]: https://github.com/apache/cassandra/blob/cassandra-1.2/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L50
[2]: https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L116
[3]: https://github.com/apache/cassandra/blob/cassandra-4.1/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L125
[4]: https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L97-L100
[5]: https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L47
[6]: https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L113
[7]: https://compatible%20with%20%60-jb-%60
[8]: https://github.com/apache/cassandra/blob/cassandra-4.1/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L124
[9]: https://docs.datastax.com/en/developer/java-driver/4.15/#migrating-from-previous-versions
[10]: https://docs.datastax.com/en/developer/java-driver/3.11/manual/native_protocol/
[11]: https://docs.datastax.com/en/developer/java-driver/4.15/manual/core/native_protocol/

<details>
<summary>英文:</summary>

The [sstable format for Cassandra 1.2 (`-ic-`)][1] is too old for the latest versions of Cassandra.

The earliest SSTable format that [C* 4.0][2] and [C* 4.1][3] can read is `-ma-` (introduced in C* 3.0.0):

    public static final String current_version = &quot;nb&quot;;
    public static final String earliest_supported_version = &quot;ma&quot;;

The newest version that [supports the `-ic-` SSTable format is C* 2.0][4] so multiple interim upgrades are required.

The recommended upgrade path from C* 1.2 to 4.x is:

 - [minor] upgrade to C* 1.2.19 (SSTable format `-ic-`)
 - major upgrade to C* 2.0.17 ([format `-jb-`][5], [compatible with `-ic-`][4])
 - major upgrade to C* 3.11.latest ([format `-me-`][6], [compatible with `-jb-`][7])
 - major upgrade to C* 4.0.latest, 4.1.latest ([format `-nb-`][8], [compatible with `-ma-`][3])

Note that the CQL native binary protocol changed dramatically in the major versions:

 - C* 1.2 - based on native protocol v1
 - C* 2.0 - protocol v2
 - C* 2.1 - protocol v3
 - C* 2.2 - protocol v4
 - C* 4.0 - protocol v5

Depending on your application, (1) it will be necessary to also perform interim upgrades of the Cassandra driver and (2) will [require a refactor of your application][9].

For example, pre-2.1.1 versions of the Cassandra Java driver are only compatible with native protocol v1 and v2. Pre-3.x versions of the Java driver are only compatible with binary protocols v1 to v3.

For details, see [Native protocol compatibility in Java driver v3.11][10] and [Java driver v4][11]. Cheers!


  [1]: https://github.com/apache/cassandra/blob/cassandra-1.2/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L50
  [2]: https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L116
  [3]: https://github.com/apache/cassandra/blob/cassandra-4.1/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L125
  [4]: https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L97-L100
  [5]: https://github.com/apache/cassandra/blob/cassandra-2.0/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L47
  [6]: https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L113
  [7]: https://compatible%20with%20%60-jb-%60
  [8]: https://github.com/apache/cassandra/blob/cassandra-4.1/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java#L124
  [9]: https://docs.datastax.com/en/developer/java-driver/4.15/#migrating-from-previous-versions
  [10]: https://docs.datastax.com/en/developer/java-driver/3.11/manual/native_protocol/
  [11]: https://docs.datastax.com/en/developer/java-driver/4.15/manual/core/native_protocol/

</details>



huangapple
  • 本文由 发表于 2023年5月29日 19:32:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76356966.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定