WebLogic 11g 에서는 ManagedServer 를 클러스터 설정을 제공합니다. 역시나 Admin Web Console 을 통해서 클릭으로만으로 쉽게 간단하게 설정이 가능합니다.
WebLogic 11g 클러스터 설정
Admin Web Console 에서 다음과 같이 설정이 가능 합니다.
웹로직 11g 클러스터 생성
왼쪽에서 클러스터를 누르고나면 위 화면과 같이 나오고 “새로 만들기” 버튼을 눌러서 생성을 할 수 있습니다.
웹로직 11g 클러스터 생성
생성할 클러스터 이름을 입력해 줍니다. 적절한 이름을 입력해주면 됩니다. 두번째로 클러스터 멤버간 메시징을 위한 방법을 정의해줍니다. 유니캐스트와 멀티캐스트가 있는데 유니캐스트의 경우에는 클러스터 노드가 많지 않을 경우에 사용하는게 적절해 보이며 반대일 경우에는 멀티캐스트로 하는것이 적절해 보입니다.
생성이 완료되면 이제 생성된 클러스터에 대해서 설정을 해야 합니다. 클러스터 메뉴에서 생성된 클러스터를 클릭하면 다음과 같은 화면을 보실 수가 있습니다.
웹로직 11g 클러스터 로드 설정
로드 알고리즘은 클러스터간 로드를 어떻게 분배할 것인가에 대한 것으로 서비스 형태에 따라 적절히 선택해주면 됩니다. 클러스터 주소의 서버 수는 클러스터에 나열할 서버 개수를 지정해 줍니다.
웹로직 11g 클러스터 서버 추가
클러스터 메뉴에서 서버 탭에서 추가 버튼을 클릭해서 서버를 추가 할 수 있습니다. 서버를 추가할때에는 기존의 생성된 서버를 추가할 수 있고 서버를 생성하면서 추가할 수도 있습니다. 서버를 추가하면서 생성할때에는 NodeManager 서버가 실행중이여야 합니다.
Session Replication between Cluserted Node
클러스터내 서버끼리 세션을 복재하고 공유하기위해서는 weblogic.xml 을 다음과 같이 설정 해 주어야 합니다.
#It is recommended to haveaminimum of256as value forevery4MBof RAM you have.
#So for8GBRAM=2048*4MB=2048*256=524288
fs.file-max=6815744
#It sets the maximum number of shared memory segments that server can handle.
#As Oracle recommends the value should be at least4096,
#it says that we cannot find more than4096number of shared memory segments at any instance on the server.
#Note that SHMMNI value is innumbers.
#
#No change it should be4096.It must be increased ifyou have more than at least one fourth(1024)Oracle Databases running on the server.Which we never recommend.
kernel.shmmni=4096
#It defines the total amount of shared memory PAGES that can be used system-wide.
#It means that to the use all the physical memory this value should be less than or equal to total physical memory size.
#ForDBA's, it means that sum of all SGA sizes on the server should be less than or equal to SHMALL value.
# Note that SHMALL value is a number of pages.
#
# If you want the maximum size of SGA on this server to be 5GB, then this parameter value should be 5*1024*1024*1024 = 5368709120 bytes. This, in turn, says that you should not have any database with more than 5GB of SGA. But you can have multiple databases with each 5GB of SGA or even less. This is the fact why Oracle recommends to have this value more than half of the memory to utilize it for SGA(s).
#
# By chance, if your SGA size is more than 5GB say it is 7GB then 2 shared memory areas will be allocated to SGA with one of 5GB and two of 2GB sizes, which doesn'sperform well.
kernel.shmmax=2147483648
#It defines the total amount of shared memory PAGES that can be used system-wide.It means that to the use all the physical memory this value should be less than or equal to total physical memory size.ForDBA's,it means that sum of all SGA sizes on the server should be less than or equal to SHMALL value.Note that SHMALL value isanumber of pages.
#By default the page size on Linux is4KB.The total size of RAM is8GB.Let usleave at least1GBof RAM forLinux kernel to run,with which consider7GBcan be used forOracle Databases.Now value of SHMALL can be:
#
#(7*1024*1024)KB/4KB=1835008
kernel.shmall=95325
kernel.sem=25032000100128
#This parameter defines the range of port numbers that system can use forprograms which want to connect to the server withoutaspecific port number.
#
#Now,it makes sense ifyou have come across somebody advising you not to use port numbers forlistener beyond9000.Also,just look back to documents on OEM installation,Oracle uses and advises all the default port numbers less than9000.
net.ipv4.ip_local_port_range=900065500
#This parameter defines the default and maximum RECEIVE socket memory through TCP.
net.core.rmem_default=262144
net.core.rmem_max=4194304
#This parameter defines the default and maximum SEND socket memory through TCP.
#It is recommended to haveaminimum of256as value forevery4MBof RAM you have.
#So for8GBRAM=2048*4MB=2048*256=524288
fs.file-max=6815744
#It sets the maximum number of shared memory segments that server can handle.
#As Oracle recommends the value should be at least4096,
#it says that we cannot find more than4096number of shared memory segments at any instance on the server.
#Note that SHMMNI value is innumbers.
#
#No change it should be4096.It must be increased ifyou have more than at least one fourth(1024)Oracle Databases running on the server.Which we never recommend.
kernel.shmmni=4096
#It defines the total amount of shared memory PAGES that can be used system-wide.
#It means that to the use all the physical memory this value should be less than or equal to total physical memory size.
#ForDBA's, it means that sum of all SGA sizes on the server should be less than or equal to SHMALL value.
# Note that SHMALL value is a number of pages.
#
# If you want the maximum size of SGA on this server to be 5GB, then this parameter value should be 5*1024*1024*1024 = 5368709120 bytes. This, in turn, says that you should not have any database with more than 5GB of SGA. But you can have multiple databases with each 5GB of SGA or even less. This is the fact why Oracle recommends to have this value more than half of the memory to utilize it for SGA(s).
#
# By chance, if your SGA size is more than 5GB say it is 7GB then 2 shared memory areas will be allocated to SGA with one of 5GB and two of 2GB sizes, which doesn'sperform well.
kernel.shmmax=4294967296
#It defines the total amount of shared memory PAGES that can be used system-wide.It means that to the use all the physical memory this value should be less than or equal to total physical memory size.ForDBA's,it means that sum of all SGA sizes on the server should be less than or equal to SHMALL value.Note that SHMALL value isanumber of pages.
#By default the page size on Linux is4KB.The total size of RAM is8GB.Let usleave at least1GBof RAM forLinux kernel to run,with which consider7GBcan be used forOracle Databases.Now value of SHMALL can be:
#
#(7*1024*1024)KB/4KB=1835008
kernel.shmall=1835008
kernel.sem=25032000100128
#This parameter defines the range of port numbers that system can use forprograms which want to connect to the server withoutaspecific port number.
#
#Now,it makes sense ifyou have come across somebody advising you not to use port numbers forlistener beyond9000.Also,just look back to documents on OEM installation,Oracle uses and advises all the default port numbers less than9000.
net.ipv4.ip_local_port_range=900065500
#This parameter defines the default and maximum RECEIVE socket memory through TCP.
net.core.rmem_default=262144
net.core.rmem_max=4194304
#This parameter defines the default and maximum SEND socket memory through TCP.
복구를 위해서 다른 서버를 준비해야 합니다. 그 서버에는 기본적으로 다음과 같은 사항이 정리되어 있어야 합니다.
원본 서버와 동일한 자바(JAVA) 가 설치되어 있어야 한다.
원본 서버와 동일한 WebLogic 디렉토리를 가지고 있어야 한다.
WebLogic Home 복구
WebLogic Home 복구는 jar 파일을 jar 명령어로 압축해제함으로써 완료 됩니다.
ZSH
1
2
3
]$cd/opt/WebLogic/
]$jar-xf/home/systemv/mwhome.jar
]$
별거 없습니다. 위 명령어로 복구가 완료 됩니다.
여기서 한가지 더 해줘야 할 것이 nodemanager 를 위한 복구 프로세스 입니다. nodemanager 는 WebLogic Admin 서버와 통신을 하면서 Node 를 관리하는 역활을 담당합니다. Node 에 Managed Server 를 생성하거나 삭제, 시작, 중지등을 Admin 서버에서 하기위해서는 nodemanager 서버가 있어야 합니다.
문제는 nodemanager 서버는 서버에 종속되는 설정값을 가져야 하기 때문에 서버를 복제하고 난후에 서버환경을 다시 인식시켜줘야 합니다. 방법은 다음과 같습니다.
Node Manager 를 실행하면 nodemanager.properties 파일에 각종 환경설정을 정리하고 nodemanager.domains 파일을 생성합니다. 그런데, nodemanager.properties 에 내용을 변경해야하기 때문에 Node Manager 를 중단시킨 겁니다.
nodemanager.properties 파일중에 다음과 같이 수정해 줍니다.
1
2
-17SecureListener=true
+17SecureListener=false
WebLogic Domain 복구
복제할때에 ‘pack.sh’ 명령어를 썼었는데 복구할때는 ‘unpack.sh’ 명령어를 사용 합니다.
복구가 완료 되면, 이제 Domain 설정파일에서 호스트 이름을 현 시스템으로 바꿉니다. 그것은 /home/systemv/wl_domain/mCloud/config/config.xml 파일인데, 여기서 호스트명을 현 시스템으로 바꿔주고 불필요한 Managed Server 리스트, deployment 를 삭제처리 해줍니다.
Weblogic 10.3.6 에는 Node Manager 가 존재합니다. Node Manager 는 하나의 도메인에 존재하는 서버로 말 그대로 노드를 관리하는 기능을 합니다. 좀 더 들어가면, Node Manager 의 주요 기능은 도메인에 추가된 Managed Server 를 생성,삭제,시작,중지등을 가능하도록 해줍니다.
만일 Node Manager 가 존재하지 않는다면, Managed Server 를 Web Console 을 통해서 생성을 할 수 있지만 Managed Server 를 시작하기 위해서는 터미널에서 커맨드 라인으로 직접 시작 명령을 주거나 아니면 WST 를 이용해서 시작을 시켜줘야 합니다.
Admin Server, Managed Server 는 도메인에 귀속되지만 Node Manager 는 머신(Machine)에 귀속됩니다. 그래서 시작스크립트도 $MW_HOME 에 존재합니다.
최초로 Node Manager 를 실행하면 화면에 Node Manager 설정 관련 내용이 화면에 출력됩니다. 이 내용은 $MW_HOME/common/nodemanager 디렉토리에 nodemanager.properties 파일에 기록 됩니다. 여기서 자세히 보면 “SecureListener=true” 로 된 것이 보입니다. 이것은 NodeManager 와의 연결을 SSL 을 통해서 하겠다는 겁니다.
위 설정은 $MW_HOME/common/nodemanager/nodemanager.properties 파일에 저장되어 있고 SecureListener 부분을 false 로 바꾸고 Node Manager 를 재 실행해 줍니다.
이제 Node Manager 를 등록해 줍니다.
Node Manager 등록
Node Manager 등록은 WebLogic 의 관리자 페이지에서 ‘환경->시스템’ 에서 할 수 있습니다. 관리자 콘솔에서는 Node Manager 등록이라고 안하고 시스템이라고 표현합니다.
Node Manager 등록
‘새로 만들기’ 를 클릭해서 등록 화면으로 넘어갑니다.
Node Manager 이름 등록
시스템 이름을 지정해 줍니다. ‘다음’ 으로 넘어 갑니다.
Node Manager 정보 입력
여기서 ‘유형’ 을 일반으로 해줍니다. 앞에서 SeucureListener 를 false 로 해줬기 때문에 일반 접속 유형으로 Node Manager 가 통신을 합니다. 그리고 수신 주소, 수신 포트 등을 알맞게 입력하고 ‘완료’ 해 줍니다.
서버 설정
이렇게 Node Manager 를 등록하게 되면 이미 생성된 서버나 생성할 서버에 ‘시스템’ 을 지정해 줄 수 있습니다. 서버 목록중에 생성된 서버를 클릭해서 들어가면 ‘일반’ 탭에 서버 정보가 나오는데, 여기서 시스템을 드롭박스를 이용해서 선택해줍니다. 이렇게 되면 이 서버는 선택한 시스템에 생성되고 제어 됩니다.
이 시점에서 WebLogic 10.3.6 는 아주 오래된 버전이다. JDK 1.6 을 기반으로 하고 JEE 도 오래된 버전을 지원한다. 그런데도 간혹 프로젝트를 하다보면 이 버전을 사용하는 곳도 심심치 않아 경악할 때가 있다.
WebLogic 을 버전 업그레이드를 한다고 하려면 어짜피 오래된 버전에 관해서 조금 알아 둘 필요가 있고 WebLogic 의 기본 구성의 경우에는 버전에 크게 상관이 없는 경우도 있어 나름대로 의미가 있다.
설치
WebLogic 10.3.6 버전은 Oracle 홈페이지에서 다운로드 받을 수 있다.정확하게 말하면 WebLogic 10.3.6 버전중에 “Zip distribution with Oracle WebLogic Server only and intended for WebLogic Server” 에 대한 것이다.
Oracle WebLogic Server only
위와 같이 파일을 다운로드 받습니다. 그리고 다음과 같이 압축을 해제해 줍니다.
WebLogic 10.3.6 Develop Only
ZSH
1
2
3
]# unzip -o wls1036_dev.zip -d /opt
]# cd /opt
]# ln -s Weblogic10.3.6_dev WLS
그리고 다음과 같이 MW_HOME 환경변수를 세팅해줍니다.
MW_HOME 환경변수 세팅.
ZSH
1
]# export MW_HOME=/opt/WLS
그리고 다음과 같이 configure.sh 파일을 Bash 쉘에 문법에 맞게 고쳐줍니다.
Configure.sh 수정
diff
1
2
3
4
- 14 if [[ -z "$MW_HOME" || ! -d $MW_HOME || ! "$(ls -A $MW_HOME)" ]]; then
+ 14 if [ -z "$MW_HOME" ] || [ ! -d $MW_HOME ] || [ ! "$(ls -A $MW_HOME)" ]; then
- 22 if [[ -z $JAVA_HOME ]] || [[ ! -d "${JAVA_HOME}/bin" ]]; then
+ 22 if [ -z $JAVA_HOME ] || [ ! -d "${JAVA_HOME}/bin" ]; then