JBoss EAP 7.2๋ฅผ ๋๋ฉ์ธ ๋ชจ๋๋ก ๊ตฌ์ฑํ์ฌ ์ค์ ์ง์ค์ ๊ด๋ฆฌ ํ๊ฒฝ์ ๊ตฌ์ถํฉ๋๋ค. Windows Server ํ๊ฒฝ์์ ๋ง์คํฐ(Master)์ ์ฌ๋ ์ด๋ธ(Slave) ํธ์คํธ๋ฅผ ์ค์ ํ๊ณ ,
add-user๋ฅผ ํตํด ๋ณด์ ์ธ์ฆ(Secret Value)์ ์ฒ๋ฆฌํ๋ ๊ณผ์ , ๊ทธ๋ฆฌ๊ณ CLI๋ฅผ ์ด์ฉํ ์ ์ด ๋ฐฉ๋ฒ์ ๋ค๋ฃน๋๋ค.
0. ๋ฐฐ๊ฒฝ ์ง์ (Context)
๋๋ฉ์ธ ๋ชจ๋๋ Domain Controller(Master)๊ฐ ์ ์ฒด ์ ์ฑ ์ ๊ด๋ฆฌํ๊ณ , Host Controller(Slave)๋ค์ด ์ค์ ์๋ฒ ์ธ์คํด์ค๋ฅผ ๊ตฌ๋ํ๋ ๊ตฌ์กฐ์ ๋๋ค.
- Master: ์ค์ ๋ฐ ๋ฐฐํฌ ์ค์ ๊ด๋ฆฌ (์๋ฒ ์ธ์คํด์ค๋ฅผ ์ง์ ๋์ฐ์ง ์๋ ๊ฒ์ ๊ถ์ฅ)
- Slave: ์ค์ ์ ํ๋ฆฌ์ผ์ด์ ์ด ๊ตฌ๋๋๋ ์๋ฒ ๊ทธ๋ฃน ๊ด๋ฆฌ
Test Environment
- OS: Windows NT (10/Server)
- Version: JBoss EAP 7.2
- Topology: One-Box ๊ตฌ์ฑ (ํ๋์ ์๋ฒ์ Master/Slave ๋๋ ํ ๋ฆฌ ๋ถ๋ฆฌ)
1. ๊ด๋ฆฌ์ ๊ณ์ ์์ฑ ๋ฐ ์ธ์ฆ ํ ํฐ ํ๋ณด
๋๋ฉ์ธ ์ปจํธ๋กค๋ฌ(Master)์ ํธ์คํธ ์ปจํธ๋กค๋ฌ(Slave) ๊ฐ์ ํต์ ์ ์ํด์๋ ๋ณด์ ์ธ์ฆ์ด ํ์ํฉ๋๋ค. add-user.bat๋ฅผ ํตํด ๊ณ์ ์ ์์ฑํ๊ณ Secret Value๋ฅผ ํ๋ณดํด์ผ ํฉ๋๋ค.
์คํ ์ ์ฐจ
F:\app\Redhat\JBoss7.2\bin> add-user.bat
# 1. ๊ด๋ฆฌ์ ๊ณ์ ์ ํ
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
# 2. ๊ณ์ ์ ๋ณด ์
๋ ฅ (Username: admin / Password ์ค์ )
# ... (์ค๋ต) ...
# 3. ํ๋ก์ธ์ค ๊ฐ ์ฐ๊ฒฐ ์น์ธ (์ค์!)
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master ...
yes/no? yes
# 4. ๊ฒฐ๊ณผ๊ฐ ๋ณต์ฌ
To represent the user add the following to the server-identities definition
<secret value="..." /> ๋ฌธ์์ด์ ๋ฐ๋์ ๋ณต์ฌํด ๋์ญ์์ค. Slave ์ค์ ์ ์ฌ์ฉ๋ฉ๋๋ค.
2. ์ค์ ํ์ผ ์์ (Configuration)
Master์ Slave ๊ฐ๊ฐ์ host.xml ํ์ผ์ ์์ ํ์ฌ ์ญํ ์ ์ ์ํฉ๋๋ค.
1) Master ์ค์ (host-master.xml)
์์ ์ด ๋๋ฉ์ธ ์ปจํธ๋กค๋ฌ์์ ๋ช ์ํฉ๋๋ค.
<host xmlns="urn:jboss:domain:8.0" name="test-master">
<domain-controller>
<local/>
</domain-controller>
...
</host>
2) Slave ์ค์ (host-slave.xml)
Master์ ์ฐ๊ฒฐํ๊ธฐ ์ํ ์ธ์ฆ ์ ๋ณด์ ๊ณ ์ ํ ํธ์คํธ ์ด๋ฆ์ ์ค์ ํฉ๋๋ค. ํ ์ฅ๋น์์ ๋์ธ ๊ฒฝ์ฐ ํฌํธ ์ถฉ๋ ๋ฐฉ์ง๋ฅผ ์ํด ๊ด๋ฆฌ ํฌํธ๋ฅผ ๋ณ๊ฒฝํด์ผ ํฉ๋๋ค.
<host xmlns="urn:jboss:domain:8.0" name="slave-node01">
<server-identities>
<secret value="YWRtaW4xMiMk" />
</server-identities>
<domain-controller>
<remote security-realm="ManagementRealm">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9990}"/>
</discovery-options>
</remote>
</domain-controller>
<management-interfaces>
<http-interface security-realm="ManagementRealm">
<http-upgrade enabled="true"/>
<socket interface="management" port="${jboss.management.http.port:19990}"/>
</http-interface>
</management-interfaces>
</host>
3. ๋๋ฉ์ธ ๊ธฐ๋ (Start Scripts)
๋๋ ํ ๋ฆฌ(domain/base/dir)๋ฅผ ๋ถ๋ฆฌํ์ฌ ์ด์ํ๋ ํ๊ฒฝ์ ๊ฐ์ ํ ๊ธฐ๋ ์คํฌ๋ฆฝํธ์
๋๋ค.
Master ๊ธฐ๋
F:\app\Redhat\JBoss7.2\bin\domain.bat ^
-Djboss.domain.base.dir="F:\app\Redhat\JBoss7.2\master" ^
-b=192.168.0.6 ^
-bmanagement=192.168.0.6 ^
--host-config=host-master.xml
Slave ๊ธฐ๋ (Node 01 & 02)
Slave๋ --master-address ์ต์
์ผ๋ก Master๋ฅผ ๋ฐ๋ผ๋ณด๋ฉฐ, -Djboss.socket.binding.port-offset์ผ๋ก ์๋น์ค ํฌํธ ์ถฉ๋์ ๋ฐฉ์งํฉ๋๋ค.
:: Slave Node 01 (Port Offset: 1000)
F:\app\Redhat\JBoss7.2\bin\domain.bat ^
-Djboss.domain.base.dir="F:\app\Redhat\JBoss7.2\node01" ^
-b=192.168.0.6 ^
-bmanagement=192.168.0.6 ^
--host-config=host-slave.xml ^
--master-port=9990 ^
--master-address=192.168.0.6 ^
-Djboss.socket.binding.port-offset=1000
:: Slave Node 02 (Port Offset: 2000)
F:\app\Redhat\JBoss7.2\bin\domain.bat ^
-Djboss.domain.base.dir="F:\app\Redhat\JBoss7.2\node02" ^
-b=192.168.0.6 ^
-bmanagement=192.168.0.6 ^
--host-config=host-slave.xml ^
--master-port=9990 ^
--master-address=192.168.0.6 ^
-Djboss.socket.binding.port-offset=2000
4. CLI๋ฅผ ์ด์ฉํ ์๋ฒ ์ ์ด (Management)
๋๋ฉ์ธ ๋ชจ๋์์๋ jboss-cli๋ฅผ ํตํด ํน์ ํธ์คํธ์ ํน์ ์๋ฒ ์ธ์คํด์ค๋ง ์ ์ดํ ์ ์์ต๋๋ค.
๊ธฐ๋ณธ ๊ตฌ๋ฌธ
/host=[HOST_NAME]/server-config=[SERVER_NAME]:[start|stop|restart]
์คํ ์์
:: ์ ์ (Master Controller IP๋ก ์ ์)
F:\app\Redhat\JBoss7.2\bin> jboss-cli.bat --connect controller=192.168.0.6:9990
:: ํน์ ์๋ฒ(test01) ์ ์ง
[domain@192.168.0.6:9990 /] /host=slave-node01/server-config=test01:stop
{
"outcome" => "success",
"result" => "STOPPING"
}
:: ํน์ ์๋ฒ(test01) ๊ธฐ๋
[domain@192.168.0.6:9990 /] /host=slave-node01/server-config=test01:start
{
"outcome" => "success",
"result" => "STARTING"
}
Next Step:
๊ตฌ์ฑ์ด ์๋ฃ๋์๋ค๋ฉด ๊ด๋ฆฌ ์ฝ์(http://192.168.0.6:9990)์ ์ ์ํ์ฌ Runtime ํญ์์ Topology๊ฐ ์ ์์ ์ผ๋ก ์ธ์๋๋์ง ํ์ธํ์ญ์์ค.