Skip to content

Commit

Permalink
use conf/cassandra-env.sh in place of defaults
Browse files Browse the repository at this point in the history
Patch by eevans; reviewed by Brandon Williams for CASSANDRA-1407

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@986940 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Eric Evans committed Aug 18, 2010
1 parent 4a7c7e1 commit c8b5171
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 31 deletions.
7 changes: 5 additions & 2 deletions conf/cassandra-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
# certainly want to adjust this for your environment.
MAX_HEAP_SIZE="1G"

# Specifies the default port over which Cassandra will be available for
# JMX connections.
JMX_PORT="8080"


# Here we create the arguments that will get passed to the jvm when
# starting cassandra.
Expand Down Expand Up @@ -47,7 +51,6 @@ JVM_OPTS="$JVM_OPTS -XX:SurvivorRatio=8"
JVM_OPTS="$JVM_OPTS -XX:MaxTenuringThreshold=1"
JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError"

# JMX options
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.port=8080"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
20 changes: 0 additions & 20 deletions debian/cassandra.default

This file was deleted.

1 change: 1 addition & 0 deletions debian/cassandra.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
conf/log4j-server.properties etc/cassandra
conf/cassandra.yaml etc/cassandra
conf/cassandra-env.sh etc/cassandra
debian/cassandra.in.sh usr/share/cassandra
bin/cassandra usr/sbin
bin/cassandra-cli usr/bin
Expand Down
19 changes: 10 additions & 9 deletions debian/init
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@ PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
CONFDIR=/etc/cassandra
JSVC=/usr/bin/jsvc
JVM_MAX_MEM="1G"
JVM_START_MEM="128M"
JMX_PORT="8080"

# The first existing directory is used for JAVA_HOME if needed.
JVM_SEARCH_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun"

[ -e /usr/share/cassandra/apache-cassandra.jar ] || exit 0
[ -e /etc/cassandra/cassandra.yaml ] || exit 0
[ -e /etc/cassandra/cassandra-env.sh ] || exit 0

# Read Cassandra environment file.
. /etc/cassandra/cassandra-env.sh

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

if [ -z "$JVM_OPTS" ]; then
echo "Initialization failed; \$JVM_OPTS not set!" >&2
exit 3
fi

# If JAVA_HOME has not been set, try to determine it.
if [ -z "$JAVA_HOME" ]; then
# If java is in PATH, use a JAVA_HOME that corresponds to that. This is
Expand Down Expand Up @@ -111,13 +117,8 @@ do_start()
-errfile "&1" \
-outfile /var/log/$NAME/output.log \
-cp `classpath` \
-Xmx$JVM_MAX_MEM \
-Xms$JVM_START_MEM \
-Dlog4j.configuration=log4j-server.properties \
-Dcom.sun.management.jmxremote.port=$JMX_PORT \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
$JVM_EXTRA_OPTS \
$JVM_OPTS \
org.apache.cassandra.thrift.CassandraDaemon

if ! is_running; then return 2; fi
Expand Down

0 comments on commit c8b5171

Please sign in to comment.