Setting Up Automatic Failover for the Email Sending Daemon
Use the following procedure to designate a backup instance of the Email Sending Daemon.
To set up automatic failover for ESD
-
Install the ESD in two separate directories (for example, ESD1 and ESD2).
-
Configure ESD1 with the default port of 8080 and the default AJP port of 8009.
-
Open the
conf/server.xml
file and uncomment the section that starts with following line:<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" ……. </Cluster>
Make changes on cluster configuration based on the information mentioned in the link below:
https://tomcat.apache.org/tomcat-9.0-doc/cluster-howto.html#Cluster_Basics-
Configure ESD2 as follows:
-
In the
conf/server.xml
file, change the port to any other number (for example, 9090). -
Modify the HTTP/1.1 Connector port parameter:
<!-- Define a non-SSL HTTP/1.1 Connector on port 9090 --> <Connector port="9090" ………..
-
In the
conf/server.xml
file, change the AJP port to any port number other than 8009. -
Modify the AJP 1.3 Connector port parameter (for example, 9009):
<!-- Define an AJP 1.3 Connector on port 9009--> <Connector port="9009" …..
-
If ESD1 and ESD2 are running on the same computer or server, then you must open the install-win32-service.bat file (located in the ESD_root installation directory) and change the value of the Dcom.sun.management.jmxremote.port parameter, Service Name and Description.
Port number can be given any value other than default value of 8096.
-
Open the
conf/server.xml
file and uncomment the section that starts with following line:<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" ……. </Cluster>
Make changes on cluster configuration based on the information mentioned in the link below:
https://tomcat.apache.org/tomcat-9.0-doc/cluster-howto.html#Cluster_Basics-
In the Cluster section, change Receiver,
tcpListenPort
property to a value other than 4001, so that ESD2 will be identified as a unique cluster node. (for example, Update tcpListenPort to 4002).
-
-
The current status of each instance of the ESD must be available to the other instance for automatic failover to occur. For this to happen, share the job status directory of each ESD instance with the other instance.
The job status directory is created when you install the ESD at
esd_root\state_dir
. For each job that is submitted to ESD, a directory is created in thestate_dir\mailings
directory that contains a file named state0.txt.The state0.txt file stores the status of the job. In order to share the job directory, update property name
esd.stateDirectory
inesd.properties
file for both instances by giving a shared path. This path should be accessible by both the instances.Note: If both esd are in the same machine, you can give absolute path of state_dir. Example,esd.stateDirectory= c:\\ems\\esd\\state_dir
. -
Make sure you have installed Apache 2.2.3 Web server.
-
Download JK 1.2 Binary for the operating system you are using from https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/.
For example, if you are using windows u can download tomcat-connectors-1.2.32-windows-i386-httpd-2.2.x from https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/.
-
Unzip connector zip file and place mod_jk.so in <root_dir>\Apache Software Foundation\Apache2.2\modules directory.
If tomcat-connectors contains, mod_jk.so file name with the version number. Example, mod_jk-apache-2.2.3.so then rename the file to mod_jk.so before placing it under Apache2.2\modules directory.
-
Modify the
apache conf/ workers.properties
file by registering both ESD nodes as worker nodes, and registering ESD1 as ACTIVE and ESD2 as HOT STAND BY. If theworkers.properties
file is not present, create one based on the given example and modify the value appropriately:# The advanced router LB worker worker.list=loadbalancer # Define a worker using ajp13 worker.worker1.port=ESD1_AJP_PORT_NUMBER(8009) worker.worker1.host=ESD1_IP_ADDRESS worker.worker1.type=ajp13 worker.worker1.redirect=worker2 # Define another worker using ajp13 worker.worker2.port= ESD1_AJP_PORT_NUMBER(9009) worker.worker2.host= ESD2_IP_ADDRESS worker.worker2.type=ajp13 # Disable worker2 for all requests except failover, hot stand by worker.worker2.activation=disabled # Define the LB worker worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=worker1,worker2
-
Configure the Apache Web server and use the Apache URL as the ESD SOAP URL. Apache will act as a load balancer for both ESD nodes. Modify the
apache conf/httpd.conf
file and register the entry for the ESD URL as follows:# Load mod_jk module LoadModule jk_module modules/mod_jk.so JkWorkersFile <point to workers.properties which suppose to be same location as httpd.conf># Where to put jk logs JkLogFile <modjk log file path> # Set the jk log level [debug/error/info] JkLogLevel error # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Send esd soap request to worker named worker1 JkMount /esd/soaprpc loadbalancer JkMount /esd/* loadbalancer
-
Start the ESD and the Apache Web server in the following sequence:
-
ESD1 Node
-
ESD2 Node
-
Apache (load balancer)
-
-
Use the Apache URL as the ESD SOAP URL in the Marketing delivery profile:
http://apache_ip:apache_port/esd/soaprpc