如何在ubuntu上重新安装cassandra? [英] How can I reinstall a cassandra on ubuntu?

查看:175
本文介绍了如何在ubuntu上重新安装cassandra?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ubutu(linux)+ Cassandra的新手。

I'm newbie in the Ubutu(linux) + Cassandra.

我在使用OpenJdk的ubuntu机器上测试了Cassandra。有一些不错的文章来解释如何在ubuntu上安装Cassandra,所以我可以这样做。我更改了一些配置值并检查它是否可以正常运行。

I tested Cassandra on my ubuntu machine with OpenJdk. There are some nice articles to explain how to install a Cassandra on ubuntu, so I could do that. I changed some config values and checked it run correctly.

然后,我决定删除cassandra并重新安装以获得干净的配置。

And, I decided to remove the cassandra and reinstall for getting the clean one.

[做什么]

我通过以下步骤卸载Cassandra:

I uninstall Cassandra with following steps:


  1. 使用apt-get卸载Cassandra

  1. uninstall Cassandra using apt-get


apt-get删除cassandra

apt-get remove cassandra


  • 删除数据/日志/目录

  • remove data/log/ directories


    rm- rf / var / lib / cassandra

    rm -rf /var/lib/cassandra

    rm -rf / var / log / cassandra

    rm -rf /var/log/cassandra

    rm -rf / etc / cassandra

    rm -rf /etc/cassandra


  • 之后,我尝试安装新的cassandra

    After that I tried to install new cassandra


    apt-get install cassandra

    apt-get install cassandra

    [错误消息]


    sudo cassandra -f

    线程主中的异常java.lang.ExceptionInInitializerError
    原因:java.lan g.RuntimeException:无法确定log4j配置:log4j-server.properties

    Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.RuntimeException: Couldn't figure out log4j configuration: log4j-server.properties

    在org.apache.cassandra.service.AbstractCassandraDaemon.initLog4j(AbstractCassandraDaemon.java:86

    at org.apache.cassandra.service.AbstractCassandraDaemon.initLog4j(AbstractCassandraDaemon.java:86)

    在org.apache.cassandra.thrift.CassandraDaemon。(CassandraDaemon.java:62)
    找不到主类:org.apache.cassandra .thrift.CassandraDaemon。程序将退出。`

    at org.apache.cassandra.thrift.CassandraDaemon.(CassandraDaemon.java:62) Could not find the main class: org.apache.cassandra.thrift.CassandraDaemon. Program will exit.`

    并且在 / var / lib / cassandra, / var / log / cassandra下没有文件和 / etc / cassandra目录中的OTL。

    and there are no files under "/var/lib/cassandra", "/var/log/cassandra" and "/etc/cassandra" directories OTL.

    我想知道,我错过了什么。

    I want to know, what I miss.

    推荐答案

    通过执行以下操作,我可以完全卸载Cassandra:

    I was able to completely uninstall Cassandra by doing the following:

    apt-get remove cassandra
    

    ---删除cassandra目录

    --- removing the cassandra directories

    rm -rf /var/lib/cassandra
    rm -rf /var/log/cassandra
    rm -rf /etc/cassandra
    

    但是,完成上述操作后,仍然遗留了一些东西,如果要在执行此操作后尝试重新安装它,它不起作用,因为安装程序会检测到剩余的文件,并认为您仍然可以安装该软件。您将获得一组新的目录,但是它们将为空。因此,您需要删除所有其他内容。有些目录和文件需要手动删除。

    However, after doing the above, there are still some things left behind, and if you were to try to reinstall it after doing this, it does not work, because the install detects those remaining files and believes you still have an installation of the software. You will get a new set of directories, but they will be empty. So, you need to remove all the additional stuff. There are directories and files that need to be manually removed.

    ---查找其余的Cassandra文件

    --- finding the remaining Cassandra files

    find / -name 'cassandra' 
    

    或,

    find / -name '*cassandra*'
    






    (系统上所有剩余的文件都需要删除,或者一些目录为空,甚至根本没有创建)。


    (ALL remaining files on the system need to be removed or a few directories are left empty or not even created at all).

    上面的命令将返回文件和目录的列表。删除它们。

    The above command will return a listing of files and directories left behind. Remove them.

    现在,您应该可以这样做:

    Now, you should be able to do:

    apt-get update
    

    接着:

    apt-get install cassandra
    

    这样做之后,我进行了全新安装,启动Cassandra时,它完成了所有首次启动工作,并开始运行。

    After doing this, I got a full new installation, and upon starting Cassandra, it did all the first-time startup stuff and got up and running.

    如果您收到有关签名的GPG错误而不是由于要通过公共密钥进行验证,因此需要在安装语句之前进行设置。

    If you get a GPG error about signatures not being verified because of a public key, that needs to be set up before the install statement.

    这篇关于如何在ubuntu上重新安装cassandra?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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