Bug 1069855 - cassandra start script should not search for default cassandra include script
Summary: cassandra start script should not search for default cassandra include script
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Installer, Storage Node
Version: 4.9
Hardware: Unspecified
OS: Unspecified
high vote
Target Milestone: ---
: RHQ 4.13
Assignee: Michael Burman
QA Contact: Mike Foley
Depends On:
Blocks: 1069857
TreeView+ depends on / blocked
Reported: 2014-02-25 19:17 UTC by John Sanda
Modified: 2014-07-14 10:41 UTC (History)
3 users (show)

Clone Of:
: 1069857 (view as bug list)
Last Closed:

Attachments (Terms of Use)

Description John Sanda 2014-02-25 19:17:32 UTC
Description of problem:
The cassandra shell script used by the Storage Node searches for and executes any cassandra.in.sh scripts in the following locations:

  * /usr/share/cassandra/cassandra.in.sh
  * /usr/local/share/cassandra/cassandra.in.sh
  * /opt/cassandra/cassandra.in.sh
  * $HOME/.cassandra.in.sh
  * <storage-node-basedir>/bin/cassandra.in.sh

The problem with all but the last one is that they can conflict with other Cassandra installations on the machine. A community user hit this problem. He installed a rpm distro from DataStax, and it caused the Storage Node to use the settings from that other installation.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Follow steps described at http://www.datastax.com/documentation/cassandra/1.2/cassandra/install/installRHEL_t.html to install an RPM distro of Cassandra 1.2.x
2. Use the default settings for the RPM-based install 
3. Install RHQ as a non-admin user
4. Start the Storage Node as a non-admin user

Actual results:
You should see log messages (from the Storage Node) like,

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)


INFO 15:06:56,211 Classpath: /etc/cassandra/conf


INFO 15:06:56,915 Data files directories: [/var/lib/cassandra/data]

Expected results:
The Storage Node settings should be used.

Additional info:

Comment 1 John Sanda 2014-02-25 19:31:42 UTC
To this point, we have tried to minimize changes to any of the Cassandra bits to keep upgrades easier. One way or another we are going to have to change the start script so maybe we ought to consider renaming the cassandra and cassandra.in.sh scripts to rhq-storage (or rhq-storage-node) and rhq-storage(-node).in.sh.

Comment 2 John Sanda 2014-02-26 16:25:56 UTC
We need to review the Windows start script(s) as well to see if any similar issues could exist on Windows.

Comment 3 Heiko W. Rupp 2014-05-08 14:42:50 UTC
Bump the target version now that 4.11 is out.

Comment 4 Michael Burman 2014-07-14 10:07:02 UTC
Fixed in master

commit fbc3f37bc8d3d4cc65e40a5e6e36c5971e588461
Author: burmanm <miburman@redhat.com>
Date:   Mon Jul 14 13:05:24 2014 +0300

    [BZ 1069855] Force CASSANDRA_INCLUDE environment variable to prevent rhqctl from starting wrong Cassandra instance

Comment 5 Michael Burman 2014-07-14 10:41:10 UTC
And for Windows:

commit 89a2c43668a9d3b9ace75cb23ef96eaa86f7a0f0
Author: burmanm <miburman@redhat.com>
Date:   Mon Jul 14 13:39:51 2014 +0300

    [BZ 1069855] Force CASSANDRA_HOME in Windows environments to prevent starting wrong Cassandra instance from rhqctl

Note You need to log in before you can comment on or make changes to this bug.