Caveat: I am not super strong on rpm-based distros.

On 03/27/2014 06:57 PM, Jon Forrest wrote:
I've done a little more research on this problem.
I'm now convinced that this is a Cassandra problem,
but not the problem I had originally thought.

For example, I downloaded cassandra12-1.2.15-1.noarch.rpm
and I then ran the following with the results shown:

# rpm -iv cassandra12-1.2.15-1.noarch.rpm
error: Failed dependencies:
         java >= 1.6.0 is needed by cassandra12-1.2.15-1.noarch

This properly indicates the missing dependency, which is not installed, nor provided by a package in your 'rpm -i ...' command. This is a *binary* dependency: the binary 'java' is installed by a package that is in the rpm database. (rpm knows nothing about your tar install..)

This clearly shows that Cassandra is dependent on java, but
notice that it says nothing about openjdk. However, if I now
run

# yum install java

There is no package in the yum repository *named* 'java'.

I see (edited)

Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.51-2.4.4.1.el6_5 will be
installed

This is the crux of the problem. By making Cassandra dependent on
"java", instead of "jdk" or "jre", then installing Cassandra will
always require openjdk.

The best (for some value of best) package in the give yum repositories that satisfies the requirement for the 'java' *binary* is the openjdk package.

One way of proving this is what I see when I run

# yum install jdk

which is

Package 2000:jdk-1.7.0_51-fcs.x86_64 already installed and latest version

Is this from some yum repo? I guess this is your custom oracle jdk package from some custom location?

That's what we want the Cassandra rpm to see. So, I'm going to try
repacking the Cassandra rpm to depend on jdk. If all goes well, this
will work, or at least let the installation get farther.

No, C* does not depend on a JDK - it does depend on a JRE, which provides a /usr/bin/java binary.

So, yes.. Oracle has screwed up making use of their once-freely-redistributable JRE and distirbutions have no choice but to only provide OpenJDK packages. This is not really a huge issue, as C* *does* run fine on OpenJDK. It is not suggested for production, but it does run, so satisfying the dependency via OpenJDK is 100% correct - that's the only option in the yum repositories.

I don't know yum/rpm as well as apt/dpkg, but this is a solvable problem, most times, by setting up your own yum/apt repository, if you want to provide your system with custom, non-distribution-provided packages.

I could be convinced that I'm wrong and there could be improvements made for yum/rpm to work better, but a binary dependency of 'java >= $somever' is about a simple as it gets - how that is met for yum is the problem to solve, and oracle made that a "figure it out yourself" problem for sysadmins.

--
Kind regards,
Michael

Reply via email to