diff --git a/CHANGES.txt b/CHANGES.txt index d99cc9d562..e386f8149f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,12 +2,17 @@ dev * sstable versioning (CASSANDRA-389) * bitmask matching in SliceRange queries (CASSANDRA-764) * switched to slf4j logging (CASSANDRA-625) - * drain method to flush memtables and purge commit log prior to shutdown. (CASSANDRA-880) + * drain method to flush memtables and purge commit log prior to shutdown. + (CASSANDRA-880) * access levels for authentication/authorization (CASSANDRA-900) * add ReadRepairChance to CF definition (CASSANDRA-930) * fix heisenbug in system tests, especially common on OS X (CASSANDRA-944) * convert to byte[] keys internally and all public APIs (CASSANDRA-767) * ability to alter schema definitions on a live cluster (CASSANDRA-44) + * renamed configuration file to cassandra.xml, and log4j.properties to + log4j-server.properties, which must now be loaded from + the classpath (which is how our scripts in bin/ have always done it) + (CASSANDRA-971) 0.6.1 diff --git a/NEWS.txt b/NEWS.txt index 5d5710ab91..b4e74e9c66 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -3,6 +3,8 @@ Configuraton ------------ + - Configuration file renamed to cassandra.xml and log4j.properties to + log4j-server.properties - The ThriftAddress and ThriftPort directives have been renamed to RPCAddress and RPCPort respectively. - The keyspaces defined in storage-conf.xml are ignored on startup as a diff --git a/bin/cassandra b/bin/cassandra index b602a9bb95..7864c33a39 100755 --- a/bin/cassandra +++ b/bin/cassandra @@ -104,7 +104,7 @@ launch_service() foreground=$2 props=$3 class=$4 - cassandra_parms="-Dstorage-config=$CASSANDRA_CONF" + cassandra_parms="-Dlog4j.configuration=log4j-server.properties" if [ "x$pidpath" != "x" ]; then cassandra_parms="$cassandra_parms -Dcassandra-pidfile=$pidpath" diff --git a/bin/cassandra.bat b/bin/cassandra.bat index 2cc8447697..3300ed63be 100644 --- a/bin/cassandra.bat +++ b/bin/cassandra.bat @@ -44,7 +44,7 @@ set JAVA_OPTS=^ REM ***** CLASSPATH library setting ***** REM Ensure that any user defined CLASSPATH variables are not used on startup -set CLASSPATH= +set CLASSPATH=%CASSANDRA_HOME%\conf REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable. for %%i in (%CASSANDRA_HOME%\lib\*.jar) do call :append %%~fi @@ -57,7 +57,7 @@ goto :eof :okClasspath REM Include the build\classes directory so it works in development set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_HOME%\build\classes -set CASSANDRA_PARAMS=-Dcassandra -Dstorage-config="%CASSANDRA_CONF%" -Dcassandra-foreground=yes +set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes goto runDaemon :runDaemon diff --git a/conf/storage-conf.xml b/conf/cassandra.xml similarity index 100% rename from conf/storage-conf.xml rename to conf/cassandra.xml diff --git a/conf/log4j.properties b/conf/log4j-server.properties similarity index 100% rename from conf/log4j.properties rename to conf/log4j-server.properties diff --git a/src/java/org/apache/cassandra/avro/CassandraDaemon.java b/src/java/org/apache/cassandra/avro/CassandraDaemon.java index e378687213..94e92cfcc9 100644 --- a/src/java/org/apache/cassandra/avro/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/avro/CassandraDaemon.java @@ -50,10 +50,6 @@ public class CassandraDaemon { private void setup() throws IOException { - // log4j - String file = System.getProperty("storage-config") + File.separator + "log4j.properties"; - PropertyConfigurator.configure(file); - listenPort = DatabaseDescriptor.getRpcPort(); listenAddr = DatabaseDescriptor.getRpcAddress(); diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index a3bbf85303..da57ba2f4b 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -33,7 +33,6 @@ import org.apache.cassandra.locator.AbstractReplicationStrategy; import org.apache.cassandra.io.util.FileUtils; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.utils.FBUtilities; -import org.apache.cassandra.utils.UUIDGen; import org.apache.cassandra.utils.XMLUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -132,7 +131,7 @@ public class DatabaseDescriptor private static IAuthenticator authenticator = new AllowAllAuthenticator(); - private final static String STORAGE_CONF_FILE = "storage-conf.xml"; + private final static String STORAGE_CONF_FILE = "cassandra.xml"; private static final UUID INITIAL_VERSION = new UUID(4096, 0); // has type nibble set to 1, everything else to zero. private static UUID defsVersion = INITIAL_VERSION; @@ -140,17 +139,13 @@ public class DatabaseDescriptor /** * Try the storage-config system property, and then inspect the classpath. */ - static String getStorageConfigPath() + static String getStorageConfigPath() throws ConfigurationException { - String scp = System.getProperty("storage-config") + File.separator + STORAGE_CONF_FILE; - if (new File(scp).exists()) - return scp; - // try the classpath ClassLoader loader = DatabaseDescriptor.class.getClassLoader(); URL scpurl = loader.getResource(STORAGE_CONF_FILE); if (scpurl != null) return scpurl.getFile(); - throw new RuntimeException("Cannot locate " + STORAGE_CONF_FILE + " via storage-config system property or classpath lookup."); + throw new ConfigurationException("Cannot locate " + STORAGE_CONF_FILE + " on the classpath"); } private static int stageQueueSize_ = 4096; diff --git a/src/java/org/apache/cassandra/thrift/CassandraDaemon.java b/src/java/org/apache/cassandra/thrift/CassandraDaemon.java index 06eb70c43e..62e2eb5081 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/thrift/CassandraDaemon.java @@ -60,10 +60,6 @@ public class CassandraDaemon private void setup() throws IOException, TTransportException { - // log4j - String file = System.getProperty("storage-config") + File.separator + "log4j.properties"; - PropertyConfigurator.configure(file); - int listenPort = DatabaseDescriptor.getRpcPort(); InetAddress listenAddr = DatabaseDescriptor.getRpcAddress();