官术网_书友最值得收藏!

Creating a server instance

A server instance is created on a host and belongs to one server group. The server exposes various ports to interact with its services.
Since we want to have many server instances on the same host, we will shift the instances port offset. For BeOSBank projects, we take a convention to add 100 to the base offset while moving from one server to another. This means that all the default ports of the associated socket binding will be shifted for a specific instance.

Host1 server creation can be completed with the following command list: 

[domain@127.0.0.1:9999 /] /host=host1/server-config=node11:add(group=dev01,socket-binding-port-offset=100)
[domain@127.0.0.1:9999 /] /host=host1/server-config=node12:add(group=dev02,socket-binding-port-offset=200)
[domain@127.0.0.1:9999 /] /host=host1/server-config=node13:add(group=dev03,socket-binding-port-offset=300)
[domain@127.0.0.1:9999 /] /host=host1/server-config=node14:add(group=dev04,socket-binding-port-offset=400)

A servers instance on host2 can be created using the same command. Adjust the server names accordingly

Since we are simulating host1 and host2 on the same machine, we cannot have the same offset as described on the previous schema (node11 and node21 on HTTP port 8180). We have to continue adding +100; so, node21 will listen on HTTP port 8580, node22 :8680, and node23 :8780):

[domain@127.0.0.1:9999/]/host=host2/server-config=node21:add(group=dev01, socket-binding-port-offset=500)
[domain@127.0.0.1:9999/]/host=host2/server-config=node22:add(group=dev02,socket-binding-port-offset=600)
[domain@127.0.0.1:9999 /] /host=host2/server-config=node23:add(group=dev03,socket-binding-port-offset=700)
You may have a more verbose result while creating the first server instance on each host:
step-1 => {outcome => success}, step-3 => {outcome => success}, .....step-256 => {outcome => success}

All server nodes are now created. You can start/stop a specific instance or all the instances that belong to a server group:

[domain@127.0.0.1:9999 /] /server-group=dev01:start-servers
{
"outcome" => "success",
"result" => undefined,
"server-groups" => undefined
}
[domain@127.0.0.1:9999 /] /host=host2/server-config=node22:start
{
"outcome" => "success",
"result" => "STARTING"
}
[domain@127.0.0.1:9999 /]

Client: If the domain controller is down, what is the behavior of my instances?
Doctor JBoss: The server instances continue to work perfectly, but administration is not possible on the domain. However, if you had set up a backup domain controller, instances will try to join this one.

You can see the newly created server on the management console by clicking on a specific server group:

Servers groups and instances
The console is available at http://127.0.0.1:9990/console. JBoss remoting port is = 9999, and HTTP interfaces are on 9990 by default.

Client: Thank you for your demonstration! I am very impatient to see my money transfer application running on this domain; however, I have some important questions: how will these two instances run the application concurrently, and do I have to provide two URLs to my customers?

What is the application behavior when one instance goes down for my critical money transfer application? I do not want to lose any transaction data. Can you show me how it works.

Doctor JBoss: Thank you for your questions. We will show you how to develop and deploy clustered applications using JBoss APIs and the JBoss Application Server. This is the purpose of the next section.

主站蜘蛛池模板: 西藏| 长沙县| 梧州市| 青川县| 阿坝县| 烟台市| 渝北区| 太仓市| 米脂县| 屏南县| 马边| 额济纳旗| 自贡市| 宜兴市| 哈密市| 东明县| 漳州市| 绥阳县| 沙河市| 黄浦区| 郎溪县| 阿拉尔市| 库伦旗| 远安县| 息烽县| 喀喇沁旗| 绥芬河市| 格尔木市| 渭南市| 大丰市| 建平县| 环江| 民和| 呼和浩特市| 松溪县| 勃利县| 行唐县| 神木县| 金山区| 宜良县| 涪陵区|