Skip to content

Commit

Permalink
short snippet of doc multiserver mode. also added check for unique en…
Browse files Browse the repository at this point in the history
…gine.name during startup.
  • Loading branch information
chenson42 committed Nov 3, 2011
1 parent 26915d0 commit 9adcaea
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
22 changes: 21 additions & 1 deletion symmetric/symmetric-assemble/src/docbook/advanced-topics.xml
Expand Up @@ -998,5 +998,25 @@ Enter key password for <sym>
basic authentication is setup with the standard configuration in the WEB.xml file.
</para>
</section>

<section id="multi-server">
<title>Multi-Server Mode</title>
<para>
SymmetricDS supports running multiple SymmetricDS instances that leverage the same web server in the same
process. This mode can be turned on in the <code>web/WEB-INF/web.xml</code> file. By default, <code>multiServerMode</code>
is turned off.
</para>
<programlisting>
<![CDATA[ <context-param>
<param-name>multiServerMode</param-name>
<param-value>true</param-value>
</context-param>
]]></programlisting>
<para>
When <code>multiServerMode</code> is turned on, SymmetricDS will initialize itself with an instance of
a node for each properties file found in the <code>engines</code> directory. Each node will inherit
common properties from <code>conf/symmetric.properties</code>. 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, <code>engine.name</code>, that provides a unique name for the node's engine.
</para>
</section>
</chapter>
Expand Up @@ -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<String, ISymmetricEngine> engines = new HashMap<String, ISymmetricEngine>();

Expand Down Expand Up @@ -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;
}
}
Expand Down
Expand Up @@ -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.
Expand Down

0 comments on commit 9adcaea

Please sign in to comment.