modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
| 3
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/bin/cassandra
| 193 +++++++
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/cassandra-jvm.properties
| 112 ++++
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
| 221 --------
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cli/dbsetup.script
| 40 -
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/create_keyspace.cql
| 1
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/dbsetup.cql
| 42 -
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/Deployer.java
| 32 +
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
| 4
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-env.sh
| 247 ----------
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-jvm.properties
| 112 ++++
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
| 2
modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
| 39 +
modules/plugins/rhq-storage/src/main/resources/META-INF/rhq-plugin.xml
| 15
14 files changed, 506 insertions(+), 557 deletions(-)
New commits:
commit cabe99fea2aa6ecbd2e26f2040ed70951c451dc2
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Jul 13 16:30:19 2013 -0400
initial support for resource configuration with StorageNodeComponent
This commit introduces initial support for reading JVM options.
diff --git
a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
index cc34fe3..737dded 100644
---
a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
+++
b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
@@ -25,7 +25,10 @@
package org.rhq.plugins.storage;
+import java.io.File;
+import java.io.FileInputStream;
import java.util.List;
+import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,6 +41,8 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.core.util.exception.ThrowableUtil;
@@ -47,7 +52,7 @@ import org.rhq.plugins.cassandra.util.KeyspaceService;
/**
* @author John Sanda
*/
-public class StorageNodeComponent extends CassandraNodeComponent implements
OperationFacet {
+public class StorageNodeComponent extends CassandraNodeComponent implements
OperationFacet, ConfigurationFacet {
private Log log = LogFactory.getLog(StorageNodeComponent.class);
@@ -56,6 +61,38 @@ public class StorageNodeComponent extends CassandraNodeComponent
implements Oper
private static final String RHQ_KEYSPACE = "rhq";
@Override
+ public Configuration loadResourceConfiguration() throws Exception {
+ File confDir = new File(getBasedir(), "conf");
+ File jvmOptsFile = new File(confDir, "cassandra-jvm.properties");
+
+ Properties properties = new Properties();
+ properties.load(new FileInputStream(jvmOptsFile));
+
+ Configuration config = new Configuration();
+
+ String heapMinProp = properties.getProperty("heap_min");
+ String heapMaxProp = properties.getProperty("heap_max");
+ String heapNewProp = properties.getProperty("heap_new");
+ String threadStackSizeProp =
properties.getProperty("thread_stack_size");
+
+ config.put(new PropertySimple("minHeapSize",
heapMinProp.substring(4)));
+ config.put(new PropertySimple("maxHeapSize",
heapMaxProp.substring(4)));
+ config.put(new PropertySimple("heapNewSize",
heapNewProp.substring(4)));
+ config.put(new PropertySimple("threadStackSize",
threadStackSizeProp.substring(4)));
+
+ return config;
+ }
+
+ private File getBasedir() {
+ Configuration pluginConfig = getResourceContext().getPluginConfiguration();
+ return new File(pluginConfig.getSimpleValue("baseDir"));
+ }
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport) {
+ }
+
+ @Override
public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
if (name.equals("addNodeMaintenance")) {
return nodeAdded(parameters);
diff --git a/modules/plugins/rhq-storage/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/rhq-storage/src/main/resources/META-INF/rhq-plugin.xml
index f02c8e6..b012f1c 100644
--- a/modules/plugins/rhq-storage/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-storage/src/main/resources/META-INF/rhq-plugin.xml
@@ -111,6 +111,21 @@
</parameters>
</operation>
+ <resource-configuration>
+ <c:group name="MemorySettings">
+ <c:simple-property name="minHeapSize"
+ description="The minimum heap size. This value will be
used with the -Xms JVM option. This
+ should always be the same as Max Heap Size."/>
+ <c:simple-property name="maxHeapSize"
+ description="The maximum heap size. This value will be
used with the -Xmx JVM option."/>
+ <c:simple-property name="heapNewSize"
+ description="The size of the new generation portion of
the heap. This value will be used with
+ the -Xmn JVM option."/>
+ <c:simple-property name="threadStackSize"
+ description="The thread stack size. This memory is
allocated to each thread off heap."/>
+ </c:group>
+ </resource-configuration>
+
<server name="Cassandra Server JVM"
sourcePlugin="JMX" sourceType="JMX Server"
discovery="org.rhq.plugins.jmx.EmbeddedJMXServerDiscoveryComponent"
commit 5d1cb191a0ea22dd4f24379597645aeff3934df7
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Jul 13 13:09:41 2013 -0400
updating/fixing integration test failure
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
index 91a5459..76ff090 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
@@ -103,8 +103,8 @@ public class DeployerITest {
}
@Test(dependsOnMethods = "applyConfigChanges")
- public void verifyConfigChangesToCassandraEnv() throws Exception {
- assertFileDeployedAndUpdated("cassandra-env.sh");
+ public void verifyConfigChangesToCassandraJvmOpts() throws Exception {
+ assertFileDeployedAndUpdated("cassandra-jvm.properties");
}
private void assertFileDeployedAndUpdated(String fileName) throws Exception {
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-env.sh
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-env.sh
deleted file mode 100644
index 62dc0f2..0000000
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-env.sh
+++ /dev/null
@@ -1,247 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-calculate_heap_sizes()
-{
- case "`uname`" in
- Linux)
- system_memory_in_mb=`free -m | awk '/Mem:/ {print $2}'`
- system_cpu_cores=`egrep -c 'processor([[:space:]]+):.*'
/proc/cpuinfo`
- ;;
- FreeBSD)
- system_memory_in_bytes=`sysctl hw.physmem | awk '{print $2}'`
- system_memory_in_mb=`expr $system_memory_in_bytes / 1024 / 1024`
- system_cpu_cores=`sysctl hw.ncpu | awk '{print $2}'`
- ;;
- SunOS)
- system_memory_in_mb=`prtconf | awk '/Memory size:/ {print $3}'`
- system_cpu_cores=`psrinfo | wc -l`
- ;;
- Darwin)
- system_memory_in_bytes=`sysctl hw.memsize | awk '{print $2}'`
- system_memory_in_mb=`expr $system_memory_in_bytes / 1024 / 1024`
- system_cpu_cores=`sysctl hw.ncpu | awk '{print $2}'`
- ;;
- *)
- # assume reasonable defaults for e.g. a modern desktop or
- # cheap server
- system_memory_in_mb="2048"
- system_cpu_cores="2"
- ;;
- esac
-
- # some systems like the raspberry pi don't report cores, use at least 1
- if [ "$system_cpu_cores" -lt "1" ]
- then
- system_cpu_cores="1"
- fi
-
- # set max heap size based on the following
- # max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))
- # calculate 1/2 ram and cap to 1024MB
- # calculate 1/4 ram and cap to 8192MB
- # pick the max
- half_system_memory_in_mb=`expr $system_memory_in_mb / 2`
- quarter_system_memory_in_mb=`expr $half_system_memory_in_mb / 2`
- if [ "$half_system_memory_in_mb" -gt "1024" ]
- then
- half_system_memory_in_mb="1024"
- fi
- if [ "$quarter_system_memory_in_mb" -gt "8192" ]
- then
- quarter_system_memory_in_mb="8192"
- fi
- if [ "$half_system_memory_in_mb" -gt
"$quarter_system_memory_in_mb" ]
- then
- max_heap_size_in_mb="$half_system_memory_in_mb"
- else
- max_heap_size_in_mb="$quarter_system_memory_in_mb"
- fi
- MAX_HEAP_SIZE="${max_heap_size_in_mb}M"
-
- # Young gen: min(max_sensible_per_modern_cpu_core * num_cores, 1/4 * heap size)
- max_sensible_yg_per_core_in_mb="100"
- max_sensible_yg_in_mb=`expr $max_sensible_yg_per_core_in_mb "*"
$system_cpu_cores`
-
- desired_yg_in_mb=`expr $max_heap_size_in_mb / 4`
-
- if [ "$desired_yg_in_mb" -gt "$max_sensible_yg_in_mb" ]
- then
- HEAP_NEWSIZE="${max_sensible_yg_in_mb}M"
- else
- HEAP_NEWSIZE="${desired_yg_in_mb}M"
- fi
-}
-
-# Determine the sort of JVM we'll be running on.
-
-java_ver_output=`"${JAVA:-java}" -version 2>&1`
-
-jvmver=`echo "$java_ver_output" | awk -F'"' 'NR==1 {print
$2}'`
-JVM_VERSION=${jvmver%_*}
-JVM_PATCH_VERSION=${jvmver#*_}
-
-jvm=`echo "$java_ver_output" | awk 'NR==2 {print $1}'`
-case "$jvm" in
- OpenJDK)
- JVM_VENDOR=OpenJDK
- # this will be "64-Bit" or "32-Bit"
- JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $2}'`
- ;;
- "Java(TM)")
- JVM_VENDOR=Oracle
- # this will be "64-Bit" or "32-Bit"
- JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $3}'`
- ;;
- *)
- # Help fill in other JVM values
- JVM_VENDOR=other
- JVM_ARCH=unknown
- ;;
-esac
-
-
-# Override these to set the amount of memory to allocate to the JVM at
-# start-up. For production use you may wish to adjust this for your
-# environment. MAX_HEAP_SIZE is the total amount of memory dedicated
-# to the Java heap; HEAP_NEWSIZE refers to the size of the young
-# generation. Both MAX_HEAP_SIZE and HEAP_NEWSIZE should be either set
-# or not (if you set one, set the other).
-#
-# The main trade-off for the young generation is that the larger it
-# is, the longer GC pause times will be. The shorter it is, the more
-# expensive GC will be (usually).
-#
-# The example HEAP_NEWSIZE assumes a modern 8-core+ machine for decent pause
-# times. If in doubt, and if you do not particularly want to tweak, go with
-# 100 MB per physical CPU core.
-
-#MAX_HEAP_SIZE="4G"
-#HEAP_NEWSIZE="800M"
-
-if [ "x$MAX_HEAP_SIZE" = "x" ] && [
"x$HEAP_NEWSIZE" = "x" ]; then
- calculate_heap_sizes
-else
- if [ "x$MAX_HEAP_SIZE" = "x" ] || [ "x$HEAP_NEWSIZE" =
"x" ]; then
- echo "please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs (see
cassandra-env.sh)"
- exit 1
- fi
-fi
-
-# Specifies the default port over which Cassandra will be available for
-# JMX connections.
-JMX_PORT="7200"
-
-
-# Here we create the arguments that will get passed to the jvm when
-# starting cassandra.
-
-# enable assertions. disabling this in production will give a modest
-# performance benefit (around 5%).
-JVM_OPTS="$JVM_OPTS -ea"
-
-# add the jamm javaagent
-if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" \>
"1.6.0" ] \
- || [ "$JVM_VERSION" = "1.6.0" -a "$JVM_PATCH_VERSION"
-ge 23 ]
-then
- JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar"
-fi
-
-# enable thread priorities, primarily so we can give periodic tasks
-# a lower priority to avoid interfering with client workload
-JVM_OPTS="$JVM_OPTS -XX:+UseThreadPriorities"
-# allows lowering thread priority without being root. see
-#
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround....
-JVM_OPTS="$JVM_OPTS -XX:ThreadPriorityPolicy=42"
-
-# min and max heap sizes should be set to the same value to avoid
-# stop-the-world GC pauses during resize, and so that we can lock the
-# heap in memory on startup to prevent any of it from being swapped
-# out.
-JVM_OPTS="$JVM_OPTS -Xms${MAX_HEAP_SIZE}"
-JVM_OPTS="$JVM_OPTS -Xmx${MAX_HEAP_SIZE}"
-JVM_OPTS="$JVM_OPTS -Xmn${HEAP_NEWSIZE}"
-JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError"
-
-# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
-if [ "x$CASSANDRA_HEAPDUMP_DIR" != "x" ]; then
- JVM_OPTS="$JVM_OPTS -XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date
+%s`-pid$$.hprof"
-fi
-
-
-startswith() { [ "${1#$2}" != "$1" ]; }
-
-if [ "`uname`" = "Linux" ] ; then
- # reduce the per-thread stack size to minimize the impact of Thrift
- # thread-per-client. (Best practice is for client connections to
- # be pooled anyway.) Only do so on Linux where it is known to be
- # supported.
- # u34 and greater need 180k
- JVM_OPTS="$JVM_OPTS -Xss180k"
-fi
-echo "xss = $JVM_OPTS"
-
-# GC tuning options
-JVM_OPTS="$JVM_OPTS -XX:+UseParNewGC"
-JVM_OPTS="$JVM_OPTS -XX:+UseConcMarkSweepGC"
-JVM_OPTS="$JVM_OPTS -XX:+CMSParallelRemarkEnabled"
-JVM_OPTS="$JVM_OPTS -XX:SurvivorRatio=8"
-JVM_OPTS="$JVM_OPTS -XX:MaxTenuringThreshold=1"
-JVM_OPTS="$JVM_OPTS -XX:CMSInitiatingOccupancyFraction=75"
-JVM_OPTS="$JVM_OPTS -XX:+UseCMSInitiatingOccupancyOnly"
-JVM_OPTS="$JVM_OPTS -XX:+UseTLAB"
-# note: bash evals '1.7.x' as > '1.7' so this is really a >= 1.7
jvm check
-if [ "$JVM_VERSION" \> "1.7" ] ; then
- JVM_OPTS="$JVM_OPTS -XX:+UseCondCardMark"
-fi
-
-# GC logging options -- uncomment to enable
-# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"
-# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDateStamps"
-# JVM_OPTS="$JVM_OPTS -XX:+PrintHeapAtGC"
-# JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"
-# JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"
-# JVM_OPTS="$JVM_OPTS -XX:+PrintPromotionFailure"
-# JVM_OPTS="$JVM_OPTS -XX:PrintFLSStatistics=1"
-# JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc-`date +%s`.log"
-# If you are using JDK 6u34 7u2 or later you can enable GC log rotation
-# don't stick the date in the log name if rotation is on.
-# JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
-# JVM_OPTS="$JVM_OPTS -XX:+UseGCLogFileRotation"
-# JVM_OPTS="$JVM_OPTS -XX:NumberOfGCLogFiles=10"
-# JVM_OPTS="$JVM_OPTS -XX:GCLogFileSize=10M"
-
-# uncomment to have Cassandra JVM listen for remote debuggers/profilers on port 1414
-# JVM_OPTS="$JVM_OPTS -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1414"
-
-# Prefer binding to IPv4 network intefaces (when net.ipv6.bindv6only=1). See
-#
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6342561 (short version:
-# comment out this entry to enable IPv6 support).
-JVM_OPTS="$JVM_OPTS -Djava.net.preferIPv4Stack=true"
-
-# jmx: metrics and administration interface
-#
-# add this if you're having trouble connecting:
-# JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<public name>"
-#
-# see
-#
https://blogs.oracle.com/jmxetc/entry/troubleshooting_connection_problems...
-# for more on configuring JMX through firewalls, etc. (Short version:
-# get it working with no firewall first.)
-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"
-JVM_OPTS="$JVM_OPTS $JVM_EXTRA_OPTS"
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-jvm.properties
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-jvm.properties
new file mode 100644
index 0000000..a90d23c
--- /dev/null
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra-jvm.properties
@@ -0,0 +1,112 @@
+enable_assertions="-ea"
+
+# JMX settings
+jmx_port=7200
+
+use_thread_priorities="-XX:+UseThreadPriorities"
+
+thread_priority_policy="-XX:ThreadPriorityPolicy=42"
+
+heap_min=-Xms${MAX_HEAP_SIZE}
+heap_max=-Xmx${MAX_HEAP_SIZE}
+heap_new=-Xmn${HEAP_NEWSIZE}
+
+heap_dump_on_OOMError="-XX:+HeapDumpOnOutOfMemoryError"
+
+heap_dump_dir=""
+
+thread_stack_size=-Xss180k
+
+java_agent=""
+# Enable jamm when running on Java 6 patch version 23 or higher.
+#java_agent="-javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar"
+
+# GC tuning options
+#
+# Uses a parallel version of the young generation copying collector alongside
+# the default collector. This minimizes pauses by using all available CPUs in
+# parallel. The collector is compatible with both the default collector and the
+# Concurrent Mark and Sweep (CMS) collector.
+# This is a parallel collector option.
+use_par_new_gc="-XX:+UseParNewGC"
+
+# Whether parallel remark enabled (only if ParNewGC)
+# This is a parallel collector option.
+cms_parallel_remark_enabled="-XX:+CMSParallelRemarkEnabled"
+
+# Uses the Concurrent Mark and Sweep collector. It is a mostly concurrent
+# collector with a low pause time. It is a good match for multi-core systems.
+use_concur_mark_sweep_gc="-XX:+UseConcMarkSweepGC"
+
+# Ratio of eden/survivor space size. The default value is 8.
+# This is a Garbage First (G1) garbage collector option.
+survivor_ratio="-XX:SurvivorRatio=8"
+
+# Maximum value for tenuring threshold.
+# Young collection tuning option.
+max_tenuring_threshold="-XX:MaxTenuringThreshold=1"
+
+# Percentage CMS generation occupancy to start a CMS collection cycle (A
+# negative value means that CMSTirggerRatio is used).
+# This is a CMS tuning option.
+cms_initiating_occupancy_fraction="-XX:CMSInitiatingOccupancyFraction=75"
+
+# Only use occupancy as a criterion for starting a CMS collection.
+# This is a CMS tuning option.
+use_cms_initiating_occupancy_only="-XX:+UseCMSInitiatingOccupancyOnly"
+
+# Use thread local allocation blocks in young space. Enabled by default.
+# This is a young collection tuning option.
+use_tlab="-XX:+UseTLAB"
+
+#####################
+# GC logging options
+#####################
+# Print more details at garbage collection
+#print_gc_details="-XX:+PrintGCDetails"
+print_gc_details=""
+
+# Prefix logging statements with wall clock time.
+#print_gc_datestamps="XX:+PrintGCDateStamps"
+print_gc_datestamps=""
+
+# Print heap layout before and after each garbage collection.
+#print_heap_at_gc="-XX:+PrintHeapAtGC"
+print_heap_at_gc=""
+
+# Print tenuring age information.
+#print_tenuring_distribution="-XX:+PrintTenuringDistribution"
+print_tenuring_distribution=""
+
+# Print the time the application has been stopped.
+#print_gc_application_stopped_time="-XX:+PrintGCApplicationStoppedTime"
+print_gc_application_stopped_time=""
+
+# Print more details about promotion failures.
+#print_promotion_failure="-XX:+PrintPromotionFailure"
+print_promotion_failure=""
+
+# Print statistics for CMS' FreeListSpace.
+#print_flss_stats="-XX:PrintFLSStatistics=1"
+print_flss_stats=""
+
+# Redirects GC output to file instead of console.
+#gc_log_file="-Xloggc:/var/log/cassandra/gc-`date +%s`.log"
+gc_log_file=""
+
+###############################################################################
+# THE FOLLOWING IS READ ONLY
+# Now build the JVM_OPTS variable. The following variables should NOT be
+# directly modified. Instead update the preceding variables. The following
+# variables build up the JVM_OPTS variable that is read by the cassandra and
+# cassandra.bat scripts.
+###############################################################################
+HEAP_OPTS="${heap_min} ${heap_max} ${heap_new} ${heap_dump_on_OOMError}
${thread_stack_size}"
+
+GC_TUNING_OPTS="${use_par_new_gc} ${use_concur_mark_sweep_gc}
${cms_parallel_remark_enabled} ${survivor_ratio} ${max_tenuring_threshold}
${cms_initiating_occupancy_fraction} ${use_cms_initiating_occupancy_only}
${use_tlab}"
+
+GC_LOGGING_OPTS="${print_gc_details} ${print_gc_datestamps} ${print_heap_at_gc}
${print_tenuring_distribution} ${print_gc_application_stopped_time}
${print_promotion_failure} ${print_flss_stats} ${gc_log_file}"
+
+JMX_OPTS="-Dcom.sun.management.jmxremote.port=${jmx_port}
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
+
+JVM_OPTS="${enable_assertions} ${java_agent} ${use_thread_priorities}
${thread_priority_policy} ${HEAP_OPTS} ${GC_TUNING_OPTS} ${GC_LOGGING_OPTS}
${JMX_OPTS}"
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
index 82778c9..15d08f2 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
@@ -681,7 +681,7 @@ client_encryption_options:
# can be: all - all traffic is compressed
# dc - traffic between different datacenters is compressed
# none - nothing is compressed.
-internode_compression: all
+internode_compression: none
# Enable or disable tcp_nodelay for inter-dc communication.
# Disabling it will result in larger (but fewer) network packets being sent,
commit bf78527f20bfeb95fe6040ae5f744bf633d08140
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Jul 13 12:46:07 2013 -0400
remove usage of cassandra-env.sh for cassandra start up
We want to manage C* heap settings and other options/arguments passed to the
C* JVM command line. On linux, the JVM options are set using the JVM_OPTS
shell script variable which is done in cassandra-env.sh. The cassandra-env.sh
script however does not lend itself well to our structured, resource
configuration. The JVM_OPTS variable is now built up in
cassandra-jvm.properties which is a java properties file that also uses legal
shell syntax. The file is sourced from the cassandra start script. This paves
the way for resource configuration of the Cassandra JVM options.
I am also hoping that we can do something similar for Windows where we can use
cassandra-jvm.properties. This would substantially reduce the need for platform
specific code in the storage plugin.
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
b/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
index 0b015b4..42f6c8b 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
@@ -167,6 +167,9 @@
<copy
file="${settings.localRepository}/org/xerial/snappy/snappy-java/${cassandra.snappy.version}/snappy-java-${cassandra.snappy.version}.jar"
todir="${cassandra.dir}/lib"/>
<move file="${project.build.outputDirectory}/cassandra/conf"
todir="${cassandra.dir}"/>
+ <delete file="${cassandra.dir}/bin/cassandra"/>
+ <move
file="${project.build.outputDirectory}/cassandra/bin/cassandra"
todir="${cassandra.dir}/bin"/>
+ <delete
dir="${project.build.outputDirectory}/cassandra"/>
<delete dir="${cassandra.dir}/javadoc"/>
<zip basedir="${cassandra.dir}"
destfile="${cassandra.distro.zip}"/>
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/bin/cassandra
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/bin/cassandra
new file mode 100755
index 0000000..742d9c0
--- /dev/null
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/bin/cassandra
@@ -0,0 +1,193 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# OPTIONS:
+# -f: start in foreground
+# -p <filename>: log the pid to a file (useful to kill it later)
+# -v: print version string and exit
+
+# CONTROLLING STARTUP:
+#
+# This script relies on few environment variables to determine startup
+# behavior, those variables are:
+#
+# CLASSPATH -- A Java classpath containing everything necessary to run.
+# JVM_OPTS -- Additional arguments to the JVM for heap size, etc
+# CASSANDRA_CONF -- Directory containing Cassandra configuration files.
+#
+# As a convenience, a fragment of shell is sourced in order to set one or
+# more of these variables. This so-called `include' can be placed in a
+# number of locations and will be searched for in order. The lowest
+# priority search path is the same directory as the startup script, and
+# since this is the location of the sample in the project tree, it should
+# almost work Out Of The Box.
+#
+# Any serious use-case though will likely require customization of the
+# include. For production installations, it is recommended that you copy
+# the sample to one of /usr/share/cassandra/cassandra.in.sh,
+# /usr/local/share/cassandra/cassandra.in.sh, or
+# /opt/cassandra/cassandra.in.sh and make your modifications there.
+#
+# Another option is to specify the full path to the include file in the
+# environment. For example:
+#
+# $ CASSANDRA_INCLUDE=/path/to/in.sh cassandra -p /var/run/cass.pid
+#
+# Note: This is particularly handy for running multiple instances on a
+# single installation, or for quick tests.
+#
+# Finally, developers and enthusiasts who frequently run from an SVN
+# checkout, and do not want to locally modify bin/cassandra.in.sh, can put
+# a customized include file at ~/.cassandra.in.sh.
+#
+# If you would rather configure startup entirely from the environment, you
+# can disable the include by exporting an empty CASSANDRA_INCLUDE, or by
+# ensuring that no include files exist in the aforementioned search list.
+# Be aware that you will be entirely responsible for populating the needed
+# environment variables.
+
+# NB: Developers should be aware that this script should remain compatible with
+# POSIX sh and Solaris sh. This means, in particular, no $(( )) and no $( ).
+
+# If an include wasn't specified in the environment, then search for one...
+if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
+ # Locations (in order) to use when searching for an include file.
+ for include in /usr/share/cassandra/cassandra.in.sh \
+ /usr/local/share/cassandra/cassandra.in.sh \
+ /opt/cassandra/cassandra.in.sh \
+ "$HOME/.cassandra.in.sh" \
+ "`dirname $0`/cassandra.in.sh"; do
+ if [ -r "$include" ]; then
+ . "$include"
+ break
+ fi
+ done
+# ...otherwise, source the specified include.
+elif [ -r "$CASSANDRA_INCLUDE" ]; then
+ . "$CASSANDRA_INCLUDE"
+fi
+
+# Use JAVA_HOME if set, otherwise look for java in PATH
+if [ -n "$JAVA_HOME" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+else
+ JAVA=java
+fi
+
+# If numactl is available, use it. For Cassandra, the priority is to
+# avoid disk I/O. Even for the purpose of CPU efficiency, we don't
+# really have CPU<->data affinity anyway. Also, empirically test that numactl
+# works before trying to use it (CASSANDRA-3245).
+NUMACTL_ARGS="--interleave=all"
+if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls /
>/dev/null 2>/dev/null
+then
+ NUMACTL="numactl $NUMACTL_ARGS"
+else
+ NUMACTL=""
+fi
+
+if [ -z "$CASSANDRA_CONF" -o -z "$CLASSPATH" ]; then
+ echo "You must set the CASSANDRA_CONF and CLASSPATH vars" >&2
+ exit 1
+fi
+
+if [ -f "$CASSANDRA_CONF/cassandra-env.sh" ]; then
+ #. "$CASSANDRA_CONF/cassandra-env.sh"
+ . "$CASSANDRA_CONF/cassandra-jvm.properties"
+fi
+
+# Special-case path variables.
+case "`uname`" in
+ CYGWIN*)
+ CLASSPATH=`cygpath -p -w "$CLASSPATH"`
+ CASSANDRA_CONF=`cygpath -p -w "$CASSANDRA_CONF"`
+ ;;
+esac
+
+launch_service()
+{
+ pidpath=$1
+ foreground=$2
+ props=$3
+ class=$4
+ cassandra_parms="-Dlog4j.configuration=log4j-server.properties
-Dlog4j.defaultInitOverride=true"
+
+ if [ "x$pidpath" != "x" ]; then
+ cassandra_parms="$cassandra_parms -Dcassandra-pidfile=$pidpath"
+ fi
+
+ # The cassandra-foreground option will tell CassandraDaemon not
+ # to close stdout/stderr, but it's up to us not to background.
+ if [ "x$foreground" != "x" ]; then
+ cassandra_parms="$cassandra_parms -Dcassandra-foreground=yes"
+ exec $NUMACTL "$JAVA" $JVM_OPTS $cassandra_parms -cp
"$CLASSPATH" $props "$class"
+ # Startup CassandraDaemon, background it, and write the pid.
+ else
+ exec $NUMACTL "$JAVA" $JVM_OPTS $cassandra_parms -cp
"$CLASSPATH" $props "$class" <&- &
+ [ ! -z "$pidpath" ] && printf "%d" $! >
"$pidpath"
+ true
+ fi
+
+ return $?
+}
+
+# Parse any command line options.
+args=`getopt vfhp:bD: "$@"`
+eval set -- "$args"
+
+classname="org.apache.cassandra.service.CassandraDaemon"
+
+while true; do
+ case "$1" in
+ -p)
+ pidfile="$2"
+ shift 2
+ ;;
+ -f)
+ foreground="yes"
+ shift
+ ;;
+ -h)
+ echo "Usage: $0 [-f] [-h] [-p pidfile]"
+ exit 0
+ ;;
+ -v)
+ "$JAVA" -cp "$CLASSPATH"
org.apache.cassandra.tools.GetVersion
+ exit 0
+ ;;
+ -D)
+ properties="$properties -D$2"
+ shift 2
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ echo "Error parsing arguments!" >&2
+ exit 1
+ ;;
+ esac
+done
+
+# Start up the service
+launch_service "$pidfile" "$foreground" "$properties"
"$classname"
+
+exit $?
+
+# vi:ai sw=4 ts=4 tw=0 et
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/cassandra-jvm.properties
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/cassandra-jvm.properties
new file mode 100644
index 0000000..612c65e
--- /dev/null
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/cassandra-jvm.properties
@@ -0,0 +1,112 @@
+enable_assertions="-ea"
+
+# JMX settings
+jmx_port="7299"
+
+use_thread_priorities="-XX:+UseThreadPriorities"
+
+thread_priority_policy="-XX:ThreadPriorityPolicy=42"
+
+heap_min="-Xms256M"
+heap_max="-Xms256M"
+heap_new="-Xmn64M"
+
+heap_dump_on_OOMError="-XX:+HeapDumpOnOutOfMemoryError"
+
+heap_dump_dir=""
+
+thread_stack_size="-Xss180k"
+
+java_agent=""
+# Enable jamm when running on Java 6 patch version 23 or higher.
+#java_agent="-javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar"
+
+# GC tuning options
+#
+# Uses a parallel version of the young generation copying collector alongside
+# the default collector. This minimizes pauses by using all available CPUs in
+# parallel. The collector is compatible with both the default collector and the
+# Concurrent Mark and Sweep (CMS) collector.
+# This is a parallel collector option.
+use_par_new_gc="-XX:+UseParNewGC"
+
+# Whether parallel remark enabled (only if ParNewGC)
+# This is a parallel collector option.
+cms_parallel_remark_enabled="-XX:+CMSParallelRemarkEnabled"
+
+# Uses the Concurrent Mark and Sweep collector. It is a mostly concurrent
+# collector with a low pause time. It is a good match for multi-core systems.
+use_concur_mark_sweep_gc="-XX:+UseConcMarkSweepGC"
+
+# Ratio of eden/survivor space size. The default value is 8.
+# This is a Garbage First (G1) garbage collector option.
+survivor_ratio="-XX:SurvivorRatio=8"
+
+# Maximum value for tenuring threshold.
+# Young collection tuning option.
+max_tenuring_threshold="-XX:MaxTenuringThreshold=1"
+
+# Percentage CMS generation occupancy to start a CMS collection cycle (A
+# negative value means that CMSTirggerRatio is used).
+# This is a CMS tuning option.
+cms_initiating_occupancy_fraction="-XX:CMSInitiatingOccupancyFraction=75"
+
+# Only use occupancy as a criterion for starting a CMS collection.
+# This is a CMS tuning option.
+use_cms_initiating_occupancy_only="-XX:+UseCMSInitiatingOccupancyOnly"
+
+# Use thread local allocation blocks in young space. Enabled by default.
+# This is a young collection tuning option.
+use_tlab="-XX:+UseTLAB"
+
+#####################
+# GC logging options
+#####################
+# Print more details at garbage collection
+#print_gc_details="-XX:+PrintGCDetails"
+print_gc_details=""
+
+# Prefix logging statements with wall clock time.
+#print_gc_datestamps="XX:+PrintGCDateStamps"
+print_gc_datestamps=""
+
+# Print heap layout before and after each garbage collection.
+#print_heap_at_gc="-XX:+PrintHeapAtGC"
+print_heap_at_gc=""
+
+# Print tenuring age information.
+#print_tenuring_distribution="-XX:+PrintTenuringDistribution"
+print_tenuring_distribution=""
+
+# Print the time the application has been stopped.
+#print_gc_application_stopped_time="-XX:+PrintGCApplicationStoppedTime"
+print_gc_application_stopped_time=""
+
+# Print more details about promotion failures.
+#print_promotion_failure="-XX:+PrintPromotionFailure"
+print_promotion_failure=""
+
+# Print statistics for CMS' FreeListSpace.
+#print_flss_stats="-XX:PrintFLSStatistics=1"
+print_flss_stats=""
+
+# Redirects GC output to file instead of console.
+#gc_log_file="-Xloggc:/var/log/cassandra/gc-`date +%s`.log"
+gc_log_file=""
+
+###############################################################################
+# THE FOLLOWING IS READ ONLY
+# Now build the JVM_OPTS variable. The following variables should NOT be
+# directly modified. Instead update the preceding variables. The following
+# variables build up the JVM_OPTS variable that is read by the cassandra and
+# cassandra.bat scripts.
+###############################################################################
+HEAP_OPTS="${heap_min} ${heap_max} ${heap_new} ${heap_dump_on_OOMError}
${thread_stack_size}"
+
+GC_TUNING_OPTS="${use_par_new_gc} ${use_concur_mark_sweep_gc}
${cms_parallel_remark_enabled} ${survivor_ratio} ${max_tenuring_threshold}
${cms_initiating_occupancy_fraction} ${use_cms_initiating_occupancy_only}
${use_tlab}"
+
+GC_LOGGING_OPTS="${print_gc_details} ${print_gc_datestamps} ${print_heap_at_gc}
${print_tenuring_distribution} ${print_gc_application_stopped_time}
${print_promotion_failure} ${print_flss_stats} ${gc_log_file}"
+
+JMX_OPTS="-Dcom.sun.management.jmxremote.port=${jmx_port}
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
+
+JVM_OPTS="${enable_assertions} ${java_agent} ${use_thread_priorities}
${thread_priority_policy} ${HEAP_OPTS} ${GC_TUNING_OPTS} ${GC_LOGGING_OPTS}
${JMX_OPTS}"
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/Deployer.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/Deployer.java
index e85813d..1e31e14 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/Deployer.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/Deployer.java
@@ -31,10 +31,12 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
+import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.core.util.PropertiesFileUpdate;
import org.rhq.core.util.TokenReplacingReader;
import org.rhq.core.util.ZipUtil;
import org.rhq.core.util.stream.StreamUtil;
@@ -83,10 +85,13 @@ public class Deployer {
applyConfigChanges(confDir, "cassandra.yaml", tokens);
applyConfigChanges(confDir, "log4j-server.properties", tokens);
- applyConfigChanges(confDir, "cassandra-env.sh", tokens);
+ applyChangesToCassandraJvmProps(confDir, deploymentOptions);
+// applyConfigChanges(confDir, "cassandra-env.sh", tokens);
}
- private void applyConfigChanges(File confDir, String fileName, Map<String,
String> tokens) throws DeploymentException {
+ private void applyConfigChanges(File confDir, String fileName, Map<String,
String> tokens)
+ throws DeploymentException {
+
File filteredFile = new File(confDir, fileName);
try {
if (log.isInfoEnabled()) {
@@ -104,6 +109,29 @@ public class Deployer {
}
}
+ private void applyChangesToCassandraJvmProps(File confDir, DeploymentOptions
deploymentOptions)
+ throws DeploymentException {
+
+ File jvmPropsFile = new File(confDir, "cassandra-jvm.properties");
+ try {
+ log.info("Applying configuration changes to " + jvmPropsFile);
+
+ PropertiesFileUpdate propertiesUpdater = new
PropertiesFileUpdate(jvmPropsFile.getAbsolutePath());
+ Properties properties = propertiesUpdater.loadExistingProperties();
+
+ properties.setProperty("heap_min", "-Xms" +
deploymentOptions.getHeapSize());
+ properties.setProperty("heap_max", "-Xmx" +
deploymentOptions.getHeapSize());
+ properties.setProperty("heap_new", "-Xmn" +
deploymentOptions.getHeapNewSize());
+ properties.setProperty("thread_stack_size", "-Xss" +
deploymentOptions.getStackSize());
+ properties.setProperty("jmx_port",
deploymentOptions.getJmxPort().toString());
+
+ propertiesUpdater.update(properties);
+ } catch (IOException e) {
+ log.error("An error occurred while updating " + jvmPropsFile, e);
+ throw new DeploymentException("An error occurred while updating " +
jvmPropsFile, e);
+ }
+ }
+
public void updateFilePerms() {
File deployDir = new File(deploymentOptions.getBasedir());
File binDir = new File(deployDir, "bin");
commit 7185fb3fbaf98dde194872657c7362134d342c10
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Jul 13 10:08:22 2013 -0400
remove obsolete files that are no longer used
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
deleted file mode 100644
index 19d5647..0000000
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-<project name="rhq_cassandra_bundle"
- default="main"
- xmlns:rhq="antlib:org.rhq.bundle">
- <rhq:bundle name="${rhq.cassandra.bundle.name}"
- version="${rhq.cassandra.bundle.version}"
- description="A bundle for deploying RHQ Cassandra nodes.">
-
- <!--
- NOTE: the name attribute of an rhq:input-property does not support using a dash.
- There is a convention where dashes are used in property names in rhq properties
files
- in the trailing part of a property name. If an rhq:input-property has a
corresponding
- property in cassandra.properties and contains a dash, the dash will be changed to
an
- underscore in this file.
- -->
-
- <rhq:input-property name="cluster.name"
- description="The name of the cluster. This is used to
prevent machines in one logical cluster from joining another"
- required="true"
- defaultValue="rhqdev"
- type="string"/>
-
- <rhq:input-property name="cluster.dir"
- description="The directory in which Cassandra nodes will be
installed"
- required="true"
- defaultValue=""
- type="string"/>
-
- <rhq:input-property name="data.dir"
- description="The directory where Cassandra should store data
files."
- required="true"
- defaultValue="data"
- type="string"/>
-
- <rhq:input-property name="commitlog.dir"
- description="The directory where Cassandra stores its commit
logs."
- required="true"
- defaultValue="commit_log"
- type="string"/>
-
- <rhq:input-property name="saved.caches.dir"
- description="The directory where Cassandra stores saved
caches."
- required="true"
- defaultValue="saved_caches"
- type="string"/>
-
- <rhq:input-property name="log.dir"
- description="The directory where Cassandra stores log
files."
- required="true"
- defaultValue="logs"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.log.file.name"
- description="The name of the log file to which Cassandra
writes."
- required="true"
- defaultValue="rhq-storage-node.log"
- type="string"/>
-
- <rhq:input-property name="logging.level"
- description="The log4j logging level to use."
- required="false"
- defaultValue="DEBUG"
- type="string"/>
-
- <rhq:input-property name="seeds"
- description="A comma-delimited list of IP addresses/host
names that are deemed contact points. Cassandra nodes use this list of hosts to find each
other and learn the topology of the ring. If you are running a local development cluster,
be sure to have aliases set up for localhost."
- required="false"
- defaultValue="127.0.0.1"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.num_tokens"
- description="Defines the number of tokens randomly assigned
to a node on the ring. The more tokens, relative to other nodes, the larger the proportion
of data that this node will store. You probably want all nodes to have the same number of
tokens assuming they have equal hardware capability."
- required="false"
- defaultValue="256"
- type="string"/>
-
- <rhq:input-property name="jmx.port"
- description="The port over which Cassandra listens for JMX
connections. Each node should be assigned a unique port."
- required="false"
- defaultValue="7200"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.storage.port"
- description="The port used for inter-node
communication."
- required="false"
- defaultValue="7000"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.ssl.storage.port"
- description="The port used for encrypted inter-node
communication."
- required="false"
- defaultValue="7001"
- type="string"/>
-
- <rhq:input-property name="listen.address"
- description="Address used for inter-node communication.
Defaults to value of hostname property."
- required="true"
- defaultValue=""
- type="string"/>
-
- <rhq:input-property name="rpc.address"
- description="Address used for Thrift RPC client
communication. Defaults to value of hostname property."
- required="true"
- defaultValue=""
- type="string"/>
-
- <rhq:input-property name="cassandra.ring.delay.property"
- required="false"
- defaultValue=""
- type="string"/>
-
- <rhq:input-property name="cassandra.ring.delay"
- description="When a node initializes it contacts a seed and
then sleeps for RING_DELAY (milliseconds) to learn about other nodes in the cluster.
Cassandra uses a default value of 30 seconds."
- required="false"
- defaultValue=""
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.native_transport_max_threads"
- description="The maximum number of threads handling native
CQL requests."
- required="false"
- defaultValue="64"
- type="integer"/>
-
- <rhq:input-property name="rhq.cassandra.native_transport_port"
- description="The port for the CQL native transport to listen
for clients on."
- required="false"
- defaultValue="9042"
- type="integer"/>
-
- <rhq:input-property name="rhq.cassandra.rpc_port"
- description="The port to listen for Thrift clients
on."
- required="false"
- defaultValue="9160"
- type="integer"/>
-
- <rhq:input-property name="rhq.cassandra.authenticator"
- description="A class that performs authentication. The value
should be a fully qualified class name and implement IAuthenticator."
- required="false"
-
defaultValue="org.rhq.cassandra.auth.SimpleAuthenticator"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.authorizer"
- description="A class that performs authorization. Used to
limit/provide permissions. The value should be a fully qualified class name and implement
IAuthorizer."
- required="false"
- defaultValue="org.rhq.cassandra.auth.SimpleAuthorizer"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.password.properties.file"
- description="The location of the password properties file
used by SimpleAuthenticator. If a relative path is specified, its location is resolved
relative to Cassandra's bin directory."
- required="false"
- defaultValue="./../conf/passwd.properties"
- type="file"/>
-
- <rhq:input-property name="rhq.cassandra.access.properties.file"
- description="The location of the authorization properties
file used by SimpleAuthority. If a relative path is specified, its location is resolved
relative to Cassandra's bin directory."
- required="false"
- defaultValue="./../conf/access.properties"
- type="file"/>
-
- <rhq:input-property name="rhq.cassandra.username"
- description="The username with which to authenticate
requests to Cassandra."
- required="true"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.password"
- description="The password with which to authenticate
requests to Cassandra."
- required="true"
- type="string"/>
-
- <rhq:input-property name="rhq.cassandra.max.heap.size"
- required="true"
- defaultValue="${MAX_HEAP_SIZE}"/>
-
- <rhq:input-property name="rhq.cassandra.heap.new.size"
- required="true"
- defaultValue="${HEAP_NEWSIZE}"/>
-
- <rhq:deployment-unit name="cassandra"
preinstallTarget="pre-install" postinstallTarget="post-install">
-<!--
- <rhq:file name="dbsetup.script"
destinationFile="scripts/dbsetup.script" replace="true"/>
--->
- <rhq:archive name="cassandra.zip">
- <rhq:replace>
- <rhq:fileset dir="conf">
- <include name="cassandra.yaml"/>
- </rhq:fileset>
- <rhq:fileset dir="conf">
- <include name="cassandra-env.sh"/>
- </rhq:fileset>
- <rhq:fileset dir="conf">
- <include name="log4j-server.properties"/>
- </rhq:fileset>
- <rhq:fileset dir="conf">
- <include name="passwd.properties"/>
- </rhq:fileset>
-<!--
- <rhq:fileset dir="scripts">
- <include name="dbsetup.script"/>
- </rhq:fileset>
--->
- </rhq:replace>
- </rhq:archive>
- </rhq:deployment-unit>
- </rhq:bundle>
-
- <target name="main"/>
-
- <target name="pre-install">
- <mkdir dir="${cluster.dir}"/>
-
- </target>
-
- <target name="post-install">
- <property name="bin.dir" value="${rhq.deploy.dir}/bin"/>
-
- <chmod file="${bin.dir}/cassandra" perm="+x"/>
- <chmod file="${bin.dir}/cqlsh" perm="+x"/>
- <chmod file="${bin.dir}/cassandra-cli" perm="+x"/>
- <chmod file="${bin.dir}/nodetool" perm="+x"/>
- </target>
-
-</project>
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cli/dbsetup.script
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cli/dbsetup.script
deleted file mode 100644
index 73bc2a7..0000000
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cli/dbsetup.script
+++ /dev/null
@@ -1,40 +0,0 @@
-create keyspace rhq
- with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and
- strategy_options = {replication_factor:1};
-
-use rhq;
-
-create column family raw_metrics
- with comparator = DateType and
- default_validation_class = DoubleType and
- key_validation_class = Int32Type;
-
-create column family one_hour_metric_data
- with comparator = 'CompositeType(DateType, Int32Type)' and
- default_validation_class = DoubleType and
- key_validation_class = Int32Type;
-
-create column family six_hour_metric_data
- with comparator = 'CompositeType(DateType, Int32Type)' and
- default_validation_class = DoubleType and
- key_validation_class = Int32Type;
-
-create column family twenty_four_hour_metric_data
- with comparator = 'CompositeType(DateType, Int32Type)' and
- default_validation_class = DoubleType and
- key_validation_class = Int32Type;
-
-create column family metrics_work_queue
- with comparator = 'CompositeType(DateType, Int32Type)' and
- default_validation_class = Int32Type and
- key_validation_class = UTF8Type;
-
-create column family resource_traits
- with comparator = 'CompositeType(DateType, Int32Type, Int32Type, UTF8Type,
UTF8Type)' and
- default_validation_class = UTF8Type and
- key_validation_class = Int32Type;
-
-create column family traits
- with comparator = DateType and
- default_validation_class = UTF8Type and
- key_validation_class = Int32Type;
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/create_keyspace.cql
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/create_keyspace.cql
deleted file mode 100644
index 9df13a0..0000000
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/create_keyspace.cql
+++ /dev/null
@@ -1 +0,0 @@
-CREATE KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy',
'replication_factor': 1};
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/dbsetup.cql
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/dbsetup.cql
deleted file mode 100644
index 189b35b..0000000
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/cassandra/cql/dbsetup.cql
+++ /dev/null
@@ -1,42 +0,0 @@
-CREATE KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy',
'replication_factor': 1};
-
-USE rhq;
-
-CREATE TABLE raw_metrics (
- schedule_id int,
- time timestamp,
- value double,
- PRIMARY KEY (schedule_id, time)
-);
-
-CREATE TABLE one_hour_metrics (
- schedule_id int,
- time timestamp,
- type int,
- value double,
- PRIMARY KEY (schedule_id, time, type)
-);
-
-CREATE TABLE six_hour_metrics (
- schedule_id int,
- time timestamp,
- type int,
- value double,
- PRIMARY KEY (schedule_id, time, type)
-);
-
-CREATE TABLE twenty_four_hour_metrics (
- schedule_id int,
- time timestamp,
- type int,
- value double,
- PRIMARY KEY (schedule_id, time, type)
-);
-
-CREATE TABLE metrics_index (
- bucket varchar,
- time timestamp,
- schedule_id int,
- null_col boolean,
- PRIMARY KEY (bucket, time, schedule_id)
-);