You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/20 13:51:23 UTC

[28/33] git commit: adding all config files to the single JVM product

adding all config files to the single JVM product


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f6d50e86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f6d50e86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f6d50e86

Branch: refs/heads/master
Commit: f6d50e869c82d14cac320e4f1d5266143287cbda
Parents: 27f447b
Author: Nirmal Fernando <ni...@apache.org>
Authored: Thu Mar 20 13:11:34 2014 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Thu Mar 20 13:11:34 2014 +0530

----------------------------------------------------------------------
 .../main/autoscale-policies/economyPolicy.xml   |  28 +++
 .../distribution/src/main/conf/autoscaler.xml   |  45 +++++
 .../src/main/conf/cipher-text.properties        |  29 +++
 .../src/main/conf/cipher-tool.properties        |  36 ++++
 .../distribution/src/main/conf/jndi.properties  |   3 +
 .../distribution/src/main/conf/log4j.properties | 172 ++++++++++++++++++
 .../distribution/src/main/conf/mincheck.drl     |  79 ++++++++
 .../distribution/src/main/conf/scaling.drl      | 182 +++++++++++++++++++
 .../distribution/src/main/conf/terminateall.drl |  44 +++++
 .../deployment-policies/economy-deployment.xml  |  25 +++
 .../src/main/partitions/partitions.xml          |  39 ++++
 11 files changed, 682 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/autoscale-policies/economyPolicy.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/autoscale-policies/economyPolicy.xml b/products/stratos/modules/distribution/src/main/autoscale-policies/economyPolicy.xml
