Nginx 는 전세계적으로 인기있는 웹 서버 입니다. 기존 웹 서버들과 달리 고속이며 대량의 접속을 적은 자원으로 처리해줍니다. 또, Nginx 는 Reverse Proxy 기능도 아주 훌륭하게 수행하며 이에 더해서 로드밸런싱 기능도 제공하는듯 다양한 기능을 다른 웹서버들보다 훌륭하게 수행합니다. 아키텍쳐(Architecture) 먼저 다음과 같은 아키텍쳐를 생각해 봅시다. AWS 에 흔히 볼수 있는 기본적인 아키텍쳐입니다. 외부 접속은 External ELB가 담당하고 이것을 뒤에 Nginx 서버가 ELB의 접속을 받아서 Nginx 뒤에 있는 Jboss EAP 서버에 분배 접속을 하도록 하는 것입니다. Nginx 로드 밸런싱(Load Balancing) Nginx 는 […]
WebLogic 11g 기동시 JAVA OPTION 넣기
WebLogic 11g 기동시 JAVA OPTION 넣기위해서 setDomainEnv.sh 나 commonEnv.sh 를 수정하는 경우가 있다. 하지만 이렇게 하면 WebLogic 11g 를 구성하는 Admin, NodeManager, ManagedServer 에 각각 따로따로 적용해주기위해서 앞에서 언급한 쉘 스크립트에 조건식을 줘야 한다. setDomainEnv.sh 나 commonEnv.sh 는 WebLogic 서버에서 전역적으로 사용하는 것이기 때문에 특정한 부분을 위해서 수정하는 경우는 지양해야 한다. 최신의 WebLogic 11g 에서는 이러한 특정부분만을 위해 적용할 수 있는 JAVA OPTION 변수를 제공하는데 그것이 바로 USER_MEM_ARGS 이다. 쉘 환경변수로서 이것을 활용하면 Admin, NodeManager, ManagedServer 기동시에 JAVA OPTION을 줄 […]
WebLogic 11g 클러스터 설정.
WebLogic 11g 에서는 ManagedServer 를 클러스터 설정을 제공합니다. 역시나 Admin Web Console 을 통해서 클릭으로만으로 쉽게 간단하게 설정이 가능합니다. WebLogic 11g 클러스터 설정 Admin Web Console 에서 다음과 같이 설정이 가능 합니다. 왼쪽에서 클러스터를 누르고나면 위 화면과 같이 나오고 “새로 만들기” 버튼을 눌러서 생성을 할 수 있습니다. 생성할 클러스터 이름을 입력해 줍니다. 적절한 이름을 입력해주면 됩니다. 두번째로 클러스터 멤버간 메시징을 위한 방법을 정의해줍니다. 유니캐스트와 멀티캐스트가 있는데 유니캐스트의 경우에는 클러스터 노드가 많지 않을 경우에 사용하는게 적절해 보이며 반대일 경우에는 멀티캐스트로 하는것이 […]
Oracle 11gR2 설치
Oracle 11gR2 설치 Silent Installation 방식이며 OFA(Optimal Flexible Architecture) 를 따른다. 환경 CentOS 6.8 64bit Memory 4GB Swap 8GB (Swap must be enabled double the size of RAM) Storage Size 50GB 호스트네임 변경
|
1 2 3 4 5 |
]# vi /etc/sysconfig/network HOSTNAME=oraserv1.systemv.pe.kr ]# vi /etc/hosts 192.168.96.42 oraserv1.systemv.pe.kr oraserv1 ]# /etc/init.d/network restart |
Selinux 설정 변경
|
1 2 |
]# vi /etc/selinux/config SELINUX=disable |
Kernel 3.10 설치
|
1 2 3 4 5 |
]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org ]# rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm ]# sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/elrepo.repo ]# yum --enablerepo=elrepo-kernel install kernel-lt ]# sed -i "s/default=1/default=0/g" /boot/grub/grub.conf |
설치 완료하고 나서 reboot. 계정생성
|
1 2 3 4 5 |
groupadd -g 500 oinstall groupadd -g 501 dba groupadd -g 502 oper useradd -u 500 -g oinstall -G dba,oper oracle |
의존성 패키지 설치
|
1 2 3 4 |
]# yum install compat-libstdc++-33.x86_64 elfutils-libelf-devel.x86_64 elfutils-libelf-devel-static.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc-devel.x86_64 ksh.x86_64 libaio-devel.i686 libaio-devel.x86_64 libgomp.x86_64 libstdc++-devel.x86_64 sysstat.x86_64 unzip unixODBC.i686 unixODBC-devel.i686 unixODBC.x86_64 unixODBC-devel.x86_64 ]# yum remove ksh ]# wget ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/os/x86_64/WhiteBox/RPMS/pdksh-5.2.14-30.x86_64.rpm ]# yum localinstall pdksh-5.2.14-30.x86_64.rpm |
OFA 디렉토리 생성
|
1 2 3 |
mkdir -p /u01/app/oracle/product/11.2.0/db_1 mkdir -p /u01/app/oraInventory chown oracle:oinstall -R /u01 |
sysctl.conf
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
fs.aio-max-nr = 1048576 # It is recommended to have a minimum of 256 as value for every 4MB of RAM you have. # So for 8GB RAM = 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 least 4096, # it says that we cannot find more than 4096 number of shared memory segments at any instance on the server. # Note that SHMMNI value is in numbers. # # No change it should be 4096. It must be increased if you 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. # For DBA'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's perform 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. For DBA'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. # By default the page size on Linux is 4KB. The total size of RAM is 8GB. Let us leave at least 1GB of RAM for Linux kernel to run, with which consider 7GB can be used for Oracle Databases. Now value of SHMALL can be: # # (7*1024*1024)KB/4KB = 1835008 kernel.shmall = 95325 kernel.sem = 250 32000 100 128 # This parameter defines the range of port numbers that system can use for programs which want to connect to the server without a specific port number. # # Now, it makes sense if you have come across somebody advising you not to use port numbers for listener beyond 9000. Also, just look back to documents on OEM installation, Oracle uses and advises all the default port numbers less than 9000. net.ipv4.ip_local_port_range = 9000 65500 # 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. net.core.wmem_default = 262144 net.core.wmem_max = 1048586 |
/etc/security/limits.conf
|
1 2 3 4 5 6 7 |
# http://www.tecmint.com/setting-up-prerequisites-for-oracle-12c-installation/ oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 |
/etc/security/limits.d/90-nproc.conf
|
1 2 |
* - nproc 16384 root soft nproc unlimited |
/etc/pam.d/login
|
1 |
session required pam_limits.so |
/etc/oraInst.loc
|
1 2 3 4 5 6 |
]# vim /etc/oraInst.loc inventory_loc=/u01/app/oraInventory inst_group=oinstall ]# chown oracle:oinstall /etc/oraInst.loc ]# chmod 664 /etc/oraInst.loc |
oracle 계정으로 로그인 한후에 Oracle 11gR2 바이너리 설치 […]
Oracle 12c 설치
Oracle 12c 설치 Silent Installation 방식이며 OFA(Optimal Flexible Architecture) 를 따른다. 환경 CentOS 7 64bit Memory 8GB Swap 16GB (Swap must be enabled double the size of RAM) Storage Size 40GB 호스트네임 변경
|
1 2 3 4 |
hostnamectl set-hostname oraserv1 hostnamectl set-hostname oraserv1 --static hostnamectl set-hostname "Server1 of Oracle Database" --pretty hostnamectl set-hostname oraserv1 --transient |
계정생성
|
1 2 3 4 5 6 7 8 9 10 11 |
groupadd -g 500 oinstall groupadd -g 501 dba groupadd -g 502 oper groupadd -g 503 backupdba groupadd -g 504 dgdba groupadd -g 505 kmdba groupadd -g 506 asmdba groupadd -g 507 asmoper groupadd -g 508 asmadmin useradd -u 500 -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle |
의존성 패키지 설치
|
1 |
yum install compat-libcap1-1.10 compat-libstdc++-* libstdc++-devel-* sysstat-10.1.5* gcc-4.* gcc-c++-4.* ksh* glibc-devel-* libaio-* libaio-devel-* |
OFA 디렉토리 생성
|
1 2 3 |
mkdir -p /u01/app/oracle/product/12.1.0.2/db_1 mkdir -p /u01/app/oraInventory chown oracle:oinstall -R /u01 |
sysctl.conf
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
fs.aio-max-nr = 1048576 # It is recommended to have a minimum of 256 as value for every 4MB of RAM you have. # So for 8GB RAM = 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 least 4096, # it says that we cannot find more than 4096 number of shared memory segments at any instance on the server. # Note that SHMMNI value is in numbers. # # No change it should be 4096. It must be increased if you 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. # For DBA'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's perform 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. For DBA'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. # By default the page size on Linux is 4KB. The total size of RAM is 8GB. Let us leave at least 1GB of RAM for Linux kernel to run, with which consider 7GB can be used for Oracle Databases. Now value of SHMALL can be: # # (7*1024*1024)KB/4KB = 1835008 kernel.shmall = 1835008 kernel.sem = 250 32000 100 128 # This parameter defines the range of port numbers that system can use for programs which want to connect to the server without a specific port number. # # Now, it makes sense if you have come across somebody advising you not to use port numbers for listener beyond 9000. Also, just look back to documents on OEM installation, Oracle uses and advises all the default port numbers less than 9000. net.ipv4.ip_local_port_range = 9000 65500 # 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. net.core.wmem_default = 262144 net.core.wmem_max = 1048586 |
/etc/security/limits.conf
|
1 2 3 4 5 6 7 |
# http://www.tecmint.com/setting-up-prerequisites-for-oracle-12c-installation/ oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 |
/etc/security/limits.d/20-nproc.conf
|
1 2 |
* - nproc 16384 root soft nproc unlimited |
/etc/oraInst.loc
|
1 2 3 4 5 6 |
]# vim /etc/oraInst.loc inventory_loc=/u01/app/oraInventory inst_group=oinstall ]# chown oracle:oinstall /etc/oraInst.loc ]# chmod 664 /etc/oraInst.loc |
oracle 계정으로 로그인 한후에 Oracle 12c 바이너리 설치 파일을 다음과 같이 압축 해제.
|
1 2 3 4 5 |
]$ mkdir -p orainst/12.1.0.2 ]$ cp *.zip orainst/12.1.0.2/ ]$ cd orainst/12.1.0.2 ]$ unzip linuxamd64_12102_database_1of2.zip ]$ unzip linuxamd64_12102_database_2of2.zip |
Silent 설치를 위한 파일 작성 […]
Mac 에서 JAVA_HOME 찾기
참조: http://stackoverflow.com/questions/6588390/where-is-java-home-on-osx-sierra-10-12-el-captain-10-11-yosemite-10-10 Mac 에는 여러버전의 Java 가 설치되어 있습니다. 그런데, 가끔씩 JAVA_HOME 이 어디인지를 알고 싶을때가 있습니다. 그럴때 다음과 같이 하면 알수 있습니다.
|
1 2 3 4 5 |
export JAVA_HOME="$(/usr/libexec/java_home -v 1.6)" or export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)" or export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" |
WebLogic 서버 복제하기
이 문서는 WebLogic 서버 복제하기에 대한 문서 입니다. WebLogic 버는 여러서버에 걸쳐서 설치가 되고 이들을 한대로 묶어 하나처럼 동작하도록 할 수 있습니다. 이를 위해서는 모든 서버의 설치버전과 환경설정등이 모두 동일 해야 합니다. 만일 WebLogic 서버가 10대 정도라고 하면 10대 서버 모두 새롭게 설치하는 절차를 거쳐서 만들어야 합니다. 그리고 모두 설정을 같게 해줘야 한다. 그런데 사람은 언제나 실수를 할 수가 있어 잠제적인 장애요소를 남기게 됩니다. 이럴때 필요한 것이 1대 서버에 설치를 하고 설치되고 설정이 모두 된 WebLogic 10.3.6 서버를 다른 서버에 […]
Weblogic 10.3.6 Node Manager 사용하기
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 […]
WebLogic 구동 시 /dev/random 블로킹 이슈 해결
WebLogic 10.3.6 을 설치할때에 관리 서버 1개와 매니지드 서버 1개를 생성하게 됩니다. 그런데, 서버 시작 스크립트에서 난수 관련된 것을 고치지 않으면 시작이 굉장히 오래 걸립니다. 이는 Unix 시스템의 경우에 /dev/random 을 사용하지 않고 /dev/./urandom 을 사용하기 때문입니다. 이를 해결하는 방법은 두가지 인데, 첫번째로는 Java 의 Security 부분을 바꿔 주는 겁니다. 그러면 Java 를 사용하는 모든 자바 프로그램에 다 적용 됩니다. 다음과 같이 해줍니다.
|
1 2 3 |
]# vim $JAVA_HOME/jre/lib/security/java.security - 70 securerandom.source=file:/dev/urandom + 70 securerandom.source=file:/dev/./urandom |
이렇게 해주고 서버를 재시작 하면 적용 됩니다. 두번째는 Java 애플리케이션을 실행할 때에 JVM Command Line 파라메터를 […]
WebLogic 10.3.6 설치하기 – GUI
이 문서는 WebLogic 10.3.6 설치하기 중에 GUI 를 이용한 방법에 관한 것 입니다. 지난번 글에서 “Server Only” 설치 실패후에 jar 파일을 이용한 설치를 기반으로 합니다. 환경 설치 환경에 대해서 먼저 설명을 해야할 필요가 있습니다. 설치 환경은 다음과 같습니다. JDK 1.7 Lastest Release Ubuntu 14.04 64bit WebLogic 10.3.6 – wls1036_generic.jar 설치 계정은 일반계정 입니다. 설치 방법은 GUI 입니다. 위와 같은 환경 입니다. 설치 파일 WebLogic 은 설치 방법이 어떤 패키지를 가지고 설치를 하느냐에 따라 다릅니다. 이 문서에서의 설치는 다음과 같은 것을 이용 […]