Vmware 및 리눅스 설정 2
- 디스크가 제대로 설정될 경우 아래와 같은 형태로 보여집니다.
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 637 5116671 83 Linux /dev/sda2 638 3059 19454715 83 Linux /dev/sda3 3060 3824 6144862+ 82 Linux swap / Solaris
Disk /dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdc: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdd: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sde: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdf: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdg: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System [root@rac1 ~]# |
Network 설정
[root@rac1 ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost
#public IP 192.168.22.101 rac1 192.168.22.102 rac2
#Private IP 10.10.10.1 rac1-priv 10.10.10.1 rac2-priv
#VIP 192.168.22.201 rac1-vip 192.168.22.202 rac2-vip
#ScanIP 192.168.22.100 rac-scanip
#service network restart --재설정 |
- /etc/hosts 작성시 주의사항
- 방화벽문제 + /etc/hosts 127.0.0.1 localhost.~ , hostname 문제(대문자X, -, _ X 사용금지)
[인터넷 연결 확인]
[root@rac1 ~]# ping www.yahoo.com PING ds-kr-fp3.wg1.b.yahoo.com (106.10.170.118) 56(84) bytes of data. 64 bytes from ir1.fp.vip.sg3.yahoo.com (106.10.170.118): icmp_seq=1 ttl=128 time=214 ms 64 bytes from ir1.fp.vip.sg3.yahoo.com (106.10.170.118): icmp_seq=2 ttl=128 time=240 ms 64 bytes from ir1.fp.vip.sg3.yahoo.com (106.10.170.118): icmp_seq=3 ttl=128 time=143 ms |
[기타사항]
-vmware의 경우 IP 설정시, Vmware Network와 설치된 OS 서버의 Network 구성을 맞추어 주셔야합니다.
- 사용 되는 IP 대역 및 Subnet mask확인 및 게이트웨이 설정
- 설정된 게이트웨이 확인
[설정]
Oracle 설치를 위한 OS 설정 변경
- 불필요한 서비스 제거
chkconfig --level 123456 xinetd off chkconfig --level 123456 sendmail off chkconfig --level 123456 cups off chkconfig --level 123456 cups-config-daemon off chkconfig --level 123456 smartd off chkconfig --level 123456 isdn off chkconfig --level 123456 iptables off |
- RAC 구동시 불필요한 서비스 제거(TEST DB를 구축하기 위함)
[주의]
- 해당 내역은 실 운영적용시에는 절대 사용되어서는 안됩니다.
- OS 파라미터 세팅(Root 유저)
# vi /etc/sysctl.conf
kernel.shmmni= 4096 kernel.sem= 250 32000 100 128 net.ipv4.ip_local_port_range= 9000 65500 net.core.wmem_max= 1048576 net.core.rmem_default= 4194304 net.core.rmem_max= 4194304 net.core.wmem_default= 262144 fs.file-max= 6815744 fs.aio-max-nr= 1048576
#sysctl -p --적용 |
# vi /etc/security/limits.conf
gridsoft nproc 2047 gridhard nproc 16384 gridsoft nofile 1024 gridhard nofile 65536 oraclesoft nproc 2047 oraclehard nproc 16384 oraclesoft nofile 1024 oraclehard nofile 65536 |
# vi /etc/pam.d/login
session required pam_limits.so |
# vi /etc/modprobe.conf optionshangcheck-timer hangcheck_tick=30 hangcheck_margin=180
# modprobe -v hangcheck-timer --적용 -> 커널 기반 타이머를 사용, 시스템 테스크 스케줄러에 발생하는 딜레이를 정기적으로 정검하는 방식으로 시스템 상태 확인기능
# vi /etc/rc.local /sbin/modprobehangcheck-timer rdate-s 203.248.240.140 |
[OS 설치시 System Tool 추가 설치]
[root@rac1 home]# rpm -qa|grep oracleasm* oracleasm-support-2.1.3-1.el5 oracleasm-2.6.18-194.el5xen-2.0.5-1.el5 oracleasm-2.6.18-194.el5PAE-2.0.5-1.el5 oracleasmlib-2.0.4-1.el5 oracleasm-2.6.18-194.el5debug-2.0.5-1.el5 oracleasm-2.6.18-194.el5-2.0.5-1.el5 [root@rac1 home]#
[root@rac1 home]# rpm -qa|grep sysstat* sysstat-7.0.2-3.el5
[root@rac1 rpm]# rpm -qa|grep libaio-devel* libaio-devel-0.3.106-5 [root@rac1 rpm]# rpm -qa|grep unixODBC* unixODBC-devel-2.2.11-7.1 unixODBC-2.2.11-7.1 unixODBC-kde-2.2.11-7.1
[출처: http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html] [root@rac1 home]# rpm -qa|grep oracleasmlib* oracleasmlib-2.0.4-1.el5
[p10098816_112020_LINUX_3of7.zip 압축해제 이후 /rpm 폴더확인] [root@rac1 rpm]# rpm -qa|grep cvuqdisk cvuqdisk-1.0.9-1 |
# vi /etc/sysconfig/ntpd " -x " 추가
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
# service ntpd restart --적용 |
#setup |
|
유저, 그룹, 디렉토리 생성
- 유저 및 그룹 생성
# groupadd -g 500 dba # useradd -g dba oracle # useradd -g dba grid # passwd oracle # passwd grid |
- ORACLE_HOME 및 GRID_HOME(해당 디렉토리 위치는 사용자지정)
Mkdir /home/ora_SW/grid/11.2.0.3 |
Mkdir /home/ora_SW/oracle/11.2.0.3 |
Chmod -R 755 /home/ora_SW |
# vi ~/.bash_profile
exportGRID_HOME=/u01/app/11.2.0/grid exportPATH=$PATH:$HOME/bin:$GRID_HOME/bin |
- Grid 유저(bash_profile)
export PATH
export PATH export GRID_BASE=/home/grid #export GRID_HOME=/home/ora_SW/oracle/11.2.0.3 export ORACLE_SID=+ASM1 export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:$PATH export LD_LIBRARY_PATH=$GRID_HOME/lib:/lib:/usr/lib export ORACLE_HOME=/home/ora_SW/grid/11.2.0.3 export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib #export DISPLAY=192.168.*.*:0.0 export LANG=C
export EDITOR=vi export PS1='`hostname -s`@$ORACLE_SID : $PWD> '
[주의사항] GRID_HOME의 경우, ORACLE_HOME에 명시해주어야 ASMCMD 수행시 문제 없이 정상작동가능 |
- Oracle 유저(bash_profile)
export PATH
export PATH export ORACLE_BASE=/home/ora_SW/oracle export ORACLE_HOME=$ORACLE_BASE/11.2.0.3 export ORACLE_SID=RAC1 export ORACLE_UNQNAME=RAC export ORACLE_TERM=xterm export NLS_LANG=American_America.UTF8 export GRID_HOME=/home/grid/11.2.0.3 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib #export DISPLAY=192.168.6.17:0.0 export LANG=C
umask 022
export EDITOR=vi export PS1='`hostname -s`@$ORACLE_SID : $PWD> ' |
- 2번 노드의 경우 ORACLE_SID만 변경해주면 됩니다.
ASMDISK 설정
- 파티션 분할
- 아래와 같은 방식으로 추가한 Disk 파티션 분할
# fdisk /dev/sdb
Command (m for help): help h: unknown command Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)
Command(m for help): n Commandaction e extended p primary partition (1-4) p Partitionnumber (1-4): 1 Firstcylinder (1-130, default 1):엔터 Usingdefault value 1 Lastcylinder or +size or +sizeM or +sizeK (1-130, default 130):엔터 Usingdefault value 130 Command(m for help): w Thepartition table has been altered!
Callingioctl() to re-read partition table. Syncingdisks. |
[root@rac1 11.2.0.3]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 637 5116671 83 Linux /dev/sda2 638 3059 19454715 83 Linux /dev/sda3 3060 3824 6144862+ 82 Linux swap / Solaris
Disk /dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdb1 1 130 1044193+ 83 Linux
Disk /dev/sdc: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdc1 1 130 1044193+ 83 Linux
Disk /dev/sdd: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdd1 1 130 1044193+ 83 Linux
Disk /dev/sde: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sde1 1 652 5237158+ 83 Linux
Disk /dev/sdf: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdf1 1 652 5237158+ 83 Linux
Disk /dev/sdg: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sdg1 1 652 5237158+ 83 Linux [root@rac1 11.2.0.3]# |
- Oracle ASM 구성
# oracleasm configure -i
[root@rac1 ~]# oracleasm configure -i Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). Hitting <ENTER> without typing an answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface [grid]: Default group to own the driver interface [dba]: Start Oracle ASM library driver on boot (y/n) [y]: Scan for Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration: done [root@rac1 ~]#
# oracleasm init
[주의사항] 유저를 2개로 나누어서 설치할 경우, ASM 구성시 관리하는 Grid 유저로 권한을 부여해야 합니다. |
- Oracleasm disk create
# oracleasm create disk OCR_VOTE01 /dev/sdb1 # oracleasm create disk OCR_VOTE02 /dev/sdc1 # oracleasm create disk OCR_VOTE01 /dev/sdd1 # oracleasm create disk ASMDISK01 /dev/sde1 # oracleasm create disk ASMDISK02 /dev/sdf1 # oracleasm create disk ASMDISK03 /dev/sdg1 |
-Disk 스캔 # oracleasm scandisks -생성리스트 확인 # oracleasm listdisks
#chown -R gird.dba /dev/oracleasm
[주의사항] 설치 시 사용되는 유저가 2개일 경우, /dev/oracleasm의 경우 ASM에 대한 권한을 가지고 있는 Grid 유저 권한으로 적용해야 합니다. |
- 해당 서버를 종료시킨 이후에, 2번노드 설정을 해야되기 때문에 OS Shutdown을 실행합니다.
# init 0 |
- 1번 노드 설정이 완료
노드 2번 세팅
- 해당 2개의 파일을 노드2를 설정하기 위해 복사합니다.
- 복사된 내용을 가지고 Vmware에 동작시킨 뒤, 기존의 Vmware 명을 변경해줍니다.
[주의사항]
- RAC 노드2 작업시에 기존의 RAC 노드1은 반드시 shutdown 상태이어야 합니다(Network 충돌로 인한 에러가 발생할 수 있음)
- RAC 노드2를 동작시 반드시 "I copied it" 을 선택 후, 진행해야 합니다.
5-1 network 재설정
[root@rac2 ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost
#public IP 192.168.22.101 rac1 192.168.22.102 rac2
#Private IP 10.10.10.1 rac1-priv 10.10.10.1 rac2-priv
#VIP 192.168.22.201 rac1-vip 192.168.22.202 rac2-vip
#ScanIP 192.168.22.100 rac-scanip
#service network restart --재설정 |
5-2
Grid 유저 및 Orcale 유저 ORACLE_SID 변경(.bash_profile)
- 각 노드설정이 완료되고, 2개의 노드를 동작시켜서 Network TEST 및 정상동작여부 확인필요
- public IP와 Private IP가 정상적으로 각 노드에 Ping이 들어가는지 확인이 필요합니다.
Ssh, user equivalence설정
- 수동설정
#Node1과 Node2 통신시 Passwd 묻지 않게..
각각의 node 에서 grid/oracle 유저로 접속을 하고.. (1,2번 노드에서 실행)
$ ssh-keygen -t rsa $ ssh-keygen -t dsa
(1번노드에서만 실행) $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys $ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
차례대로 실행해서 yes ? node2 password 를 입력하면 완료 된다. 작성된 인증키파일을 node2 에 복사해주면 완료 된다.
$ scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
확인 (1,2번 노드 모두)
아래 명령으로 테스를 해보면.. (최초 실행시에는 password를 묻는다..) Password 를 물어보지 않으면 설정이 제대로 된거임 $ ssh rac1 date $ ssh rac1-priv date $ ssh rac2 date $ ssh rac2-priv date |
- 자동 스크립트 설정
-> grid 설치 media에 sshsetup 폴더에 있는 스크립트 사용 -> 유저가 2개일 경우(grid / oracle), 각 유저로 로그인하여 해당 스크립트를 동작 /sshsetup]# ./sshUserSetup.sh -user grid -hosts "rac1 rac2" -noPromptPassphrase -advanced -exverify /sshsetup]# ./sshUserSetup.sh -user oracle -hosts "rac1 rac2" -noPromptPassphrase -advanced -exverify |
[참고문헌]
http://www.allsoft.co.kr/bbs/board.php?bo_table=study91_2&wr_id=30
http://blog.naver.com/jjuneye?Redirect=Log&logNo=110152112359
http://estenpark.tistory.com/284
http://www.oracle.com/pls/db112/homepage
'1. IT Story > DB' 카테고리의 다른 글
Big-Data Hadoop 환경구성 (0) | 2013.02.09 |
---|---|
Big-Data Hadoop기초 (0) | 2013.02.09 |
Oracle RAC 11.2.0.3 with ASM / Vmware Oracle DB 설치 (0) | 2013.02.09 |
Oracle RAC 11.2.0.3 with ASM / Vmware-Oracle 엔진 설치 및 ASM 구성 (0) | 2013.02.09 |
Oracle RAC 11.2.0.3 with ASM / Vmware-리눅스 설정1 (0) | 2013.02.09 |
Oracle RAC 11.2.0.3 with ASM / Vmware-사전준비사항 (0) | 2013.02.09 |
HOT backup and archive를 이용한 recovery (0) | 2012.06.02 |
Oracle 10g Install -> Upgrade(10.2.0.4) -> DB설치(DBCA) -> Upgrad(10.2.0.5) [RHEL5] (0) | 2012.03.26 |