- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们把httpd作为负载均衡器放在wildfly前面。我使用的是 Wildfly 10.1.0。
我有3台机器,一台主机,两台从机。
在我的master的domain.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>
在我的从机 1 的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>
在我的从机 2 的 Hosts.xml 中,我有:
<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)
从站的日志显示
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
在httpd的配置文件中,我有:
##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 exploitation@abc.com
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>
我遇到的问题是 session 不会在两台服务器之间复制。负载平衡工作没有问题。如果我停止从属服务器 1,我会切换到从属服务器 2,但 session 不存在,第二个服务器会为我创建一个新的 session ID。
我确实将 distributable 添加到了我的 web.xml 中。
我在配置中遗漏了什么吗?
感谢您的帮助。
最佳答案
问题在于
<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"/>
我必须删除interface="private"才能使其正常工作。
现在的新配置是
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.201}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd" port="57600"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.201}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" port="54200"/>
关于wildfly - 我无法让 session 复制与 Wildfly 10 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39016021/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!