1 2 Previous Next 24 Replies Latest reply: Feb 26, 2010 2:58 AM by Jean-Frederic Clere RSS

Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)

Naveen Jakkamsetti Newbie

Hi,

 

I did not know where to post this problem I have with mod_cluster.

 

Basically I followed the Quick Start Guide at guide at: http://www.jboss.org/mod_cluster/quick-start.html and was able to set mod_cluster with default configurations.

 

http://<ip>:8081/manager shows me the following:

 

mod_cluster1.JPG

But how to divert traffic from httpd to JBoss AS 5.1.0 GA. What is that I am missing?

 

httpd.conf

<VirtualHost 192.168.100.92:8081>
  <Directory />
     Order deny,allow
     Deny from all
     Allow from 192.168.100.
  </Directory>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName mycluster
AdvertiseFrequency 5

ProxyPass / balancer://mycluster/
</VirtualHost>

<Location /manager>
  SetHandler mod_cluster-manager
  Order deny,allow
</Location>

When I try to access http://<ip>:8081/, it give the following "503" error message.

 

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

 

Apache error Log:

 

[Sun Jan 31 16:36:01 2010] [notice] Server built: Jan 14 2010 07:08:16
[Sun Jan 31 16:36:01 2010] [notice] Parent: Created child process 4108
[Sun Jan 31 16:36:01 2010] [notice] Child 4108: Child process is running
[Sun Jan 31 16:36:01 2010] [notice] Child 4108: Acquired the start mutex.
[Sun Jan 31 16:36:01 2010] [notice] Child 4108: Starting 64 worker threads.
[Sun Jan 31 16:36:01 2010] [notice] Child 4108: Starting thread to listen on port 8081.
[Sun Jan 31 16:38:09 2010] [error] ajp_cping_cpong: apr_socket_recv failed
[Sun Jan 31 16:38:53 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state
[Sun Jan 31 16:38:57 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state
[Sun Jan 31 16:39:10 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state
[Sun Jan 31 16:39:11 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state

 

Basically what is the equivalent of "JkMount" from mod_jk in mod_cluster. What is my mistake?

 

Any help in this regards will be appreciated. Thanks.

 

With Regards,

Naveen...

  • 1. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Radoslav Husar Master

    Hi Naveen,

    can you please update mod_cluster to 1.0.3 GA and try again? This should have been fixed by this revision, see the Jira https://jira.jboss.org/jira/browse/JBPAPP-3337

     

    Cheers

  • 2. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie

    Hi Radoslav,

     

    Thanks for your reply.

     

    I have tried version mod_cluster 1.0.3 GA, but still no luck. I believe I have done everything as described in the quick start quide.

     

    Ok, let me ask you this: Will http://<ip>/ (Apache) redirect to http://<ip>:8080/ (JBoss) directly or is there some configuration we need to set?

  • 3. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Jean-Frederic Clere Master

    Accoding to http://community.jboss.org/servlet/JiveServlet/showImage/2-523153-1942/mod_cluster1.JPG

    you have no application information. may be no application deployed or they are all in the excludedContexts property in  mod-cluster-jboss-beans.xml.

     

    You can also use the ProxyPass and ProxyPassMatch httpd directives if you want static mount.

  • 4. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Ned Hanks Newbie

    I had similar problem but then noticed that ROOT was in the excludedContexts list.  I removed ROOT and was able to send reqeusts to Jboss.

     

    FYI: My jboss has my applicaiton at ROOT (/) not ROOT.war.

  • 5. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie
    Jean and Ned,

     

    Thanks so much!!!, You were right. Your inputs helped me.

     

    After speding some time I finally figured it out. I added <depends>ModClusterService</depends> in jboss-beans.xml and tried to change the properties in HAModClusterConfig bean in mod-cluster-jboss-beans.xml and thats why it was not working.

     

    So, I changed it to <depends>HAModClusterService</depends> and it worked. I now get the application when I run http://<ip>/mod_Cluster-manager and I am able to re-direct to JBoss.

     

    I have 2 other questions:

     

    1. I did notice, when I make the change, I need to wait ~20 sec for the application actually show up, till that time I get a "Server Temporarily Unavailable". Is this supposed to be like that?

     

    2. Even if I exclude certain contexts in the excludedContexts property in mod-cluster-jboss-beans.xml, it still shows up.

     

    Eg:

    <property name="excludedContexts">${jboss.modcluster.excludedContexts:invoker,jbossws,jmx-console,juddi,web-console}</property>

    this should not display the ROOT and admin-console, but when I check http://<ip>/, it redirects to the JBoss home page. Similarly with /admin-console.

     

    I tried this on a Windows box.

     

    On Linux I have some other issue. When I try http://<ip>/mod_cluster-manager, it shows the nodes and application perfectly, but http://<ip>/ gives me a 403 Forbidden. You don't have permission to access / on this server instead of redirecting to JBoss. Any idea why?

  • 6. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Jean-Frederic Clere Master

    "1. I did notice, when I make the change, I need to wait ~20 sec..."

    That is normal httpd has to wait for the STATUS message from the node to be able to use it.

     

    "2. Even if I exclude certain contexts in the excludedContexts ..."

    That is normal once ROOT is not in the excludedContext all requests are forwarded to AS (having ROOT is mounting /).

     

    "3. /mod_cluster-manager and 403

    Please check your virtualHost configuration.

  • 7. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie

    Thanks Jean,

     

    Reg 3. , I fixed it, but I came across another problem.

     

    When I restart Apache with mod_cluster related modules enabled, I get the following error and my apache log /var/log/apache2/error.log reads like this.

     

     

    [Tue Feb 16 23:07:34 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:25:24 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:30:32 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:45:58 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:46:31 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:46:59 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:47:02 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed
    [Wed Feb 17 01:47:05 2010] [emerg] create_mem_node /etc/apache2/logs/manager.node failed
    Configuration Failed

     

     

    OS: Ubuntu Linux Server 9.10 i686

    Apache: 2.2.12

    mod_cluster: mod_cluster 1.0.3 GA - mod_cluster httpd dynamic libraries - linux2 x86

     

    I searched and came across a similar JIRA - https://jira.jboss.org/jira/browse/MODCLUSTER-120

     

    My question is: Does it affect mod cluster 1.0.3 GA, if yes, then do i install mod_cluster 1.1.0 Beta1, if No, then what could be the issue???

     

    Note: I noticed that I do not have a problem in the following environment

    OS: Ubuntu Server 8.10 Server x64

    Apache: 2.2.9

    mod_cluster: mod_cluster_1.0.3 GA - mod_cluster httpd dynamic libraries - linux2 x64

     

    Thanks.

  • 8. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Radoslav Husar Master

    Yes, it does affect 1.0.3 GA as well. The fix version is 1.1 CR1, so beta 1 wont have that fix. To workaround, in case of "[emerg] create_mem_node <node file path> failed" error please use "ipcrm -m" command and wait a few seconds before restarting httpd.

  • 9. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Jean-Frederic Clere Master

    Note you have to remove the unused shared memory via ipcrm -m key.

    +++

    [hudson@perf08 ~]$ ipcs | more

     

    ------ Shared Memory Segments --------
    key        shmid      owner      perms      bytes      nattch     status     
    0x0101c7d5 82182144   hudson    600        10500      0                      
    0x0101c7d7 82214913   hudson    600        7620       0                     

    +++

    nattch 0 : they are unused. They could be removed.

     

    ipcrm -m 82182144 (for example).

  • 10. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie

    Hi Radoslav and Jean,

     

    I ran ipcs on my box.

     

    naveen@db:/opt$ sudo ipcs

    ------ Shared Memory Segments --------
    key        shmid      owner      perms      bytes      nattch     status     
    0x00000000 393216     naveen     600        393216     2          dest        
    0x00000000 425985     naveen     600        393216     2          dest        
    0x00000000 229378     naveen     600        393216     2          dest        
    0x00000000 262147     naveen     600        393216     2          dest        
    0x00000000 294916     naveen     600        393216     2          dest        
    0x00000000 327685     naveen     600        393216     2          dest        
    0x00000000 360454     naveen     600        393216     2          dest        
    0x00000000 458759     naveen     600        393216     2          dest        
    0x00000000 491528     naveen     600        393216     2          dest        
    0x00000000 4128777    naveen     600        393216     2          dest        
    0x00000000 5144586    naveen     600        3981312    2          dest        
    0x00000000 589835     naveen     600        393216     2          dest        
    0x00000000 622604     naveen     600        393216     2          dest        
    0x00000000 655373     naveen     600        393216     2          dest        
    0x00000000 688142     naveen     600        393216     2          dest        
    0x00000000 1769487   naveen     600        393216     2          dest        
    0x00000000 5013520   root         600        393216     2          dest        
    0x00000000 5046289   root         600        393216     2          dest        
    0x00000000 2261010   naveen     600        393216     2          dest        
    0x00000000 2326547   naveen     600        393216     2          dest        
    0x00000000 3768341   naveen     600        393216     2          dest        
    0x00000000 2097174   naveen     600        393216     2          dest        
    0x00000000 2129943   naveen     600        393216     2          dest        
    0x00000000 2883608   naveen     600        393216     2          dest        
    0x00000000 2916377   naveen     600        393216     2          dest        

    ------ Semaphore Arrays --------
    key        semid      owner      perms      nsems    

    ------ Message Queues --------
    key        msqid      owner      perms      used-bytes   messages

     

    So, I dont see any nattch: 0.

     

    I restarted Apache, but the apache error log still has the same error.

     

    Any ideas what do to next.

     

    Thanks.

  • 11. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Jean-Frederic Clere Master

    Check which process are using the shared memory, is it httpd? Do you still have running httpd process?

    my guess is that your still have httpd process and the shared memory is still attached to them. You have probably to kill the process and clean the shared memory.

  • 12. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie

    Jean,

     

    There are no httpd processes running.

     

    Anyway, I went back to the box where it was running, i.e. Ubuntu Server x64. It seems to run

     

    With respect to your suggestion to check the Virtual Host configuration. I checked it without mod_cluster and it works perfectly fine.


    Virtual host config:

     

    <VirtualHost 192.168.100.150:80>
    # DocumentRoot /var/www/
        <Directory />
             Order deny,allow
             Deny from all
             Allow from 192.168.100.150
        </Directory>
        ErrorLog /var/log/apache2/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
        KeepAliveTimeout 60
        MaxKeepAliveRequests 0
        ManagerBalancerName mycluster
        AdvertiseFrequency 5
    </VirtualHost>

     

    Apache Log gives this error:

     

    [Fri Feb 19 02:05:18 2010] [notice] Advertise initialized for process 4815
    [Fri Feb 19 02:05:18 2010] [notice] Apache/2.2.9 (Ubuntu) configured -- resuming normal operations
    [Fri Feb 19 02:05:24 2010] [error] [client 192.168.100.150] File does not exist: /htdocs
    [Fri Feb 19 02:09:02 2010] [error] ajp_cping_cpong: apr_socket_recv failed
    [Fri Feb 19 02:10:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:15:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:20:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:25:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:30:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:35:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/
    [Fri Feb 19 02:40:24 2010] [error] [client 192.168.100.150] client denied by server configuration: proxy:balancer://mycluster/

     

    Apache gives this error when i run http://<ip>/

    Forbidden

    You don't have permission to access / on this server.

     

    There are no errors in JBoss.

     

    Any idea why this is occuring...

    Since this was working in Windows, I just copied jboss-beans.xml, mod-cluster-jboss-beans.xml, server.xml into Ubuntu, but this error still comes.

     

    Note: http://<ip>/mod_cluster-manager displays the nodes as given below.

     

    JBossNodes.png

     

    Any help will be greatly appreciated. Thanks.

  • 13. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Jean-Frederic Clere Master
    Again it must be a VirtualHost problem, may be the default host is used.
  • 14. Re: Redirect traffic to JBoss AS (Equivalent of JkMount of mod_jk)
    Naveen Jakkamsetti Newbie

    Jean,

     

    I did not use  default host, I created another host and tried, no luck... JBoss give me this error, no errors in apache. Any idea

     

    2010-02-20 02:35:34,985 INFO  [org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) IO error sending command INFO to proxy 192.168.100.150:8082
    java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:209)
        at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:202)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnection(DefaultMCMPHandler.java:1139)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnectionWriter(DefaultMCMPHandler.java:1164)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:774)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:884)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:465)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:446)
        at org.jboss.modcluster.ha.HAModClusterService$ClusteredCatalinaEventHandler.updateClusterStatus(HAModClusterService.java:910)
        at org.jboss.modcluster.ha.HAModClusterService$ClusteredCatalinaEventHandler.status(HAModClusterService.java:890)
        at org.jboss.modcluster.ha.HAModClusterService$ClusteredCatalinaEventHandler.status(HAModClusterService.java:835)
        at org.jboss.modcluster.CatalinaEventHandlerAdapter.lifecycleEvent(CatalinaEventHandlerAdapter.java:163)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1348)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1612)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1601)
        at java.lang.Thread.run(Thread.java:619)
1 2 Previous Next