0

我无法访问 mod_cluster-manager,并且我在 apache 中的 error.log 中收到以下错误

[Wed Jan 16 17:20:13 2013] [warn] module proxy_module is already loaded, skipping 
[Wed Jan 16 17:20:13 2013] [notice] Advertise initialized for process 2410 
[Wed Jan 16 17:20:13 2013] [notice] Apache/2.2.17 (Ubuntu) mod_cluster/1.2.0.Final PHP/5.3.5-1ubuntu7.8 with Suhosin-Patch configured -- resuming normal operations 
[Wed Jan 16 17:27:22 2013] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state 
[Wed Jan 16 17:27:23 2013] [warn] proxy: No protocol handler was valid for the URL /favicon.ico. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

我配置了 jboss Standalone 模式来启用 mod_cluster。我在standalone-ha.xml 的各自部分中添加了以下几行

<extension module="org.jboss.as.modcluster"/>

<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
            <mod-cluster-config advertise-socket="modcluster" advertise-security-key="secret"/>
        </subsystem>

我下载了以下模块: mod_slotmem.so mod_manager.so mod_proxy_cluster.so mod_advertise.so

http://downloads.jboss.org/mod_cluster//1.1.0.Final/mod_cluster-1.1.0.Final-linux2-x64-so.tar.gz然后把它放在 usr/lib/apache2/modules 中。

我在 /etc/apache2/mods-available 的 mod_cluster.load 中设置了以下内容。

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so
LoadModule slotmem_module /usr/lib/apache2/modules/mod_slotmem.so
LoadModule manager_module /usr/lib/apache2/modules/mod_manager.so
LoadModule proxy_cluster_module /usr/lib/apache2/modules/mod_proxy_cluster.so
LoadModule advertise_module /usr/lib/apache2/modules/mod_advertise.so

我在 mod_cluster.conf 中设置了以下内容

CreateBalancers 1
<IfModule manager_module>
    Listen 127.0.0.1:8082
    ManagerBalancerName mycluster

     <VirtualHost 127.0.0.1:8082>
        KeepAliveTimeout 300
        MaxKeepAliveRequests 0
        AdvertiseFrequency 5
        ServerAdvertise On
        <Location />
            Order deny,allow
            Allow from 127.0.0.1
        </Location>
     </VirtualHost>
  </IfModule>

我通过执行 $ sudo a2enmod mod_cluster 启用模块

最后,我在 /etc/apache2/sites-available 的 jboss 中设置了以下内容

#NameVirtualHost *:80
<VirtualHost *:80>
    #ServerAdmin info@domain.de
    ServerName  comitdev2
    ServerAlias comitdev2
    ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
    ProxyPassReverse / balancer://mycluster
    ProxyPreserveHost On
      <Location />
        Order deny,allow
        Allow from All
    </Location>

    <Location /mod_cluster-manager>
      SetHandler mod_cluster-manager
      Order deny,allow
      #Deny from all
      Allow from 127.0.0
   </Location>
  </VirtualHost>

最后,我禁用了 000-default 站点并启用了 jboss 站点

每次我访问本地主机时,我都会得到服务暂时不可用。

我正在使用 Ubuntu 11.04

4

1 回答 1

0

嗯,我可以在你的日志中看到 mod_cluster/1.2.0.Final,而你说你使用了 mod_cluster-1.1.0.Final-linux2-x64-so.tar.gz,怎么会?

为什么你使用 CreateBalancers 1 和 ProxyPass 而你没有在 ProxyPass 中做任何特别的事情?设置似乎是正确的。我建议尝试使用 CreateBalancers 1 运行并注释掉 ProxyPass 以缩小错误搜索空间:-)

无论如何,试试这个:

mod_cluster.conf

# MOD_CLUSTER_ADDS
<IfModule manager_module>
  Listen 127.0.0.1:8082 
  ManagerBalancerName mycluster

  <VirtualHost 127.0.0.1:8082>
    <Location />
     Order deny,allow
     Deny from all
     #Just for testing, of course...
     Allow from all
    </Location>

    KeepAliveTimeout 300
    MaxKeepAliveRequests 0
    AdvertiseFrequency 5
    #AdvertiseSecurityKey secret
    #This is important, see docs...
    EnableMCPMReceive

    <Location /mcm>
       SetHandler mod_cluster-manager
       Order deny,allow
       Deny from all
       #Just for testing, of course...
       Allow from all
    </Location>

  </VirtualHost>
</IfModule>

http.conf

# This must be disabled for mod_cluster to work properly!
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

# mod_cluster ifself
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so

as7

<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
    <mod-cluster-config advertise-socket="modcluster" connector="ajp" />
</subsystem>

注意:我有urn:jboss:domain:modcluster:1.1,您也应该使用更新的 AS7。Schema 1.0 已经过时了。

如果这个非常简单的设置对您有用,那么将您的 ProxyPass 添加回来,让我们看看它是否是您遇到麻烦的原因。

高温高压

于 2013-02-14T15:25:08.997 回答