Configuring Tomcat Clustering Solution for Virtual-Hosts
Hai, Iam having two Web Servers configured to run Tomcat8.5. My project manager had assigned me to configure these Tomcat Web Servers in cluster mode so that the sessions will be managed by the Tomcat Cluster. The same had been done using tomcat references/documentation. I have also configured a Hardware LB so that the VIP may balance the request accessing the URL "http:///test". But now he had asked to tweak the existing configuration so as to host multiple application under domain-name basis. Upon verifying the tomcat documentation, I understood that Host Manager feature of tomcat can be used for such virtual hosting. I had tried configuring Tomcat Cluster for Virtual-Hosts, but needs to confirm whether my approach is correct. Please find my queries and server.xml files listed below. 1. Do I need to configure Multiple Cluster class for each Virtual-Host or a Single Cluster class is enough to manage all Virtual-Hosts. 2. While using the Hardware LB with "X-Forwarded-for" enabled, how can I get the Client IPs listed in the log file using RemoteIpValve. Should it also be configured Globally or per Virtual-Host basis. My server.xml file for both the nodes are mentioned below for reference. server.xml for node1 ### www.newapps.com ### server.xml for node2 ### www.newapps.com ### Thanks! Vinu VS - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Queries regarding tuning Apache Tomcat to serve high traffic
Hai Team, I have been requested by Project Manager to host a web application in Tomcat 8.5 and tune the server to cater high traffic. So, I have hosted the web application on an allotted VPS server with specification (8 vCPU, 16GB RAM and 200 HD), with Tomcat 8.5.42 installed. The web application has been successfully hosted also. Now, with respect to tuning part, I have to clear some points before making it on-line 1. How can I tune this server to cater high traffic. 2. What all are the parameters that I need to considered while tuning 3. Any open-source tools to generate high traffic and test the currently configured server 4. Any references / biogs that I can refer regarding this topic 5. Any suggestions from your end. Note: A brief about the the web application. Its a small recruitment portal web application that lets 1. Clients to register their details 2. Allot a time-frame to have an on-line exam 3. Performs on-line exams for the selected candidates (another schedule) 4. Publish their results 5. Expected traffic rate 1000 hits/sec approx. -- Thank You Best regards Vinu Vibhu Sobhana Disclaimer: This e-mail and any files transmitted with it are intended for the named addresses only and may contain privileged and confidential information. If you have received this e-mail in error, please notify the sender by e-mail reply immediately and delete it from your system. You may not copy this message and its attachments or disclose its contents to any other person, use it for any purpose or store it by any means. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. Although this e-mail and its attachments are believed to be free from virus, it is the responsibility of the recipient to ensure that they are virus free. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Queries related to Tomcat Web Servers for which a new web-application needs to deployed on Production Environment
Hai Mark, For your valid comment please for one more point mentioned in the trail mail.. On Tue, Jan 29, 2019 at 4:11 PM Vinu Vibhu Sobhana wrote: > > Hai Mark > > One more small clarity required on the previous reply with respective > to the below point. > > You can use the FarmWarDeployer if you wish but you don't have to. > Generally, the right answer here will be driven by how your organisation > manages files on servers. > > >>>> Ok..If Iam having a load-balancer serving 2 tomcat instances configured > >>>> with autoDeploy="true" and unpackWARs="false" in their server.xml > >>>> respectively, running on two separate VMs. Also, Iam having a common > >>>> share such as NFS folder mounted on both servers. This share folder > >>>> contains a single folder named prod_webapps which contains all the > >>>> required application war files that needs to be deployed on both tomcat > >>>> servers. > > Can I have this prod_webapps folder soft-linked to both > tomcat1/webapps folder and tomact2/webapps folder, so that we can have > a centralized webapps deployment folder. Is this possible? Will this > scenario feasible for Production deployment? > > Thank You > Vinu VS > > On Tue, Jan 29, 2019 at 3:43 PM Mark Thomas wrote: > > > > On 29/01/2019 06:56, Vinu Vibhu Sobhana wrote: > > > Hai Mark, > > > > > > Please find my comments on the reply sent earlier as some points are > > > still remain unclear. > > > > > >> I have been assigned a new project that requires a web application to > > >> be hosted using Tomcat-Cluster, as it is expected to receive high > > >> traffic. > > > High traffic may be a justification for load-balancing. It is not a > > > justification for session replication. > > > > > >>>> Since we would be receiving high traffic it was decided to go with > > >>>> multiple instances of tomcat using a load-balancer. > > > > > > Why 2 instances per VM rather than one larger instance per VM? > > >>>> So for this point it is understood that it is best that we put only > > >>>> one instance per VM (with large hardware resource). Iam I correct. > > >>>> Will the same scenario be applicable while using physical machine. ie > > >>>> one Tomcat instance per machine. What about the resource limitation > > >>>> (ie. any memory allocation pool for a JVM, etc.) required that must be > > >>>> noted. > > > > The right configuration will depend on the app. Generally, for a well > > written app one JVM per VM will be the best choice but only testing will > > tell for sure. > > > > >> Point 1 > > > Don't use any clustering at all. > > > > > >>>> This point was not clear at all. Are you suggesting that we configure > > >>>> Tomcat instances without cluster and configure the load balancer with > > >>>> session management and stickiness features to manage sessions?? > > > > Yes. Don;t use clustering unless you really need it. > > > > >> Point 2 > > > N/A since clustering is not required. > > > > > >>>> If clustering is required for other scenarios, then please comment on > > >>>> this point how should we deploy applications using Tomcat Manager App > > >>>> on FarmWarDeployer folder > > > > You can use the FarmWarDeployer if you wish but you don't have to. > > Generally, the right answer here will be driven by how your organisation > > manages files on servers. > > > > >> Point 3 > > > No. > > >>>> This means that there is mo method to collect the errors for > > >>>> individual domain when VirtualHost element is enabled. If there is any > > >>>> work-around please suggest. Also will the catalina.out log contains > > >>>> errors for these VirtualHost element? > > > > There is no workaround. > > > > A well written application should not be writing anything to catalina.out > > > > >> Point 8 > > > Configure the load-balancer to use sticky sessions. You'll need to do > > > that anyway if clustering is removed. > > > > > >>>> With respect to my project specification mentioned in point 8, you > > >>>> have suggested to go with a load-balancer serving 2 tomcat instances, > > >>>> each running on
Re: Queries related to Tomcat Web Servers for which a new web-application needs to deployed on Production Environment
Hai Mark One more small clarity required on the previous reply with respective to the below point. You can use the FarmWarDeployer if you wish but you don't have to. Generally, the right answer here will be driven by how your organisation manages files on servers. >>>> Ok..If Iam having a load-balancer serving 2 tomcat instances configured >>>> with autoDeploy="true" and unpackWARs="false" in their server.xml >>>> respectively, running on two separate VMs. Also, Iam having a common share >>>> such as NFS folder mounted on both servers. This share folder contains a >>>> single folder named prod_webapps which contains all the required >>>> application war files that needs to be deployed on both tomcat servers. Can I have this prod_webapps folder soft-linked to both tomcat1/webapps folder and tomact2/webapps folder, so that we can have a centralized webapps deployment folder. Is this possible? Will this scenario feasible for Production deployment? Thank You Vinu VS On Tue, Jan 29, 2019 at 3:43 PM Mark Thomas wrote: > > On 29/01/2019 06:56, Vinu Vibhu Sobhana wrote: > > Hai Mark, > > > > Please find my comments on the reply sent earlier as some points are > > still remain unclear. > > > >> I have been assigned a new project that requires a web application to > >> be hosted using Tomcat-Cluster, as it is expected to receive high > >> traffic. > > High traffic may be a justification for load-balancing. It is not a > > justification for session replication. > > > >>>> Since we would be receiving high traffic it was decided to go with > >>>> multiple instances of tomcat using a load-balancer. > > > > Why 2 instances per VM rather than one larger instance per VM? > >>>> So for this point it is understood that it is best that we put only one > >>>> instance per VM (with large hardware resource). Iam I correct. Will the > >>>> same scenario be applicable while using physical machine. ie one Tomcat > >>>> instance per machine. What about the resource limitation (ie. any memory > >>>> allocation pool for a JVM, etc.) required that must be noted. > > The right configuration will depend on the app. Generally, for a well > written app one JVM per VM will be the best choice but only testing will > tell for sure. > > >> Point 1 > > Don't use any clustering at all. > > > >>>> This point was not clear at all. Are you suggesting that we configure > >>>> Tomcat instances without cluster and configure the load balancer with > >>>> session management and stickiness features to manage sessions?? > > Yes. Don;t use clustering unless you really need it. > > >> Point 2 > > N/A since clustering is not required. > > > >>>> If clustering is required for other scenarios, then please comment on > >>>> this point how should we deploy applications using Tomcat Manager App on > >>>> FarmWarDeployer folder > > You can use the FarmWarDeployer if you wish but you don't have to. > Generally, the right answer here will be driven by how your organisation > manages files on servers. > > >> Point 3 > > No. > >>>> This means that there is mo method to collect the errors for individual > >>>> domain when VirtualHost element is enabled. If there is any work-around > >>>> please suggest. Also will the catalina.out log contains errors for these > >>>> VirtualHost element? > > There is no workaround. > > A well written application should not be writing anything to catalina.out > > >> Point 8 > > Configure the load-balancer to use sticky sessions. You'll need to do > > that anyway if clustering is removed. > > > >>>> With respect to my project specification mentioned in point 8, you have > >>>> suggested to go with a load-balancer serving 2 tomcat instances, each > >>>> running on two separate VMs with enough resources. Moreover, these > >>>> tomcat instances are NOT to be in Clustered State and the session must > >>>> be managed by an external Load-balancer using Stick bit mode enable. Is > >>>> it correct?. > > Yes. > > > Is Tomcat CPU intrinsic or Memory? > > I don't understand the question. > > Mark > > > -- > > Thank You > > Vinu VS > > > > > > On Mon, Jan 28, 2019 at 3:00 PM Mark Thomas wrote: > >> > >> On 28/01/2019 07:25, Vinu Vibhu Sobhana wrote: > >>> Hai > &g
Re: Queries related to Tomcat Web Servers for which a new web-application needs to deployed on Production Environment
Hai Mark, Please find my comments on the reply sent earlier as some points are still remain unclear. > I have been assigned a new project that requires a web application to > be hosted using Tomcat-Cluster, as it is expected to receive high > traffic. High traffic may be a justification for load-balancing. It is not a justification for session replication. >>> Since we would be receiving high traffic it was decided to go with multiple >>> instances of tomcat using a load-balancer. Why 2 instances per VM rather than one larger instance per VM? >>> So for this point it is understood that it is best that we put only one >>> instance per VM (with large hardware resource). Iam I correct. Will the >>> same scenario be applicable while using physical machine. ie one Tomcat >>> instance per machine. What about the resource limitation (ie. any memory >>> allocation pool for a JVM, etc.) required that must be noted. > Point 1 Don't use any clustering at all. >>> This point was not clear at all. Are you suggesting that we configure >>> Tomcat instances without cluster and configure the load balancer with >>> session management and stickiness features to manage sessions?? > Point 2 N/A since clustering is not required. >>> If clustering is required for other scenarios, then please comment on this >>> point how should we deploy applications using Tomcat Manager App on >>> FarmWarDeployer folder > Point 3 No. >>> This means that there is mo method to collect the errors for individual >>> domain when VirtualHost element is enabled. If there is any work-around >>> please suggest. Also will the catalina.out log contains errors for these >>> VirtualHost element? > Point 8 Configure the load-balancer to use sticky sessions. You'll need to do that anyway if clustering is removed. >>> With respect to my project specification mentioned in point 8, you have >>> suggested to go with a load-balancer serving 2 tomcat instances, each >>> running on two separate VMs with enough resources. Moreover, these tomcat >>> instances are NOT to be in Clustered State and the session must be managed >>> by an external Load-balancer using Stick bit mode enable. Is it correct?. >>> Is Tomcat CPU intrinsic or Memory? -- Thank You Vinu VS On Mon, Jan 28, 2019 at 3:00 PM Mark Thomas wrote: > > On 28/01/2019 07:25, Vinu Vibhu Sobhana wrote: > > Hai > > > > First of all Iam new to Tomcat-Cluster and hence I apologize if my > > doubts are wrong. > > > > I have been assigned a new project that requires a web application to > > be hosted using Tomcat-Cluster, as it is expected to receive high > > traffic. > > High traffic may be a justification for load-balancing. It is not a > justification for session replication. > > > So, I have configured a Tomcat-Cluster with 4 Tomcat > > instances (ie 2 - Tomcat instances running on 2 VMs each), where they > > shall receive hits its through a load-balancer. As I new to > > Tomcat-Cluster, I have to clear some points before approving the > > project to go on-line. > > Why 2 instances per VM rather than one larger instance per VM? > > > > > My queries are : > > > > 1. The Clustering of Tomcat currently configured is using the Delta > > Manger for managing session replications. Is it the correct choice or > > should I go for Backup Manger or any third party session management > > software such as memcache or redis. > > Don't use any clustering at all. > > > 2. While using Tomcat-Cluster, can we use/configure the Tomcat Manager > > App to deploy applications on FarmWarDeployer folder or is there any > > other method to do so. > > N/A since clustering is not required. > > > 3. Virtual Host entry has been implemented for our project domain > > "webportal.xyz.in" where only the access logs are getting logged to > > "webportal.xyz.in_access_log". Is there any means by which I can > > receive the error-logs also for this domain on a separate file. > > No. > > > 4. Is there any method to tune/tweak my current server.xml file so > > that clustering method can be done globally rather than applying > > individually on every Host entry with different ports. > > No. Each instance needs to be configured individually. You can use > templating. With careful configuration you can have a commons server.xml > with ${...} property replacement for all the instance specific settings > that are then configured in catalina.properties > > > 5. How to enable SSL for Tomcat-Cluster. Should I need to install SSL &
Queries related to Tomcat Web Servers for which a new web-application needs to deployed on Production Environment
Hai First of all Iam new to Tomcat-Cluster and hence I apologize if my doubts are wrong. I have been assigned a new project that requires a web application to be hosted using Tomcat-Cluster, as it is expected to receive high traffic. So, I have configured a Tomcat-Cluster with 4 Tomcat instances (ie 2 - Tomcat instances running on 2 VMs each), where they shall receive hits its through a load-balancer. As I new to Tomcat-Cluster, I have to clear some points before approving the project to go on-line. My queries are : 1. The Clustering of Tomcat currently configured is using the Delta Manger for managing session replications. Is it the correct choice or should I go for Backup Manger or any third party session management software such as memcache or redis. 2. While using Tomcat-Cluster, can we use/configure the Tomcat Manager App to deploy applications on FarmWarDeployer folder or is there any other method to do so. 3. Virtual Host entry has been implemented for our project domain "webportal.xyz.in" where only the access logs are getting logged to "webportal.xyz.in_access_log". Is there any means by which I can receive the error-logs also for this domain on a separate file. 4. Is there any method to tune/tweak my current server.xml file so that clustering method can be done globally rather than applying individually on every Host entry with different ports. 5. How to enable SSL for Tomcat-Cluster. Should I need to install SSL Certificates on all 4 tomcat instances or only on the Load-balancer. 6. What all parameters needs to be checked/considered for tuning the Tomcat / Tomcat-Cluster instance while hosting any Project on Production environment. 7. Is there any service reload option present for tomcat, ie. similar to the one present in apache where the sessions doesn't get invalidated while tuning/updating the server config files. 8. One of the issue noted was that one of the security feature implemented for this projects stopped working while moving to Tomcat-Cluster environment. Our application uses java spring mvc "4.3.5.RELEASE, 4.2.0.RELEASE" where it is configured to allow only one time login for all users until their current login session expires or have been invalidated. ie. if multiple logins are done, only the last login will be active all the rest gets automatically logged-out. it was implemented for some customer security reasons. This was working fine while running on a single Tomcat instance. But while deploying on a Clustered instance it is not working unless if the same user logs into the same tomcat instance of the cluster. Is there any solution to this problem or should the developers needs to reconfigure the application to meets Tomcat-Clusters concepts. Please find the server.xml and context.xml for one of my Tomcat instances present in Cluster mentioned below. server.xml # www.webportal.xyz.in # context.xml # WEB-INF/web.xml ${catalina.base}/conf/web.xml # -- Thank You Best regards Vinu Vibhu Sobhana - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Deployment issues with multiple instance of Tomcat sharing web-apps directory
Hai, Iam new to mailing list and I apologize in advance if this is not the correct place.. Iam a system administrator and my development team creates application in JAVA that are been hosted on tomcat web-servers. While hosting the application, I was asked to explore the feasibility on the below points 1. Can I have centralized web-apps directory for multiple tomcat instances hosted on the same or different servers. ie tomcat1 running on server1 and tomcat2 running on server2. Both servers are been assigned a common storage folder (via NFS) named "webstore" which has been mapped to both servers webapps directories. Now my query is upon starting tomcat instances on both servers, I should receive a working instance of my application on both servers. Is this possible in any way or is there any other recommended method that I should follow. Providing individual webapps folder to all tomcat instances would be a waste of storage space for our project as our application warsize is large. I have searched the internet and found nothing clarifying my point. Hence I though to post here and collect your vaild comments. 2. Deploying a patched/updated web application to the current live production tomcat server should require least deployment time. For us, it takes too long to update the web application war file on most of our servers. Hence we have to shutdown the server, update the new war file and then starts up tomcat. Is there any best practices that I should follow so that I can reduce the deployment time to minimum. -- Thank You Best regards Vinu Vibhu Sobhana - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org