cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kesten <j.kes...@enercast.de>
Subject sstablemetadata and sstablerepairedset not working with DSC on Debian
Date Thu, 18 Dec 2014 08:32:51 GMT
Hi,

while curious on the new incremental repairs I updated our cluster to C* 
version 2.1.2 via the Debian apt-repository. Everything went quite well, 
but trying to start the tools sstablemetadata and sstablerepairedset 
lead to the following error:

     root@a01:/home/ifjke# sstablerepairedset
     Error: Could not find or load main class 
org.apache.cassandra.tools.SSTableRepairedAtSetter
     root@a01:/home/ifjke#

Looking at the scripts starting these tools I found that the java 
classpath is build via

     for jar in `dirname $0`/../../lib/*.jar; do
         CLASSPATH=$CLASSPATH:$jar
     done

Because of the scripts beeing located in /usr/bin/ this leads to search 
for libs in /lib. Obviously there are no java or cassandra libraries 
there - nodetool instead uses a different way:

     if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
         for include in "`dirname "$0"`/cassandra.in.sh" \
                        "$HOME/.cassandra.in.sh" \
                        /usr/share/cassandra/cassandra.in.sh \
/usr/local/share/cassandra/cassandra.in.sh \
                        /opt/cassandra/cassandra.in.sh; do
             if [ -r "$include" ]; then
                 . "$include"
                 break
             fi
         done
     elif [ -r "$CASSANDRA_INCLUDE" ]; then
         . "$CASSANDRA_INCLUDE"
     fi

I created a simple patch which works for both sstablemetadata and 
sstablerepairedset for me, but maybe that's worth sharing it:

---SNIP---

--- sstablerepairedset    2014-11-11 15:50:02.000000000 +0000
+++ sstablerepairedset_new    2014-12-18 07:52:26.967368891 +0000
@@ -16,22 +16,19 @@
  # See the License for the specific language governing permissions and
  # limitations under the License.

-if [ "x$CLASSPATH" = "x" ]; then
-
-    # execute from the build dir.
-    if [ -d `dirname $0`/../../build/classes ]; then
-        for directory in `dirname $0`/../../build/classes/*; do
-            CLASSPATH=$CLASSPATH:$directory
-        done
-    else
-        if [ -f `dirname $0`/../lib/stress.jar ]; then
-            CLASSPATH=`dirname $0`/../lib/stress.jar
+if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
+    for include in "`dirname "$0"`/cassandra.in.sh" \
+                   "$HOME/.cassandra.in.sh" \
+                   /usr/share/cassandra/cassandra.in.sh \
+ /usr/local/share/cassandra/cassandra.in.sh \
+                   /opt/cassandra/cassandra.in.sh; do
+        if [ -r "$include" ]; then
+            . "$include"
+            break
          fi
-    fi
-
-    for jar in `dirname $0`/../../lib/*.jar; do
-        CLASSPATH=$CLASSPATH:$jar
      done
+elif [ -r "$CASSANDRA_INCLUDE" ]; then
+    . "$CASSANDRA_INCLUDE"
  fi

  # Use JAVA_HOME if set, otherwise look for java in PATH


---SNIP---

Worked for me on both tools.

Jan

Mime
View raw message