升级Cassandra的最佳做法 [英] Best practices on upgrading cassandra

查看:221
本文介绍了升级Cassandra的最佳做法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从pyspark连接到cassandra时遇到错误,因为看来我使用的是旧的cassandra:

I am getting errors from pyspark connecting to cassandra because it appears I am using a too old a cassandra:

[idf@node1 python]$ nodetool -h localhost version
ReleaseVersion: 2.0.17
[idf@node1 python]$ 

[idf @ node1 cassandra] $ java --version
无法识别的选项:--version
错误:无法创建Java虚拟机。
错误:发生致命异常。程序将退出。

[idf@node1 cassandra]$ java --version Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

[idf@node1 cassandra]$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
[idf@node1 cassandra]$ 

我想升级到最新版本。但是,我已经收集了很多数据,并且我不想丢失它。我在单个cassandra节点上使用CentOS 7.2。我的问题是,

I want to upgrade to the latest version. However, I have already collected quite a bit of data and I don't want to lose it. I am using CentOS 7.2 with a single cassandra node. My questions are,


  • 在本地文件系统上存储的Cassandra数据在哪里

  • 正确地假设我可以压缩该目录并移动它?

然后,一旦备份了数据,正确的方法是什么升级卡桑德拉?

Then once I have the data backed up, what is the correct way to upgrade cassandra? Is it


  • 完全删除旧版本

  • 安装新版本

  • 将数据复制回

什么是最佳做法?

推荐答案

我猜您正在使用OSS版本。数据的默认位置是/ var / lib / cassandra,如果不需要,可以进行备份。
升级过程很简单:

I'm guessing you are using OSS version. Default location for data is /var/lib/cassandra and you can backup it if you wan't. Procedure for upgrade is simple:


  1. 运行Nodetool Drain

  2. 停止cassandra

  3. 保存您的cassandra.yaml

  4. 删除旧版本并安装新版本

  5. 使用您的设置更新新的cassandra.yaml

  6. 启动cassandra

  7. 运行nodetool ugradesstables

  1. run nodetool drain
  2. stop cassandra
  3. save your cassandra.yaml
  4. remove old and install new version
  5. update new cassandra.yaml with your settings
  6. start cassandra
  7. run nodetool ugradesstables

这将使您的节点运行带有所有模式和数据的新版本的cassandra。
如果要升级到2.1以上,请小心,因为2.2及更高版本需要java8。其他一切都一样。

This should leave you with your node running the new version of cassandra with all your schema and data in it. Be careful if you are upgrading past 2.1 because 2.2 and up require java8. Everything else is the same.

这篇关于升级Cassandra的最佳做法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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