19.8.5. 配置 ISAPI Redirector 在多个 JBoss EAP 6 服务器间平衡客户请求
这个配置将客户请求在多个 JBoss EAP 6 服务器间进行平衡。如果您希望将客户请求发送到专门的 JBoss EAP 6 服务器,请参考 第 19.8.4 节 “配置 ISAPI Redirector 发送客户请求到 JBoss EAP 6”。
预备条件
- 访问 IIS 服务器的完整管理员权限。
过程 19.19. 在多个服务器间平衡客户请求
创建一个目录来存储日志、属性文件和锁文件。
本过程剩余的部分将假定您在使用C:\connectors\目录。如果您使用了不同的目录,请相应地修改这些说明。创建
isapi_redirect.properties文件。创建名为C:\connectors\isapi_redirect.properties的文件。复制下列内容到文件里。# Configuration file for the ISAPI Redirector # Extension uri definition extension_uri=/jboss/isapi_redirect.dll # Full path to the log file for the ISAPI Redirector log_file==c:\connectors\isapi_redirect.log # Log level (debug, info, warn, error or trace) # Use debug only testing phase, for production switch to info log_level=debug # Full path to the workers.properties file worker_file=c:\connectors\workers.properties # Full path to the uriworkermap.properties file worker_mount_file=c:\connectors\uriworkermap.properties #OPTIONAL: Full path to the rewrite.properties file rewrite_rule_file=c:\connectors\rewrite.properties
创建
uriworkermap.properties文件。uriworkermap.properties文件包含了部署的应用程序 URL 和处理请求的工作节点间的映射。下面的例子展示了这个文件的语法及负载平衡配置。通配符(*)发送不同子目录的所有请求到负载平衡器router。步骤 4 里介绍了负载平衡器的配置。将uriworkermap.properties文件放入C:\connectors\。# images, css files, path /status and /web-console will be # provided by nodes defined in the load-balancer called "router" /css/*=router /images/*=router /status=router /web-console|/*=router # Example of exclusion from mapping, logo.gif won't be displayed !/web-console/images/logo.gif=* # Requests to /app-01 and /app-02 will be routed to nodes defined # in the load-balancer called "router" /app-01|/*=router /app-02|/*=router # mapping for management console, nodes in cluster can be enabled or disabled here /jkmanager|/*=status
创建
workers.properties文件。workers.properties文件包含工作标签和服务器实例间的映射定义。下面的示例文件展示了这个文件的语法。负载平衡器是在文件的结尾进行配置的,由worker01和worker02组成。workers.properties文件遵循 Apache mod_jk 配置里使用的相同文件的语法。关于workers.properties文件语法的更多信息,请参考 第 19.6.5 节 “Apache Mod_jk 工作节点的配置”。将这个文件放入C:\connectors\目录。# The advanced router LB worker worker.list=router,status # First EAP server definition, port 8009 is standard port for AJP in EAP # # lbfactor defines how much the worker will be used. # The higher the number, the more requests are served # lbfactor is useful when one machine is more powerful # ping_mode=A – all possible probes will be used to determine that # connections are still working worker.worker01.port=8009 worker.worker01.host=127.0.0.1 worker.worker01.type=ajp13 worker.worker01.ping_mode=A worker.worker01.socket_timeout=10 worker.worker01.lbfactor=3 # Second EAP server definition worker.worker02.port=8009 worker.worker02.host=127.0.0.100 worker.worker02.type=ajp13 worker.worker02.ping_mode=A worker.worker02.socket_timeout=10 worker.worker02.lbfactor=1 # Define the LB worker worker.router.type=lb worker.router.balance_workers=worker01,worker02 # Define the status worker for jkmanager worker.status.type=status
创建
rewrite.properties文件。rewrite.properties文件包含了专有应用程序的简单 URL 重写规则。如下例所示,重写路径使用名称-值对来指定的。请将这个文件放入C:\connectors\目录。#Simple example # Images are accessible under abc path /app-01/abc/=/app-01/images/
重启 IIS 服务器。
通过net stop和net start命令重启 IIS 服务器。C:\> net stop was /Y C:\> net start w3svc
配置 IIS 服务器发送客户请求到 workers.properties 文件里引用的 JBoss EAP 6 服务器,在服务器间均匀地调配负载。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.