top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Share info across different sessions & servers, using Apache

0 votes
474 views

I need to share data between sessions running in different Tomcat server.
I 'd been thinking about using a JMS broker (as ActiveMQ ):

  • when a new session is created in Tomcat A, it's created a new unique topic for this session
  • the session registers itself as listener of that topic ( the only one listener )
  • publish the name of this topic by some way , so it can be found by another session in Tomcat B

I don't know if somebody has used something like this sometime, and how he/she did it
Any suggestion/opinion ?

I'm not sure either use only one topic for all session created or one topic per session ?
I think that one topic per session is more safe because if I use one topic for all sessions, if one message is not read quickly by one consumer (a session ), could block the topic, Obviously , i'll define a TTL for messages/topic

posted Jul 2, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

What kind of data do you want to share? Just a view "bytes"? Is there an requirement concerning durability/persistence/performance?
Is this user=session related or do you want to share data in general? Usually if you have a session id the lb will route your user always to the same container? What about session replication, a database, terracotta?

JMS: i doubt this will be working... you need a persistent message or a container started after the change was send will not noticed about it...

answer Jul 2, 2013 by anonymous
I need to share formatted text data ( XML, key/value, ...I'm not sure yet )

I don't understand your comment about JMS . I will use a JMS broker as ActiveMQ . Probably it will be embebbed into the same JVM than Tomcat server. ActiveMQ supports persistent messages.

I could use a database but I don't want to be making polling every X seconds by a session
You don't have to pull any data that the user doesn't need, do you?

If you don't want to use a RDBMS, how about something like memcached? I asked about using memcached a while back on this list and got some other suggestions as well (as memcached doesn't make a great fail-safe shared-data storage system... it's really meant to be more of a cache of data available elsewhere).
Similar Questions
0 votes

We are currently using HTTP connector in tomcat 7.42 and planning to switch to AJP NIO connector. When I was reading through the docs I found "WARNING: The NIO connector for AJP is experimental."

This made me think that NIO connector might not be mature at this point. Can somebody who had experience with NIO connector let me know if it is stable and any pitfalls I should be aware of?

Stable enough to be used on enterprise apps which is expected to get thousands of requests in a hour?

Any information would be helpful.

0 votes

I am trying to find out through registry checking whether or not Apache Tomcat 9.0.8 is already installed or not. If the below registry is not there, then my program installs Apache Tomcat 9.0.8 installer otherwise it moves on to other installation and completes. It's kind of prerequisite check program.

HKEY_LOCAL_MACHINESOFTWAREApache Software FoundationTomcat9.0Tomcat9

However, everytime program just proceeds to install Tomcat despite it is already installed? Am I checking wrong registry?

+2 votes

I have a domain domain.com that points to a server. Now I have a subdomain sub.domain.com that points to another server that has Apache running and Tomcat. I want this subdomain to point to a application deployed on the Tomcat instance through ajp.

I have configured the following in httpd.conf:

   ServerName sub.domain.com 
   ProxyRequests Off
   ProxyPreserveHost On  
   Order deny,allow Allow from all  
   ProxyPass / ajp://localhost:8009/ 
   ProxyPassReverse / ajp://localhost:8009/   

and in Tomcats server.xml:

But when I go to sub.domain.com the url changes to otherdomain.com and shows me a php website running in Apache and declared as following in httpd.conf:

 DocumentRoot /var/www/html/otherdomain.com 
 ServerName otherdomain.com 
 ServerAlias www.otherdomain.com 

I only get it to work when I change the port in the sub.domain.com virtual host declaration to for example 8001. Then when I go to sub.domain.com:8001 it shows my tomcat application (ROOT.war) as expected.

So my question is: what could be going wrong that it doesn't work with the default port 80? I can't find any configuration that is causing this, but I'm probably missing something or is my virtual host configuration wrong?

+3 votes

We are using Apache Tomcat6 as application server for the website. Two virtual servers are configured for this and each one of the servers had 2 CPUs and 4 GB RAM until 26 JAN 2015 when both Tomcat servers crashed. So we added some resources to the virtual servers (Now it is 8CPUs and 8GB RAM each box) and increased maxThread parameter of tomcat from default (which is 200) to 300 and restarted Tomcat servers. OS of the systems are Linux6.5 .

We need to know what the relationship between thread and memory is. If N numbers of requests coming to the server how many threads can process that and how much memory is required for that. Actually we are targeting to increase the maxThread count upto 500 but we need to calculate that, to process this much of threads what will be the best Hardware configuration?

Please let us know if any more information is required for the same.

+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

...