new file mode 100644
index 0000000..739ec42
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/autoscale-policies/economyPolicy.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<autoscalePolicy id="economyPolicy">
+	<loadThresholds>
+		<requestsInFlight>
+			<average value="400" />
+			<gradient value="1" />
+			<secondDerivative value="0.2" />
+			<scaleDownMarginOfGradient  value="1.0" />
+			<scaleDownMarginOfSecondDerivative value="0.2" />
+		</requestsInFlight>
+		<!-- Normalized memory consumption of a cluster as a percentage -->
+		<memoryConsumption>
+			<average value="80" />
+			<gradient value="1" />
+			<secondDerivative value="0.2" />
+			<scaleDownMarginOfGradient value="1.0" />
+			<scaleDownMarginOfSecondDerivative value="0.2" />
+		</memoryConsumption>
+		<!-- Normalized load average of a cluster as a percentage -->
+		<loadAverage>
+			<average value="80" />
+			<gradient value="1" />
+			<secondDerivative value="0.2" />
+			<scaleDownMarginOfGradient value="1.0" />
+			<scaleDownMarginOfSecondDerivative value="0.2" />
+		</loadAverage>
+	</loadThresholds>
+</autoscalePolicy>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/autoscaler.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/autoscaler.xml b/products/stratos/modules/distribution/src/main/conf/autoscaler.xml
new file mode 100644
index 0000000..18c44a2
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/autoscaler.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+       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.
+-->
+<configuration>
+	<autoscaler>
+	    <rulesEvaluator>
+	        <schedule>
+		    <initialDelay>30</initialDelay>
+	            <period>15</period>
+	        </schedule>
+	    </rulesEvaluator>
+	    <cloudController>
+	        <hostname>localhost</hostname>
+		<port>9444</port>
+		<!-->CC client timout in ms<-->
+                <clientTimeout>300000</clientTimeout>
+	    </cloudController>
+            <stratosManager>
+	        <hostname>localhost</hostname>
+		<port>9445</port>
+		<!--SM client timeout in ms-->
+                <clientTimeout>300000</clientTimeout>
+	    </stratosManager>
+	    <member>
+		<!-->member expiry timeout (time waited till activation) in ms<-->
+		<expiryTimeout>900000</expiryTimeout>
+	    </member>
+	</autoscaler>
+</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/cipher-text.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/cipher-text.properties b/products/stratos/modules/distribution/src/main/conf/cipher-text.properties
new file mode 100644
index 0000000..02d8c93
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/cipher-text.properties
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+#aliases=esb
+#
+## configuration  per each plaintext
+#esb.secret=M6U74dMVvRm4XFMczki2qZ6CsTvnUuRTjSditlACR5vTISSMI7F/mCTVJGOGdKJjij+VWVhBtmAOkElyvR9TwlUECnZ1o5DNsTK6l8je+9amc/ziTQLP3Q1tzm/Ex1pzHsG6jPGGrv3O0B9pZTfYFqRvlcNhM7Ve3WvA3ibs4Yk=
+#esb.secret.alias=wso2carbon
+#esb.secret.keystore=identity
+#cloud.controller.openstack.credential=[<openstack-credential>]
+#cloud.controller.openstack.identity=[<openstack-identity>]
+#cloud.controller.ec2.credential=[<ec2-credential>]
+#cloud.controller.ec2.identity=[<ec2-credential>]

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/cipher-tool.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/cipher-tool.properties b/products/stratos/modules/distribution/src/main/conf/cipher-tool.properties
new file mode 100644
index 0000000..557a892
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/cipher-tool.properties
@@ -0,0 +1,36 @@
+# This properties file contains all the aliases to be used in carbon components. If any property need to be secured, you need to add alias name and the value. This value is described as follows.
+# The value goes as, the file name//xpath to the property value to be secured,true if xml elements start with capital letter. Please check existing property values below.
+
+transports.https.keystorePass=mgt-transports.xml//transports/transport[@name='https']/parameter[@name='keystorePass'],false
+Carbon.Security.KeyStore.Password=carbon.xml//Server/Security/KeyStore/KeyPassword,true
+Carbon.Security.KeyStore.KeyPassword=carbon.xml//Server/Security/KeyStore/Password,true
+Carbon.Security.TrustStore.Password=carbon.xml//Server/Security/TrustStore/Password,true
+UserManager.AdminUser.Password=user-mgt.xml//UserManager/Realm/Configuration/AdminUser/Password,true
+Datasources.WSO2_CARBON_DB.Configuration.Password=master-datasources.xml//datasources-configuration/datasources/datasource[name='WSO2_CARBON_DB']/definition[@type='RDBMS']/configuration/password,false
+#datasource.WSO2AM_DB.configuration.password=master-datasources.xml//datasources-configuration/datasources/datasource[name='WSO2AM_DB']/definition[@type='RDBMS']/configuration/password,false
+#UserStoreManager.Property.ConnectionPassword=user-mgt.xml//UserManager/Realm/UserStoreManager/Property[@name='ConnectionPassword'],true
+#UserStoreManager.Property.password=user-mgt.xml//UserManager/Realm/UserStoreManager/Property[@name='password'],true
+#AuthManager.Password=api-manager.xml//APIManager/AuthManager/Password,true
+#APIGateway.Password=api-manager.xml//APIManager/APIGateway/Password,true
+#APIUsageTracking.BAMPassword=api-manager.xml//APIManager/APIUsageTracking/BAMPassword,true
+#APIUsageTracking.JDBCPassword=api-manager.xml//APIManager/APIUsageTracking/JDBCPassword,true
+#APIKeyManager.Password=api-manager.xml//APIManager/APIKeyManager/Password,true
+#Database.Password=api-manager.xml//APIManager/Database/Password,true
+#Security.UserTrustedRPStore.Password=identity.xml//Server/Security/UserTrustedRPStore/Password
+#Security.UserTrustedRPStore.KeyPassword=identity.xml//Server/Security/UserTrustedRPStore/KeyPassword
+#Identity.System.StorePass=identity.xml//Server/Identity/System/StorePass
+#MultifactorAuthentication.XMPPSettings.XMPPConfig.XMPPPassword=identity.xml//MultifactorAuthentication/XMPPSettings/XMPPConfig/XMPPPassword
+Axis2.Https.Listener.TrustStore.Password=axis2.xml//axisconfig/transportReceiver[@name='https']/parameter[@name='truststore']/TrustStore/Password,false
+Axis2.Https.Listener.KeyStore.Password=axis2.xml//axisconfig/transportReceiver[@name='https']/parameter[@name='keystore']/KeyStore/Password,false
+Axis2.Https.Listener.KeyStore.KeyPassword=axis2.xml//axisconfig/transportReceiver[@name='https']/parameter[@name='keystore']/KeyStore/KeyPassword,false
+Axis2.Https.Sender.TrustStore.Password=axis2.xml//axisconfig/transportSender[@name='https']/parameter[@name='truststore']/TrustStore/Password,false
+Axis2.Https.Sender.KeyStore.Password=axis2.xml//axisconfig/transportSender[@name='https']/parameter[@name='keystore']/KeyStore/Password,false
+Axis2.Https.Sender.KeyStore.KeyPassword=axis2.xml//axisconfig/transportSender[@name='https']/parameter[@name='keystore']/KeyStore/KeyPassword,false
+Axis2.Mailto.Parameter.Password=axis2.xml//axisconfig/transportSender[@name='mailto']/parameter[@name='mail.smtp.password'],false
+eventBrokerConfig.eventBroker.deliveryManager.remoteMessageBroker.password=event-broker.xml//eventBrokerConfig/eventBroker/deliveryManager/remoteMessageBroker/password,false
+cloud.controller.openstack.credential=cloud-controller.xml//cloudController/iaasProviders/iaasProvider[@type='openstack']/credential,true
+cloud.controller.openstack.identity=cloud-controller.xml//cloudController/iaasProviders/iaasProvider[@type='openstack']/identity,true
+cloud.controller.ec2.credential=cloud-controller.xml//cloudController/iaasProviders/iaasProvider[@type='openstack']/credential,true
+cloud.controller.ec2.identity=cloud-controller.xml//cloudController/iaasProviders/iaasProvider[@type='openstack']/identity,true
+
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/jndi.properties b/products/stratos/modules/distribution/src/main/conf/jndi.properties
new file mode 100644
index 0000000..0cfb977
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/jndi.properties
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
+connectionfactoryName=topicConnectionfactory
+connectionfactory.topicConnectionfactory=amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5677'&reconnect='true'

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/log4j.properties b/products/stratos/modules/distribution/src/main/conf/log4j.properties
new file mode 100644
index 0000000..406e572
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/log4j.properties
@@ -0,0 +1,172 @@
+#
+# 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.
+#
+
+#
+# This is the log4j configuration file used by Stratos
+#
+
+log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG
+
+log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE
+log4j.logger.org.apache.axis2.wsdl.codegen.writer.PrettyPrinter=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.axis2.clustering=INFO
+log4j.logger.org.apache=INFO
+log4j.logger.org.apache.catalina=WARN
+log4j.logger.org.apache.tomcat=WARN
+log4j.logger.org.wso2.carbon.apacheds=WARN
+log4j.logger.org.apache.directory.server.ldap=WARN
+log4j.logger.org.apache.directory.server.core.event=WARN
+log4j.logger.com.atomikos=INFO,ATOMIKOS
+log4j.logger.org.quartz=WARN
+log4j.logger.org.apache.jackrabbit.webdav=WARN
+log4j.logger.org.apache.juddi=ERROR
+log4j.logger.org.apache.commons.digester.Digester=WARN
+log4j.logger.org.apache.jasper.compiler.TldLocationsCache=WARN
+log4j.logger.org.apache.qpid=WARN
+log4j.logger.org.apache.qpid.server.Main=INFO
+log4j.logger.qpid.message=WARN
+log4j.logger.qpid.message.broker.listening=INFO
+log4j.logger.org.apache.tiles=WARN
+log4j.logger.org.apache.commons.httpclient=ERROR
+log4j.logger.org.apache.coyote=WARN
+log4j.logger.org.apache.solr=ERROR
+log4j.logger.org.infinispan=WARN
+log4j.logger.org.jgroups=ERROR
+log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=ERROR
+log4j.logger.org.wso2=INFO
+
+# Apache Stratos logging configuration
+log4j.logger.org.apache.stratos.autoscaler=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.apache.stratos.cloud.controller=INFO
+log4j.logger.org.wso2.andes.client=ERROR
+
+log4j.logger.org.apache.axis2.enterprise=FATAL, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.opensaml.xml=WARN, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_LOGFILE, CARBON_MEMORY 
+
+# Following are to remove false error messages from startup (IS)
+log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.core.DefaultDirectoryService=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.core=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+
+# Hive logging configuration
+log4j.logger.DataNucleus=ERROR
+log4j.logger.Datastore=ERROR
+log4j.logger.Datastore.Schema=ERROR
+log4j.logger.JPOX.Datastore=ERROR
+log4j.logger.JPOX.Plugin=ERROR
+log4j.logger.JPOX.MetaData=ERROR
+log4j.logger.JPOX.Query=ERROR
+log4j.logger.JPOX.General=ERROR
+log4j.logger.JPOX.Enhancer=ERROR
+log4j.logger.org.apache.hadoop.hive=WARN
+log4j.logger.hive=WARN
+log4j.logger.ExecMapper=WARN
+log4j.logger.ExecReducer=WARN
+log4j.logger.net.sf.ehcache.config.ConfigurationFactory=ERROR
+log4j.logger.org.apache.axis2.clustering.tribes.Axis2GroupChannel=FATAL
+
+log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE
+
+log4j.additivity.org.apache.axis2.clustering=false
+log4j.additivity.com.atomikos=false
+
+# CARBON_CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CARBON_CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CARBON_CONSOLE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m%n
+log4j.appender.CARBON_CONSOLE.layout.TenantPattern=%U%@%D[%T]
+log4j.appender.CARBON_CONSOLE.threshold=DEBUG
+
+# CARBON_MEMORY is set to be a MemoryAppender using a PatternLayout.
+log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.appenders.MemoryAppender
+log4j.appender.CARBON_MEMORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.CARBON_MEMORY.bufferSize=200
+# ConversionPattern will be overridden by the configuration setting in the DB
+#log4j.appender.CARBON_MEMORY.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n
+log4j.appender.CARBON_MEMORY.layout.ConversionPattern=[%d] %5p {%c} - %x %m%n
+log4j.appender.CARBON_MEMORY.threshold=DEBUG
+
+
+# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout.
+log4j.appender.CARBON_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+# Log file will be overridden by the configuration setting in the DB
+# This path should be relative to WSO2 Carbon Home
+log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log
+log4j.appender.CARBON_LOGFILE.Append=true
+log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.CARBON_LOGFILE.threshold=DEBUG
+
+log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender
+log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout
+log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost
+log4j.appender.CARBON_SYS_LOG.Facility=USER
+log4j.appender.CARBON_SYS_LOG.threshold=DEBUG
+
+# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT 
+log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender
+log4j.appender.LOGEVENT.url=tcp://10.100.3.103:7611
+log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
+log4j.appender.LOGEVENT.userName=admin
+log4j.appender.LOGEVENT.password=admin
+
+# Appender config to CARBON_TRACE_LOGFILE
+log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log
+log4j.appender.CARBON_TRACE_LOGFILE.Append=true
+log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE
+log4j.additivity.trace.messages=false
+
+# Appender config to AUDIT_LOGFILE
+log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log
+log4j.appender.AUDIT_LOGFILE.Append=true
+log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n
+log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.AUDIT_LOGFILE.threshold=INFO
+log4j.additivity.AUDIT_LOG=false
+
+# Appender config to send Atomikos transaction logs to new log file tm.out.
+log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender
+log4j.appender.ATOMIKOS.File = repository/logs/tm.out
+log4j.appender.ATOMIKOS.Append = true
+log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout
+log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n
+
+# This file is used to override the default logger settings, and is used to remove unwanted logs from Shindig appearing on the console.
+
+# Specification of Handler used by Console Logger
+handlers=java.util.logging.ConsoleHandler
+
+# Replacing default INFO level with SEVERE
+java.util.logging.ConsoleHandler.level=SEVERE

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/mincheck.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/mincheck.drl b/products/stratos/modules/distribution/src/main/conf/mincheck.drl
new file mode 100755
index 0000000..b1c0f7c
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/mincheck.drl
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.autoscaler.rule;
+
+import org.apache.stratos.messaging.domain.topology.Service;
+import org.apache.stratos.messaging.domain.topology.Cluster;
+import org.apache.stratos.autoscaler.AutoscalerContext;
+import org.apache.stratos.autoscaler.Constants;
+import org.apache.stratos.autoscaler.policy.PolicyManager;
+import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
+import org.apache.stratos.autoscaler.policy.model.RequestsInFlight;
+import org.apache.stratos.autoscaler.policy.model.LoadThresholds;
+import org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient;
+import org.apache.stratos.autoscaler.algorithm.AutoscaleAlgorithm;
+import org.apache.stratos.autoscaler.algorithm.OneAfterAnother;
+import org.apache.stratos.autoscaler.algorithm.RoundRobin;
+import org.apache.stratos.autoscaler.PartitionContext;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.apache.stratos.autoscaler.rule.AutoscalerRuleEvaluator;
+import org.apache.commons.logging.Log;
+import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
+import org.apache.stratos.autoscaler.partition.PartitionGroup;
+import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
+import org.apache.stratos.cloud.controller.stub.pojo.MemberContext;
+
+global org.apache.stratos.autoscaler.rule.RuleLog log;
+global org.apache.stratos.autoscaler.policy.PolicyManager $manager;
+global org.apache.stratos.autoscaler.AutoscalerContext $context;
+global org.apache.stratos.autoscaler.rule.RuleTasksDelegator $delegator;
+global org.apache.stratos.messaging.domain.topology.Topology $topology;
+global java.util.Map partitionCtxts;
+global java.lang.String clusterId;
+global java.lang.String lbRef;
+
+rule "Minimum Rule"
+dialect "mvel"
+       when
+           $ctxt : PartitionContext ()
+           eval(log.debug("Running minimum rule: [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId()))
+	       eval(log.debug("[min-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Non terminated member count: " + $ctxt.getNonTerminatedMemberCount()))
+	       eval(log.debug("[min-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Minimum member count: " + $ctxt.getMinimumMemberCount()))
+	       eval($ctxt.getNonTerminatedMemberCount() < $ctxt.getMinimumMemberCount())
+
+       then
+	       $delegator.delegateSpawn($ctxt, clusterId, lbRef);
+	       
+end
+
+rule "Terminate Obsoleted Instances"
+dialect "mvel"
+        when
+            $ctxt : PartitionContext ()
+            eval(log.debug("Running obsolete instances rule: [partition] " + $ctxt.getPartitionId() + " [network-partition] " + $ctxt.getNetworkPartitionId()))
+            eval(log.debug("[obsolete-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() +" Obsolete member count: " + $ctxt.getObsoletedMembers().size()))
+            eval($ctxt.getObsoletedMembers().size() > 0)
+            memberId : String() from $ctxt.getObsoletedMembers()
+            eval(log.debug("[obsolete-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Member id: " + memberId))
+            eval($ctxt.removeObsoleteMember(memberId))
+        then
+           $delegator.terminateObsoleteInstance(memberId);
+end
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/scaling.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/scaling.drl b/products/stratos/modules/distribution/src/main/conf/scaling.drl
new file mode 100644
index 0000000..be13a4b
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/scaling.drl
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.autoscaler.rule;
+
+import org.apache.stratos.messaging.domain.topology.Service;
+import org.apache.stratos.messaging.domain.topology.Cluster;
+import org.apache.stratos.autoscaler.AutoscalerContext;
+import org.apache.stratos.autoscaler.MemberStatsContext;
+import org.apache.stratos.autoscaler.Constants;
+import org.apache.stratos.autoscaler.NetworkPartitionContext;
+import org.apache.stratos.autoscaler.policy.PolicyManager;
+import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
+import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
+import org.apache.stratos.autoscaler.policy.model.RequestsInFlight;
+import org.apache.stratos.autoscaler.policy.model.LoadThresholds;
+import org.apache.stratos.autoscaler.policy.model.MemoryConsumption;
+import org.apache.stratos.autoscaler.policy.model.LoadAverage;
+import org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient;
+import org.apache.stratos.autoscaler.algorithm.AutoscaleAlgorithm;
+import org.apache.stratos.autoscaler.algorithm.OneAfterAnother;
+import org.apache.stratos.autoscaler.algorithm.RoundRobin;
+import org.apache.stratos.autoscaler.PartitionContext;
+import org.apache.stratos.autoscaler.rule.AutoscalerRuleEvaluator;
+import org.apache.stratos.autoscaler.partition.PartitionGroup;
+import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
+import org.apache.stratos.cloud.controller.stub.pojo.MemberContext;
+
+import org.apache.stratos.autoscaler.policy.model.LoadAverage
+import org.apache.stratos.autoscaler.policy.model.MemoryConsumption
+
+global org.apache.stratos.autoscaler.rule.RuleLog log;
+global org.apache.stratos.autoscaler.rule.RuleTasksDelegator $delegator;
+global org.apache.stratos.autoscaler.policy.model.AutoscalePolicy autoscalePolicy;
+global java.lang.String clusterId;
+global java.lang.String lbRef;
+global java.lang.Boolean rifReset;
+global java.lang.Boolean mcReset;
+global java.lang.Boolean laReset;
+
+rule "Scaling Rule"
+dialect "mvel"
+	when
+        $networkPartitionContext : NetworkPartitionContext ()
+
+        $loadThresholds : LoadThresholds() from  autoscalePolicy.getLoadThresholds()
+	    algorithmName : String() from $networkPartitionContext.getPartitionAlgorithm();
+        autoscaleAlgorithm : AutoscaleAlgorithm() from  $delegator.getAutoscaleAlgorithm(algorithmName)
+
+        eval(log.debug("Running scale up rule: [network-partition] " + $networkPartitionContext.getId() + " [cluster] " + clusterId))
+        eval(log.debug("[scaling] [network-partition] " + $networkPartitionContext.getId() + " [cluster] " + clusterId + " Algorithm name: " + algorithmName))
+        eval(log.debug("[scaling] [network-partition] " + $networkPartitionContext.getId() + " [cluster] " + clusterId + " Algorithm: " + autoscaleAlgorithm))
+
+
+        rifAverage : Float() from  $networkPartitionContext.getAverageRequestsInFlight()
+        rifGradient : Float() from  $networkPartitionContext.getRequestsInFlightGradient()
+        rifSecondDerivative : Float() from  $networkPartitionContext.getRequestsInFlightSecondDerivative()
+        rifAverageLimit : Float() from  $loadThresholds.getRequestsInFlight().getAverage()
+	    rifPredictedValue : Double() from $delegator.getPredictedValueForNextMinute(rifAverage, rifGradient, rifSecondDerivative, 1)
+
+        memoryConsumptionAverage : Float() from  $networkPartitionContext.getAverageMemoryConsumption()
+        memoryConsumptionGradient : Float() from  $networkPartitionContext.getMemoryConsumptionGradient()
+        memoryConsumptionSecondDerivative : Float() from  $networkPartitionContext.getMemoryConsumptionSecondDerivative()
+        mcAverageLimit : Float() from  $loadThresholds.getMemoryConsumption().getAverage()
+	    mcPredictedValue : Double() from $delegator.getPredictedValueForNextMinute(memoryConsumptionAverage, memoryConsumptionGradient, memoryConsumptionSecondDerivative, 1)
+
+        loadAverageAverage : Float() from  $networkPartitionContext.getAverageLoadAverage()
+        loadAverageGradient : Float() from  $networkPartitionContext.getLoadAverageGradient()
+        loadAverageSecondDerivative : Float() from  $networkPartitionContext.getLoadAverageSecondDerivative()
+        laAverageLimit : Float() from  $loadThresholds.getLoadAverage().getAverage()
+	    laPredictedValue : Double() from $delegator.getPredictedValueForNextMinute(loadAverageAverage, loadAverageGradient, loadAverageSecondDerivative, 1)
+
+        scaleUp : Boolean() from ((rifReset && (rifPredictedValue > rifAverageLimit * 0.8)) || (mcReset && (mcPredictedValue > mcAverageLimit * 0.8)) || (laReset && (laPredictedValue > laAverageLimit * 0.8)))
+        scaleDown : Boolean() from ((rifReset && (rifPredictedValue < rifAverageLimit * 0.1)) || (mcReset && (mcPredictedValue < mcAverageLimit * 0.1)) || (laReset && (laPredictedValue < laAverageLimit * 0.1)))
+
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " RIF predicted value: " + rifPredictedValue))
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " RIF average limit: " + rifAverageLimit))
+
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " MC predicted value: " + mcPredictedValue))
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " MC average limit: " + mcAverageLimit))
+
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " LA predicted value: " + laPredictedValue))
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " LA Average limit: " + laAverageLimit))
+
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " Scale-up action: " + scaleUp))
+        eval(log.debug("[scaling] " + " [cluster] " + clusterId + " Scale-down action: " + scaleDown))
+
+	then
+        if(scaleUp){
+
+            $networkPartitionContext.resetScaleDownRequestsCount();
+            Partition partition =  autoscaleAlgorithm.getNextScaleUpPartition($networkPartitionContext, clusterId);
+            if(partition != null){
+                log.info("[scale-up] Partition available, hence trying to spawn an instance to scale up!" );
+                log.debug("[scale-up] " + " [partition] " + partition.getId() + " [cluster] " + clusterId );
+                $delegator.delegateSpawn($networkPartitionContext.getPartitionCtxt(partition.getId()), clusterId, lbRef);
+            }
+        } else if(scaleDown){
+
+            log.debug("[scale-down] Decided to Scale down [cluster] " + clusterId);
+            if($networkPartitionContext.getScaleDownRequestsCount() > 5 ){
+                log.debug("[scale-down] Reached scale down requests threshold [cluster] " + clusterId + " Count " + $networkPartitionContext.getScaleDownRequestsCount());
+                $networkPartitionContext.resetScaleDownRequestsCount();
+                MemberStatsContext selectedMemberStatsContext = null;
+                double lowestOverallLoad = 0.0;
+                boolean foundAValue = false;
+                Partition partition =  autoscaleAlgorithm.getNextScaleDownPartition($networkPartitionContext, clusterId);
+                if(partition != null){
+                    log.info("[scale-down] Partition available to scale down ");
+                    log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] " + clusterId);
+                    partitionContext = $networkPartitionContext.getPartitionCtxt(partition.getId());
+
+                    for(MemberStatsContext memberStatsContext: partitionContext.getMemberStatsContexts().values()){
+
+                        LoadAverage loadAverage = memberStatsContext.getLoadAverage();
+                        log.debug("[scale-down] " + " [cluster] "
+                            + clusterId + " [member] " + memberStatsContext.getMemberId() + " Load average: " + loadAverage);
+
+                        MemoryConsumption memoryConsumption = memberStatsContext.getMemoryConsumption();
+                        log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] "
+                            + clusterId + " [member] " + memberStatsContext.getMemberId() + " Memory consumption: " + memoryConsumption);
+
+                        double predictedCpu = $delegator.getPredictedValueForNextMinute(loadAverage.getAverage(),loadAverage.getGradient(),loadAverage.getSecondDerivative(), 1);
+                        log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] "
+                            + clusterId + " [member] " + memberStatsContext.getMemberId() + " Predicted CPU: " + predictedCpu);
+
+                        double predictedMemoryConsumption = $delegator.getPredictedValueForNextMinute(memoryConsumption.getAverage(),memoryConsumption.getGradient(),memoryConsumption.getSecondDerivative(), 1);
+                        log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] "
+                            + clusterId + " [member] " + memberStatsContext.getMemberId() + " Predicted memory consumption: " + predictedMemoryConsumption);
+
+                        double overallLoad = (predictedCpu + predictedMemoryConsumption) / 2;
+                        log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] "
+                            + clusterId + " [member] " + memberStatsContext.getMemberId() + " Overall load: " + overallLoad);
+
+                        if(!foundAValue){
+                            foundAValue = true;
+                            selectedMemberStatsContext = memberStatsContext;
+                            lowestOverallLoad = overallLoad;
+                        } else if(overallLoad < lowestOverallLoad){
+                            selectedMemberStatsContext = memberStatsContext;
+                            lowestOverallLoad = overallLoad;
+                        }
+                    }
+                    if(selectedMemberStatsContext != null) {
+                        log.info("[scale-down] Trying to terminating an instace to scale down!" );
+                        log.debug("[scale-down] " + " [partition] " + partition.getId() + " [cluster] "
+                            + clusterId + " Member with lowest overall load: " + selectedMemberStatsContext.getMemberId());
+
+                        $delegator.delegateTerminate(partitionContext, selectedMemberStatsContext.getMemberId());
+                    }
+                }
+            } else{
+                 log.debug("[scale-down] Not reached scale down requests threshold. " + clusterId + " Count " + $networkPartitionContext.getScaleDownRequestsCount());
+                 $networkPartitionContext.increaseScaleDownRequestsCount();
+
+             }
+        }  else{
+            log.debug("[scaling] No decision made to either scale up or scale down ... ");
+
+        }
+
+end
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/conf/terminateall.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/terminateall.drl b/products/stratos/modules/distribution/src/main/conf/terminateall.drl
new file mode 100644
index 0000000..75c26fc
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/conf/terminateall.drl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.autoscaler.rule;
+
+import org.apache.stratos.messaging.domain.topology.Cluster;
+import org.apache.stratos.autoscaler.PartitionContext;
+
+global org.apache.stratos.autoscaler.rule.RuleLog log;
+global org.apache.stratos.autoscaler.rule.RuleTasksDelegator $delegator;
+
+rule "Terminate all Rule"
+
+dialect "mvel"
+        when
+            $ctxt : PartitionContext ()
+            eval(log.debug("Running terminate all rule: [partition] " + $ctxt.getPartitionId() + " [network-partition] " + $ctxt.getNetworkPartitionId()))
+            eval(log.debug("[terminate all] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() +" Member count: " + $ctxt.getMemberStatsContexts().size()))
+            eval($ctxt.getMemberStatsContexts().size() > 0)
+            memberId : String() from $ctxt.getMemberStatsContexts().keySet()
+            eval(log.debug("[terminate all] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Member id: " + memberId))
+
+        then
+           $delegator.delegateTerminate($ctxt, memberId);
+end
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/deployment-policies/economy-deployment.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/deployment-policies/economy-deployment.xml b/products/stratos/modules/distribution/src/main/deployment-policies/economy-deployment.xml
new file mode 100644
index 0000000..4948b4b
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/deployment-policies/economy-deployment.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<deploymentPolicy id ="economy-deployment">
+		<partitionGroup id="group1" >
+			<partitionAlgo>one-after-another</partitionAlgo>
+			<partition id="P1" >
+				<max>3</max>
+				<min>1</min>
+			</partition>
+			<partition id="P2" >
+				<max>5</max>
+				<min>1</min>
+			</partition>
+		</partitionGroup>
+		<partitionGroup id="group2" >
+			<partitionAlgo>round-robin</partitionAlgo>
+			<partition id="P3" >
+				<max>3</max>
+				<min>1</min>
+			</partition>
+			<partition id="P4" >
+				<max>5</max>
+				<min>1</min>
+			</partition>
+		</partitionGroup>
+</deploymentPolicy>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6d50e86/products/stratos/modules/distribution/src/main/partitions/partitions.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/partitions/partitions.xml b/products/stratos/modules/distribution/src/main/partitions/partitions.xml
new file mode 100644
index 0000000..d9c4d9b
--- /dev/null
+++ b/products/stratos/modules/distribution/src/main/partitions/partitions.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- 
+       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.
+-->
+
+<partitions>
+    <!-- A partition should at least have a provider -->
+    <partition id="P1">
+        <!-- A sample provider level partition -->
+	<provider>ec2</provider>
+    </partition>
+    <partition id="P2">
+	<provider>openstack</provider>
+        <!-- A sample region level partition -->
+        <property name="region" value="region-x"/>
+    </partition>
+    <partition id="P3">
+        <!-- A sample zone level partition -->
+	<provider>ec2</provider>
+        <property name="region" value="region-y"/>
+        <property name="zone" value="zone-1"/>
+    </partition>
+</partitions>