- JBoss:Developer's Guide
- Elvadas Nono Woguia
- 471字
- 2021-07-02 18:37:27
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)
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:
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.
- Mastering Concurrency Programming with Java 8
- PaaS程序設計
- Vue.js快跑:構建觸手可及的高性能Web應用
- 算法基礎:打開程序設計之門
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- Scratch真好玩:教小孩學編程
- Yocto for Raspberry Pi
- 精通Python設計模式(第2版)
- 零基礎學Python編程(少兒趣味版)
- HTML5移動Web開發
- 深入理解Java虛擬機:JVM高級特性與最佳實踐
- Mobile Test Automation with Appium
- Java EE應用開發及實訓
- Getting Started with Backbone Marionette
- R for Data Science Cookbook