JBoss域控制器如何发现不同物理机中的从主机控制器

发布于 2024-12-08 09:51:12 字数 213 浏览 0 评论 0原文

我试图设置 JBoss AS7 中的新域控制器功能。当服务器和主机控制器从 JBoss 的同一文件夹运行时,域控制器会在运行 domain.bat 时启动。但是如果我有一些服务器需要在其他物理机上运行,​​那么域控制器将如何运行当域控制器出现时启动这些服务器。由于 host.xml 知道控制器的地址,但域不知道不同机器中的不同主机控制器。是否意味着不同机器中的主机控制器需要先于域控制器启动?如果是的话怎么办?

I was trying to setup the domain controller feature which is new in JBoss AS7. When the servers and the host controller are running from the same folder of JBoss then the domain controller starts up on running the domain.bat.But if I have some servers which need to run on some other physical machine, then how will the domain controller start those servers when the domain controller comes up. As host.xml knows the address to the controller but the domain does not know the different host controllers in different machines. Does it mean that the host controllers in different machines needs to be started before the domain controller? If yes how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赢得她心 2024-12-15 09:51:12

该过程是一个有趣的过程,JBoss 社区已通过以下链接详细记录了该过程。

https://docs.jboss.org/author/display/AS7 /Admin+Guide#AdminGuide-ManagedDomain

https://docs.jboss.org/author/display/AS7/Domain+Setup

总之,当您启动域脚本时,主机控制器将变为活动状态。该控制器的作用是简单地管理属于它的服务器实例。其中一台主机将被配置为充当域控制器,这由 host.xml 文件中的一个简单元素指示。

<domain-controller>
   <local/>
</domain-controller>

在同一文件下,有两个部分是充当域控制器的主机需要配置的,您可以想象它们是其他主机通信的接口和端口。

<management-interfaces>
   <native-interface interface="management" port="9999" />
   <http-interface interface="management" port="9990" />
</management-interfaces>

<interfaces>
   <interface name="management">
       <inet-address value="192.168.0.12"/>
   </interface>
</interfaces>

这已经设置了域控制器,因此将本机接口(需要通信)和 http 接口(包括管理控制台)的端口声明解析为相关接口“管理”。接口声明又将其解析为 IP 地址 192.168.0.12。域控制器的工作是管理其他主机控制器。但他们需要知道如何解决自己的问题。

为此,我们需要做一些事情。我们需要一个主机控制器的名称来调用自己以区别于其他控制器,并且我们需要向域控制器公开一个接口,并知道域控制器正在公开自己的接口。这些仍然在每个安装的相应 host.xml 文件中完成(如果您很聪明,您可以在 CLI 中编写脚本)。

这是唯一名称:

<host xmlns="urn:jboss:domain:1.0"
     name="staging">
[...]
</host>

这是从属主机将端口声明为相对名称,以及该相对名称解析为:

<management-interfaces>
   <native-interface interface="management" port="9999" />
</management-interfaces>


<interfaces>
   <interface name="management">
       <inet-address value="192.168.0.101"/>
   </interface>
</interfaces>

这里是我们告诉主机控制器在哪里可以找到域控制器的地方。这样它就可以自行注册,这应该在某种程度上回答您的问题:域控制器如何“知道”哪些主机可用。

<domain-controller>
   <remote host="192.168.0.12" port="9999"/>

总而言之......主机的每个实例都有一个唯一的名称,知道在哪里轻拍头颅的肩膀,以及向其公开什么接口。作为回报,头目本身公开了一个管理接口,它监听要推送的实例(包括它们的名称、接口和服务器组)。

The process is an interesting one that has been documented well by the JBoss community per the following links.

https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-ManagedDomain

https://docs.jboss.org/author/display/AS7/Domain+Setup

In summary, when you boot the domain script, the Host Controller becomes active. The role of this controller is to simply manage the server instances attributed to it. One of the Hosts will be configured to act as the Domain Controller, which is indicated by a simple element in the host.xml file.

<domain-controller>
   <local/>
</domain-controller>

Under this same file are two sections that the Host acting as Domain Controller will need to configure, which as you can imagine are the interface and ports for the other Hosts to communicate to.

<management-interfaces>
   <native-interface interface="management" port="9999" />
   <http-interface interface="management" port="9990" />
</management-interfaces>

<interfaces>
   <interface name="management">
       <inet-address value="192.168.0.12"/>
   </interface>
</interfaces>

This has set up the Domain Controller so resolves the port declarations of the native interface (which it needs to communicate) and the http interface (including the Management Console) to the relative inteface "management". The interface declaration in turn resolves this to the IP address 192.168.0.12. The job of the Domain Controller will be to manage the other Host Controllers. But they need to know how to resolve themselves.

To do this we need a few things. We need a name for the Host Controller to call itself to differentiate from the others, and we need to expose an interface to the Domain Controller, as well as know the interface that the Domain Controller is exposing itself. These are all still done in the respective host.xml files for the each installation (which you can script in the CLI if your savvy).

Here's the unique name:

<host xmlns="urn:jboss:domain:1.0"
     name="staging">
[...]
</host>

Here's the slave host declaring ports to a relative name, and what that relative name resolves to:

<management-interfaces>
   <native-interface interface="management" port="9999" />
</management-interfaces>


<interfaces>
   <interface name="management">
       <inet-address value="192.168.0.101"/>
   </interface>
</interfaces>

And here's where we tell the Host Controller where to find the Domain Controller. This is so it can register itself, which should go some way to answering your question of how the Domain Controller "knows" what Hosts are available.

<domain-controller>
   <remote host="192.168.0.12" port="9999"/>

So in summary... each instance of the host has a unique name, knows where to tap the head honcho on the shoulder, and what interface to expose to it. In return, the head honcho is exposing a management interface itself, where it listens for instances to push around (including their name, their interface and server groups).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文