安装 cassandra 时出错
Posted
技术标签:
【中文标题】安装 cassandra 时出错【英文标题】:Error while installing cassandra 【发布时间】:2016-08-21 05:22:06 【问题描述】:我正在尝试按照此处的说明在 ubuntu 16.04 LTS 上安装 apache cassandra -> http://docs.datastax.com/en/cassandra/3.x/cassandra/install/installDeb.html。
但是在运行 sudo apt-get install datastax-ddc 命令时出现以下错误:
Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be
installed. This may mean that you have requested an impossible
situation or if you are using the unstable distribution that
some required packages have not yet been created or been moved
out of Incoming. The following information may help to resolve
the situation:
The following packages have unmet dependencies:
datastax-ddc : Depends: python-support (>= 0.90.0) but it is not
installable
Recommends: ntp but it is not going to be installed or
time-daemon
Recommends: datastax-ddc-tools but it is not going to
be installed E: Unable to correct problems,
you have held broken packages.
datastax-ddc 是坏了还是我的 python 出了什么问题?
【问题讨论】:
试试sudo aptitude install datastax-ddc
?
同样的例外
问题是,16.04 刚出来,还不是稳定版本...
sudo apt-get upgrade
有什么用?
几天前我遇到了同样的问题 - python-support 已从 16.04 中删除 - bugs.launchpad.net/ubuntu/+source/python-support/+bug/1535318
【参考方案1】:
目前,您可以运行以下步骤:
1) 从仓库下载deb包
apt-get download cassandra
2) 安装deb文件,忽略依赖
sudo dpkg --force-depends -i cassandra_3.5_all.deb
显然,您应该确保满足所有其他依赖项。 python-support
已经包含在默认服务器安装中,所以不用担心,但是,python 本身可能尚未安装在您的系统上,因此您应该运行以下 BEFORE dpkg -i ...
:
sudo apt-get install python
要在尝试安装之前查看 .deb 的 Depends: ...
,您可以使用 -I
选项,如下所示:
dpkg -I cassandra_3.5_all.deb
对于 Cassandra 3.5,我看到以下内容:
Depends: openjdk-8-jre-headless | java8-runtime, adduser, python (>= 2.7), python-support (>= 0.90.0)
因此,您可以先运行以下命令以确保确实满足所有依赖项:
sudo apt-get install adduser python oracle-java8-installer
或者如果您想使用 OpenJDK(未测试):
sudo apt-get install adduser python default-jre
【讨论】:
【参考方案2】:答案的简短版本: ubuntu 安装了 python 2 和 python 3,但没有安装现在由 ajenti 维护的 python-support。所以要正确安装 cassandra(如 datastax 文档中描述的正常程序)
https://askubuntu.com/questions/766169/why-no-more-python-support-in-16-04
curl https://raw.githubusercontent.com/ajenti/ajenti/master/scripts/install.sh > install.sh && sudo bash install.sh
wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb
【讨论】:
以上是关于安装 cassandra 时出错的主要内容,如果未能解决你的问题,请参考以下文章
连接 Cassandra 集群时出错 java.net.UnknownHostException
使用 cassandra-jdbc-1.2.1 jar 创建表时出错
从 c#datastax 驱动程序关闭 cassandra 集群时出错