Applicare Standalone Agent cluster configuration
Configuration in Apache
For Windows
Use the below link to Download Apache. After download extract it to a new directory.
https://www.apachelounge.com/download/
For Linux
Use the below link to Download Apache
http://httpd.apache.org/docs/2.4/install.html
Follow the below steps after installing the Apache
1. Create the “workers.properties” file inside the "conf" folder in Apache and add the below configuration.
Syntax:
worker.list=balancer
worker.<workername>.type=ajp13 <This is the apache Jserv Protocol type>
worker.<workername>.host=<agent_ipaddress>
worker.<workername>.port=<agent_ajp_port>
worker.balancer.type=lb
worker.balancer.balance_workers=<workername>
worker.list=jkstatus
worker.jkstatus.type=status
Specify the <workername>, <agent_ipaddress> and <agent_ajp_port> correctly.
Example configuration for two agents
worker.list=balancer
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=9809
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=9810
worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.list=jkstatus
worker.jkstatus.type=status
2. Download the "mod_jk.so".
For Windows
Use the below link to download the files based on the Apache version and place it inside the modules folder.
Apache 2.4.x 32 bit
https://arc-temp.s3.amazonaws.com/mod_jk/httpd-2.4.x_32_bit/mod_jk.so
Apache 2.4.x 64 bit
https://arc-temp.s3.amazonaws.com/mod_jk/httpd-2.4.x_64_bit/mod_jk.so
For Linux:
Use the below link to download the latest tomcat connectors http://tomcat.apache.org/download-connectors.cgi
To install mod_jk
3. Edit the “httpd.conf” file in Apache and add the below configuration at the end of the file.
Configuration
LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkShmFile logs/jk-runtime-status
JkMount /jk-status jkstatus
JkMount /applicare_agent/* balancer
</IfModule>
4. Open command prompt and go to the “bin” directory and execute the "httpd -t" command. If the added configurations are correct it will display "Syntax OK" message.
Command: httpd -t
This warning message will be displayed only if the serverName is not available in the "httpd.conf" file. It is not related with load balancing configuration. So you can ignore that.
If you would like to fix the warning message follow the below steps
- Edit the "httpd.conf" file and search for "ServerName".
- Add the ServerName. In the ServerName field you can either specify the domain name or machine ip or localhost.
5. Start Apache as a service.
Open the command prompt in Administrator mode and go to the Apache bin directory and execute the below commands.
For Windows
Command: httpd.exe -k install
Go to windows services and start the Apache service.
For Linux:
Command: service httpd start
6. Use the below URL to check the worker status.
Syntax:
http://<apacheIp>:<apacheport>/jk-status
Example:
http://localhost:81/jk-status
Configuration in Tomcat
Non Sticky
- It will redirect the request to all the servers randomly in the Round Robin mode.
- No changes needed in the agent server.xml files.
Sticky
- All the requests from the same client are sent to the same server.
- For this add the “jvmRoute” name inside the Engine tag in the "server.xml" file.
Configuration in 1st agent (server.xml)
1. Open the server.xml file in the server folder and Search for “Engine name” inside the server.xml file.
2. Add the “jvmRoute” name inside the Engine tag. So, the above line will be
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
3. Start the Agent.
Configuration in 2nd agent (server.xml)
Note:
- If the agents are running in the same machine then server shutdown, connector Http and connector AJP and redirect ports need to be changed. While changing the ports assign the open ports.
- If the agents are running in different machines no need to change any port.
For Agents running in same machine.
1. Change the ports of server shutdown, connector Http and connector AJP and redirect ports. Assign the open ports.
Example:
<Server port="9806" shutdown="SHUTDOWN">
<Connector port="9881" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8845" />
<Connector port="9810" protocol="AJP/1.3" redirectPort="8845" />
2. Open the server.xml file in the server folder and Search for “Engine name” inside the server.xml file.
3. Add the “jvmRoute” name inside the Engine tag. So, the above line will be
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">
4. Start the Agent.
For Agents running in different machine:
1. Open the server.xml file in the server folder and Search for “Engine name” inside the server.xml file.
2. Add the “jvmRoute” name inside the Engine tag. So, the above line will be
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">
3. Start the Agent.
Configuration in Applicare Console
1. Go to Applicare Advanced Options menu.
2. Enable "Push" option in the Txn data persistence and add the Apache server url in the Txn data persistence url. Now the agent will post the data to the specified url.
Syntax:
http://<apacheIp>:<apacheport>/applicare_agent
Example:
http://localhost:81/applicare_agent
3. These Changes take affect on Restart of Agent.
Please sign in to leave a comment.
Comments
0 comments