简体   繁体   English

无法在Ubuntu 18.04上重新安装Cassandra

[英]Cannot reinstall Cassandra on Ubuntu 18.04

I have a standard version of Ubuntu 18.04 freshly installed and want to use it as a Cassandra node. 我刚安装了标准版本的Ubuntu 18.04,并希望将其用作Cassandra节点。

I went through the following steps to install Cassandra: 我按照以下步骤安装了Cassandra:

##
## Install java 1.8
sudo apt install openjdk-8-jre -y
##
## Check java version
java -version
##
## Create the JAVA_HOME link
echo "JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")" | sudo tee -a /etc/profile
source /etc/profile
echo $JAVA_HOME
##
## Create the Apache Cassandra 3.11.x apt repo:
echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
##
## If GPG public key error
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA
sudo apt-get update
##
## Install cassandra
sudo apt-get install cassandra
##
## Service status
sudo service cassandra status

Output: 输出:

cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (exited) since Thu 2018-08-02 23:03:47 UTC; 4h 2min ago
 Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 4662)
CGroup: /system.slice/cassandra.service

The "active (exited)" part makes me think something went wrong. “活动(退出)”部分使我认为出了点问题。

I wanted to give it a re-try, and uninstall cassandra by doing: 我想重新尝试,并通过执行以下操作卸载cassandra:

sudo apt-get remove cassandra
sudo apt-get purge "cassandra-*"
sudo rm -rf /var/lib/cassandra
sudo rm -rf /var/log/cassandra
sudo rm -rf /etc/cassandra
sudo apt-get update

went through the same installing steps, and now /etc/cassandra contains only /triggers/, all configuration files are missing. 经过相同的安装步骤,现在/ etc / cassandra仅包含/ triggers /,所有配置文件都丢失了。

My guess is that I haven't completely cleant up something 我的猜测是我还没有完全清理过一些东西

In my limited debian/ubuntu experience, purging a package does nothing for removing dependencies. 以我有限的debian / ubuntu经验,清除软件包对删除依赖项无效。 So people make the mistake that if they purge a package, then their system is returned to the state that it was in before the package was installed, which isn't true because all off the dependencies and their config files are still in the system. 因此,人们会犯一个错误:如果清除软件包,则系统将返回到安装软件包之前的状态,这是不正确的,因为所有依赖项及其配置文件仍在系统中。

So when removing a package, remove the dependencies too. 因此,在删除软件包时,也请删除依赖项。 I would do something like this: 我会做这样的事情:

sudo apt-get remove package_name
sudo apt-get purge package_name
sudo apt-get --purge autoremove
sudo apt-get clean

As far as your original problem, I would ask if it logged any errors in /var/log/cassandra/system.log but it looks like you deleted the logs. 至于您的原始问题,我想问一下它是否在/var/log/cassandra/system.log记录了任何错误,但看起来您删除了日志。

Did java -version output what you expected? java -version是否输出了您期望的结果?

Also make sure you have python and python-support installed 还要确保您已安装pythonpython-support

After doing a google search, you could check this out Cassandra status changing from active(running) to active(exited) without any errors 谷歌搜索后,您可以检查出Cassandra状态从活动(运行)更改为活动(退出)而没有任何错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM