diff --git a/symmetric/symmetric-assemble/src/docbook/advanced-topics.xml b/symmetric/symmetric-assemble/src/docbook/advanced-topics.xml index f6a30f227d..839a6980e2 100644 --- a/symmetric/symmetric-assemble/src/docbook/advanced-topics.xml +++ b/symmetric/symmetric-assemble/src/docbook/advanced-topics.xml @@ -998,5 +998,25 @@ Enter key password for basic authentication is setup with the standard configuration in the WEB.xml file. - +
+ Multi-Server Mode + + SymmetricDS supports running multiple SymmetricDS instances that leverage the same web server in the same + process. This mode can be turned on in the web/WEB-INF/web.xml file. By default, multiServerMode + is turned off. + + + + multiServerMode + true + +]]> + + When multiServerMode is turned on, SymmetricDS will initialize itself with an instance of + a node for each properties file found in the engines directory. Each node will inherit + common properties from conf/symmetric.properties. Each properties file must specify the + minimum required properties to define a single node. In addition, the properties file is required to also specify + a property, engine.name, that provides a unique name for the node's engine. + +
diff --git a/symmetric/symmetric-core/src/main/java/org/jumpmind/symmetric/SymmetricEngineHolder.java b/symmetric/symmetric-core/src/main/java/org/jumpmind/symmetric/SymmetricEngineHolder.java index 9332d6d4c4..089cb88f41 100644 --- a/symmetric/symmetric-core/src/main/java/org/jumpmind/symmetric/SymmetricEngineHolder.java +++ b/symmetric/symmetric-core/src/main/java/org/jumpmind/symmetric/SymmetricEngineHolder.java @@ -31,15 +31,15 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jumpmind.symmetric.common.Constants; import org.jumpmind.symmetric.common.ParameterConstants; +import org.jumpmind.symmetric.common.logging.ILog; +import org.jumpmind.symmetric.common.logging.LogFactory; import org.jumpmind.symmetric.service.IRegistrationService; public class SymmetricEngineHolder { - final Log log = LogFactory.getLog(getClass()); + final ILog log = LogFactory.getLog(getClass()); private Map engines = new HashMap(); @@ -109,11 +109,15 @@ protected ISymmetricEngine create(String propertiesFile) { } engine = new StandaloneSymmetricEngine(null, propertiesFile); if (engine != null) { - engines.put(engine.getEngineName(), engine); + if (!engines.containsKey(engine.getEngineName())) { + engines.put(engine.getEngineName(), engine); + } else { + log.error("SymmetricEngineDuplicateName", engine.getEngineName()); + } } return engine; } catch (Exception e) { - log.error(e, e); + log.error(e); return null; } } diff --git a/symmetric/symmetric-core/src/main/resources/symmetric-messages.properties b/symmetric/symmetric-core/src/main/resources/symmetric-messages.properties index f69cfa4973..991673eb51 100644 --- a/symmetric/symmetric-core/src/main/resources/symmetric-messages.properties +++ b/symmetric/symmetric-core/src/main/resources/symmetric-messages.properties @@ -265,6 +265,7 @@ SymmetricDSUpgradeFailed=The upgrade failed. The system may be unstable. Pleas SymmetricDSUpgradeNeeded=Upgrade of node is necessary. Please set the auto.upgrade property to true for an automated upgrade. SymmetricDSManualUpgradeNeeded=A manual upgrade of the node is required. Can not automatically upgrade from version %s to version %s. SymmetricEngineMissing=Could not find a reference to the SymmetricEngine from %s +SymmetricEngineDuplicateName=An engine with the name of %s was not started because an engine of the same name has already been started. Please set the engine.name property in the properties file to a unique name. SymmetricEngineNotRegistered=Did not run the %s job because the engine is not registered. SymmetricEngineNotStarted=The engine is not currently started. SyncDisabled=Synchronization is disabled on the server node.