运行多个 JBoss (JBoss 4.2) 时使用 Service Binder 的原因是什么
我发现了几个如何在同一台计算机上运行 JBoss 的多个实例的教程。
他们都提到取消注释 Service Binder 并为每个服务器提供单独的 service-binding.xml 文件。
问题是为什么要这样做?除了添加额外的间接层之外还有什么原因吗?
看起来同样可以通过修改每个服务器的 jboss-service.xml 中的端口来完成。唯一的限制是没有简单的方法来切换哪个 JBoss 实例使用哪组端口。
I found couple of tutorials how to run multiple instances of JBoss on the same machine.
All of them mention uncommenting Service Binder and having separate service-binding.xml files for each server.
The question is why it's done like that? Is there any reason except adding additional layer of indirection?
It looks the same could be done by modification of ports in jboss-service.xml for each server. The only restriction would be that there won't be easy way to switch which instance of JBoss uses which set of ports.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您修改
jboss-service.xml
中的端口是正确的。这是更改端口的直接且真实的方法。不幸的是,端口不仅在该文件中定义,还在其他地方定义,例如 jboss-web 的配置等。
捕捉所有这些地方可能很容易出错。
因此,我们的想法是拥有一个位于服务器安装根目录中的中心文件 (service-binding.xml)。您基本上将“默认”配置复制到 server1、server2 等,然后在启动时通过命令行传递服务器名称,以便从 service-bindings.xml 获取所有服务的正确端口偏移量并将其应用于结果运行时配置。
JBossAS 7 将这一概念进一步发展到 ServiceBindingGroups,其中基本端口是在域级别定义的,然后为每个服务器选择一个基本组+仅按名称偏移端口,因此所需的工作比 as4 更少
You are right with modifying the ports in
jboss-service.xml
. This is the straightforward and genuine way to change the ports.Unfortunately, ports are not only defined in that file, but also in other places like jboss-web's configuration etc.
Catching all those places can be error prone.
So the idea was to have a central file (service-binding.xml) that lives in the root of a server installation. You basically copy the 'default' config to server1, server2 etc and then via command line pass in the server name when starting so that the correct port-offset for all of the services is taken from service-bindings.xml and applied to the resulting runtime configuration.
JBossAS 7 takes this concept one step further to the ServiceBindingGroups, where the base ports are defined on a domain level and then per server you pick a basic group + just a port offset by name, so that there is even less work needed than in as4