You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jon Forrest <jo...@xoom.com> on 2014/03/27 21:29:49 UTC

Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

I'm using Oracle Java 7 on a CentOS 6.5 system.
Running 'java -version' works correctly and shows
I'm running Oracle Java. I don't want to use OpenJDK.
This is good since I notice that the Datastax
documentation in several places says to install
Oracle Java, not OpenJDK.

I want to install Datastax Cassandra 1.2.15 using Yum.
I added the Datastax repository and then ran

yum install dsc12-1.2.10-1 cassandra12-1.2.10-1

Guess what! Yum tries to install java-1.7.0-openjdk !
This is in spite of the fact that a) I already have Oracle
Java installed, and b) the docs say not to install
OpenJDK.

It appears that the Datastax rpm file is violating its
own documentation. What am I doing wrong? How to other
people get around this problem? Is it worth somehow
rebuilding the rpm so that it's not dependent on OpenJDK
or is installing from a tarball the only way to resolve
this?

Thanks for any advice.

Jon Forrest


The information transmitted in this email is intended only for the person or entity to which it is addressed, and may contain material confidential to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited. If you received this email in error, please contact the sender and delete the material from your files.

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Jon Forrest <jo...@xoom.com>.

On 3/28/2014 8:20 AM, Michael Shuler wrote:

>> # 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..)

I don't think so. I believe this is saying that the 'java' package
is missing, not the 'java' binary.

>> 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?

This is the Oracle JDK rpm.

>> 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.

I respectfully disagree.

> 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.

I'm not doubting what you say, but why would the DataStax
website say to use Oracle Java?

> 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.

True, but this is a good idea for reasons having nothing to do
with the Cassandra issue.

> 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.

I think I've solved this problem. I'm going to post another message
in which I describe what I've done.

Jon Forrest


The information transmitted in this email is intended only for the person or entity to which it is addressed, and may contain material confidential to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited. If you received this email in error, please contact the sender and delete the material from your files.

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Michael Shuler <mi...@pbandjelly.org>.
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

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Jon Forrest <jo...@xoom.com>.
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 clearly shows that Cassandra is dependent on java, but
notice that it says nothing about openjdk. However, if I now
run

# yum install 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.

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

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.

Jon Forrest

The information transmitted in this email is intended only for the person or entity to which it is addressed, and may contain material confidential to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited. If you received this email in error, please contact the sender and delete the material from your files.

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Blair Zajac <bl...@orcaware.com>.
On Mar 27, 2014, at 2:16 PM, Michael Dykman <md...@gmail.com> wrote:

> Java on linux has *always* been a hassle. Recently, installing ant via
> apt-get on an active ubuntu still want to yank in components of GCJ
> <shudder>.  Back to the tar-ball.

For Ubuntu and Debian, I use the webupd8team packages, these download the tarball from Oracle and install it:

https://launchpad.net/~webupd8team/+archive/java
http://community.linuxmint.com/tutorial/view/1414

Blair


Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Michael Dykman <md...@gmail.com>.
Java on linux has *always* been a hassle. Recently, installing ant via
apt-get on an active ubuntu still want to yank in components of GCJ
<shudder>.  Back to the tar-ball.

On Thu, Mar 27, 2014 at 4:53 PM, Jon Forrest <jo...@xoom.com> wrote:
>
>
> On 3/27/2014 1:41 PM, prem yadav wrote:
>>
>> I have noticed that too. But even though dse installs opsndjk, it never
>> gets used. So you should be ok.
>
>
> But with two version of Java installed you then have to
> make extra sure that Oracle Java is being used.
>
> It just seems like a good idea to follow the Datastax
> documentation, even if Datastax makes it difficult to
> do so.
>
> It would be great to know the origin of this issue.
>
>
> Jon Forrest
>
> The information transmitted in this email is intended only for the person or
> entity to which it is addressed, and may contain material confidential to
> Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review,
> retransmission, dissemination or other use of, or taking of any action in
> reliance upon, this information by persons or entities other than the
> intended recipient(s) is prohibited. If you received this email in error,
> please contact the sender and delete the material from your files.



-- 
 - michael dykman
 - mdykman@gmail.com

 May the Source be with you.

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Ken Hancock <ke...@schange.com>.
On Thu, Mar 27, 2014 at 4:53 PM, Jon Forrest <jo...@xoom.com> wrote:

> It would be great to know the origin of this issue.
>
>
See http://www.rudder-project.org/redmine/issues/2941 for the mess that has
been created regarding java JRE dependencies.

Ken

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by Jon Forrest <jo...@xoom.com>.

On 3/27/2014 1:41 PM, prem yadav wrote:
> I have noticed that too. But even though dse installs opsndjk, it never
> gets used. So you should be ok.

But with two version of Java installed you then have to
make extra sure that Oracle Java is being used.

It just seems like a good idea to follow the Datastax
documentation, even if Datastax makes it difficult to
do so.

It would be great to know the origin of this issue.

Jon Forrest

The information transmitted in this email is intended only for the person or entity to which it is addressed, and may contain material confidential to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited. If you received this email in error, please contact the sender and delete the material from your files.

Re: Installing Datastax Cassandra 1.2.15 Using Yum (Java Issue)

Posted by prem yadav <ip...@gmail.com>.
I have noticed that too. But even though dse installs opsndjk, it never
gets used. So you should be ok.


On Thu, Mar 27, 2014 at 8:29 PM, Jon Forrest <jo...@xoom.com> wrote:

> I'm using Oracle Java 7 on a CentOS 6.5 system.
> Running 'java -version' works correctly and shows
> I'm running Oracle Java. I don't want to use OpenJDK.
> This is good since I notice that the Datastax
> documentation in several places says to install
> Oracle Java, not OpenJDK.
>
> I want to install Datastax Cassandra 1.2.15 using Yum.
> I added the Datastax repository and then ran
>
> yum install dsc12-1.2.10-1 cassandra12-1.2.10-1
>
> Guess what! Yum tries to install java-1.7.0-openjdk !
> This is in spite of the fact that a) I already have Oracle
> Java installed, and b) the docs say not to install
> OpenJDK.
>
> It appears that the Datastax rpm file is violating its
> own documentation. What am I doing wrong? How to other
> people get around this problem? Is it worth somehow
> rebuilding the rpm so that it's not dependent on OpenJDK
> or is installing from a tarball the only way to resolve
> this?
>
> Thanks for any advice.
>
> Jon Forrest
>
>
> The information transmitted in this email is intended only for the person
> or entity to which it is addressed, and may contain material confidential
> to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any
> review, retransmission, dissemination or other use of, or taking of any
> action in reliance upon, this information by persons or entities other than
> the intended recipient(s) is prohibited. If you received this email in
> error, please contact the sender and delete the material from your files.
>