httpdをロードバランサとしてフロントワイルドフライに配置しました。私はwildfly 10.1.0を使用しています。wildflyで動作するセッションレプリケーションを取得できません。
私は3台のマシンと1台のマスターと2台のスレーブを持っています。
私が持っているマスターの私のdomain.xml内:私が持っているスレーブ1のための私のhosts.xmlで
<subsystem xmlns="urn:jboss:domain:modcluster:2.0">
<mod-cluster-config proxies="mc-prox1" connector="ajp">
<dynamic-load-provider>
<load-metric type="busyness"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
<socket-binding-groups>
<socket-binding-group name="full-ha-sockets" default-interface="public">
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="iiop" interface="unsecure" port="3528"/>
<socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
<socket-binding name="jgroups-mping" interface="private" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" interface="private" port="7600"/>
<socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/>
<socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
<outbound-socket-binding name="mc-prox1">
<remote-destination host="192.168.2.201" port="8796"/>
</outbound-socket-binding>
</socket-binding-group>
</socket-binding-groups>
<server-groups>
<server-group name="mycluster" profile="full-ha">
<socket-binding-group ref="full-ha-sockets"/>
<deployments>
<deployment name="PATT_EAR.ear" runtime-name="PATT_EAR.ear"/>
</deployments>
</server-group>
</server-groups>
:
私が持っているスレーブ2のための私のhosts.xmlで<servers>
<server name="server-web1" group="mycluster" auto-start="true">
<jvm name="jvm-web1">
<heap size="1024m" max-size="3072m"/>
<permgen size="1024m" max-size="1024m"/>
<jvm-options>
<option value="-server"/>
<option value="-d64"/>
</jvm-options>
</jvm>
</server>
</servers>
:
<server name="server-web2" group="mycluster" auto-start="true">
<jvm name="jvm-web2">
<heap size="1024m" max-size="3072m"/>
<permgen size="1024m" max-size="1024m"/>
<jvm-options>
<option value="-server"/>
<option value="-d64"/>
</jvm-options>
</jvm>
</server>
</servers>
すべてのサーバーは罰金を開始し、ログに私が持っている:
マスターのログスレーブの
2016-08-18 09:38:06,884 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023: Starting server server-web1
2016-08-18 09:38:06,891 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:06,987 WARN [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:09,538 INFO [org.jboss.as.host.controller] (management task-4) WFLYHC0021: Server [Server:server-web1] connected using connection [Channel ID 622b12f8 (inbound) of Remoting connection 124392b0 to /192.168.2.201:42232 of endpoint "master:MANAGEMENT" <67c473e1>]
2016-08-18 09:38:09,633 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023: Starting server server-web2
2016-08-18 09:38:09,634 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:09,685 INFO [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-web1
2016-08-18 09:38:09,753 WARN [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:16,741 INFO [org.jboss.as.domain.controller] (Host Controller Service Threads - 34) WFLYHC0019: Registered remote slave host "hostweb2", JBoss WildFly Full 10.1.0.CR1 (WildFly 2.2.0.CR9)
2016-08-18 09:38:19,254 INFO [org.jboss.as.domain.controller] (Host Controller Service Threads - 36) WFLYHC0019: Registered remote slave host "hostweb1", JBoss WildFly Full 10.1.0.CR1 (WildFly 2.2.0.CR9)
2016-08-18 09:38:20,150 INFO [org.jboss.as.host.controller] (management task-1) WFLYHC0021: Server [Server:server-web2] connected using connection [Channel ID 05201088 (inbound) of Remoting connection 0d2653a3 to /192.168.2.201:55390 of endpoint "master:MANAGEMENT" <67c473e1>]
2016-08-18 09:38:20,248 INFO [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-web2
2016-08-18 09:38:20,252 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://192.168.2.201:9990/management
2016-08-18 09:38:20,254 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://192.168.2.201:9990
2016-08-18 09:38:20,255 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.CR1 (WildFly Core 2.2.0.CR9) (Host Controller) started in 17840ms - Started 55 of 57 services (19 services are lazy, passive or on-demand)
ログはHTTPDの設定ファイルでは
2016-08-18 09:38:15,752 INFO [org.jboss.as.remoting] (MSC service thread 1-1) WFLYRMT0001: Listening on 192.168.2.202:9999
2016-08-18 09:38:19,273 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0148: Connected to master host controller at remote://192.168.2.201:9999
2016-08-18 09:38:19,364 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023: Starting server server-web1
2016-08-18 09:38:19,366 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:19,474 WARN [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web1
2016-08-18 09:38:21,912 INFO [org.jboss.as.host.controller] (management task-10) WFLYHC0021: Server [Server:server-web1] connected using connection [Channel ID 45e867e4 (inbound) of Remoting connection 565bb1dc to /192.168.2.202:56530 of endpoint "hostweb1:MANAGEMENT" <60a9371d>]
2016-08-18 09:38:22,005 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.CR1 (WildFly Core 2.2.0.CR9) (Host Controller) started in 8419ms - Started 46 of 50 services (18 services are lazy, passive or on-demand)
2016-08-18 09:38:22,034 INFO [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-web1
そして
016-08-18 09:38:13,269 INFO [org.jboss.as.remoting] (MSC service thread 1-1) WFLYRMT0001: Listening on 192.168.2.203:9999
2016-08-18 09:38:16,763 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0148: Connected to master host controller at remote://192.168.2.201:9999
2016-08-18 09:38:16,847 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023: Starting server server-web2
2016-08-18 09:38:16,850 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web2
2016-08-18 09:38:16,950 WARN [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) WFLYHC0011: Ignoring <permgen> for jvm 'SUN' type jvm: jvm-web2
2016-08-18 09:38:19,968 INFO [org.jboss.as.host.controller] (management task-10) WFLYHC0021: Server [Server:server-web2] connected using connection [Channel ID 434a7830 (inbound) of Remoting connection 114a8665 to /192.168.2.203:60987 of endpoint "hostweb2:MANAGEMENT" <29b1c4e8>]
2016-08-18 09:38:20,052 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.CR1 (WildFly Core 2.2.0.CR9) (Host Controller) started in 8883ms - Started 46 of 50 services (18 services are lazy, passive or on-demand)
2016-08-18 09:38:20,083 INFO [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-web2
を示して、私が持っている:
##Creation du load balancer
CreateBalancers 1
<IfModule manager_module>
Listen PIXID-LBWEB:8796
ManagerBalancerName mycluster
<VirtualHost PIXID-LBWEB:8796>
KeepAliveTimeout 900
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise off
EnableMCPMReceive
<Location />
Order deny,allow
Deny from all
Allow from 192.168.2.202 192.168.2.203 192.168.2.204
</Location>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Allow from all
</Location>
</VirtualHost>
</IfModule>
Listen 8080
ServerName PIXID-LBWEB:8080
NameVirtualHost PIXID-LBWEB:8080
<VirtualHost PIXID-LBWEB:8080>
ServerAdmin [email protected]
ServerName PIXID-LBWEB:8080
ProxyPass/balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=off timeout=10
ProxyPassReverse/balancer://mycluster
ProxyPreserveHost On
ErrorLog "|/appli/apache2/bin/rotatelogs /log/apache/error_log_balancer.%Y-%m-%d 86400"
CustomLog "|/appli/apache2/bin/rotatelogs /log/apache/access_log_balancer.%Y-%m-%d 86400" common
<Location />
Order deny,allow
Allow from All
</Location>
</VirtualHost>
私が持っている問題は、セッションが2つのサーバー間で複製されないということです。ロードバランシングは問題なく動作します。 スレーブ1を停止すると、スレーブ2に切り替えられますが、セッションは存在せず、2番目のサーバは新しいセッションIDを作成します。
私はweb.xmlにdistributableを追加しました。
設定に何か不足していますか?
ありがとうございました。
であるあなたは[こちら](https://docs.jboss.org/author/display/WFLY10/Clustering+and+Domain+Setup+Walkthrough)の指示に従ってくださいましたか? –