大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Solaris 10(x86)构建Oracle 11gR2 RAC之--配置系统环境(1)
创新互联专业为企业提供东山网站建设、东山做网站、东山网站设计、东山网站制作等企业网站建设、网页设计与制作、东山企业网站模板建站服务,10多年东山做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
系统环境:
操作系统:Solaris 10(x86-64)
Cluster: Oracle GRID 11.2.0
Oracle: Oracle 11.2.0.1.0
如图所示:RAC 系统架构
对于Oracle 11G构建RAC首先需要构建GI(Grid Infrastructure)的架构
Oracle 11g第二版在新功能上与第一版有了很大的改进,这里把本次安装用到的新功能简单介绍一下,其中主要是把Clusterware 集群件集成到了Grid网格组件中,并且添加了Grid Naming Service(GNS)网格名称服务提供名称转换,这样两个RAC节点的虚拟IP地址(VIP)可以通过DHCP自动获取,不需要手工指定了,这是变化比较大的一点;
还有Cluster Time Synchronization Service(CTSS)集群时间同步服务,在没有NTP服务时,该功能可以保证所有RAC节点的时间保持一致;ASM可以作为统一的存储把Oracle Cluster Registry(OCR)和Voting disks统一安装在ASM磁盘上,不再需要单独安装集群文件系统了,11g第二版也不再支持裸设备了(之前可以把集群件安装到裸设备上);
还有一个有趣的功能SCAN(Single Client Access Name)即单客户端访问名称而且该功能包括了Failover故障自动切换功能,在访问集群是只写一个SCAN名称就可以了,不需要象以前要把所有节点的VIP写在应用程序的配置文件里面了,这样就大大方便了客户端程序对RAC系统的访问,但该功能需要DNS服务器的支持,这个功能本文中会重点介绍因为我是一个应用程序员感觉这是一个最好的新功能,在用Spring框架连接RAC系统时也非常方便;还有一些新特性如
Automatic Storage Management Cluster File System(ACFS) ASM集群文件系统和Intelligent Platform. Management Interface(IPMI)集成等。
本案例,通过Solairs 10(x86-64)系统,构建Oracle 11g 的RAC;共享存储采用RAW+ASM的方式进行管理。
一、系统环境配置 (在所有node)
1、操作系统:
[root@node1:/]# uname -a SunOS node1 5.10 Generic_142910-17 i86pc i386 i86pc [root@node1:/]# isainfo -kv 64-bit amd64 kernel modules
2、网络配置:
[root@node1:/]# cat /etc/hosts # # Internet host table # ::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost 192.168.8.13 node1-vip 10.10.10.11 node1-priv 192.168.8.12 node2 192.168.8.14 node2-vip 10.10.10.12 node2-priv 192.168.8.15 scan-ip ---本案例为测试环境,没有配置DNS Server;对于SCAN ip采用hosts文件解析 网卡配置信息: [root@node1:/]# ifconfig -a lo0: flags=2001000849mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 mtu 1500 index 2 inet 192.168.8.11 netmask ffffff00 broadcast 192.168.8.255 ether 8:0:27:e9:13:c7 e1000g0:1: flags=1000843 mtu 1500 index 2 inet 192.168.8.13 netmask ffffff00 broadcast 192.168.8.255 e1000g1: flags=1000843 mtu 1500 index 3 inet 10.10.10.11 netmask ffffff00 broadcast 10.10.10.255 ether 8:0:27:54:d5:2c [root@node2:/]# ifconfig -a lo0: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 mtu 1500 index 2 inet 192.168.8.12 netmask ffffff00 broadcast 192.168.8.255 ether 8:0:27:9f:cd:76 e1000g0:1: flags=1000843 mtu 1500 index 2 inet 192.168.8.14 netmask ffffff00 broadcast 192.168.8.255 e1000g1: flags=1000843 mtu 1500 index 3 inet 10.10.10.12 netmask ffffff00 broadcast 10.10.10.255 ether 8:0:27:3c:6d:ce
3、 建立oracle、grid用户和组:
[root@node1:/]# cat mkusr.sh groupadd -g 200 oinstall groupadd -g 201 dba groupadd -g 202 oper groupadd -g 203 asmadmin groupadd -g 204 asmoper groupadd -g 205 asmdba useradd -u 200 -g oinstall -G dba,asmdba,oper -d /export/home/oracle -m -s /usr/bin/bash oracle useradd -u 201 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba -d /export/home/grid -m -s /usr/bin/bash grid [root@node1:/]# id -a oracle uid=200(oracle) gid=200(oinstall) groups=201(dba),202(oper),205(asmdba) [root@node1:/]# id -a grid uid=201(grid) gid=200(oinstall) groups=201(dba),202(oper),203(asmadmin),204(asmoper),205(asmdba)
4、建立相应安装目录:
[root@node1:/]# cat mkdir.sh mkdir -p /export/home/oraInventory chown -R grid:oinstall /export/home/oraInventory/ chmod -R 775 /export/home/oraInventory/ mkdir -p /export/home/11.2.0/grid chown -R grid:oinstall /export/home/11.2.0/grid/ chmod -R 775 /export/home/11.2.0/grid/ mkdir -p /export/home/ora11 mkdir -p /export/home/ora11/cfgtoollogs mkdir -p /export/home/ora11/product/11.2.0/db_1 chown -R oracle:oinstall /export/home/ora11 chmod -R 775 /export/home/ora11 [root@node1:/]# ls -l /export/home total 26 drwxr-xr-x 3 root root 512 Jan 22 16:18 11.2.0 drwxr-xr-x 2 grid oinstall 512 Jan 22 16:10 grid drwx------ 2 root root 8192 Oct 15 2013 lost+found drwxrwxr-x 4 oracle oinstall 512 Jan 22 16:18 ora11 drwxrwxr-x 2 grid oinstall 512 Jan 22 16:18 oraInventory drwxr-xr-x 2 oracle oinstall 512 Jan 22 16:11 oracle
5、建立oracle、grid用户环境变量:
[oracle@node1:/export/home/oracle]$ cat .profile export EDITOR=vi export ORACLE_SID=prod1 ;; ORACLE_SID=prod2 (node2) export ORACLE_BASE=/export/home/ora11 export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin umask 022 [grid@node1:/export/home/grid]$ cat .profile export EDITOR=vi export ORACLE_SID=+ASM1 ;;ORACLE_SID=+ASM2 (node2) export ORACLE_BASE=/export/home/ora11 export ORACLE_HOME=/export/home/11.2.0/grid export GRID_HOME=/export/home/11.2.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib export THREADS_FLAG=native export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin umask 022
6、配置网络参数(用于cache fusion)
检查网络参数: [root@node1:/]# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port 32768 65535 [root@node1:/]# cat mknet.sh /usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 9000 /usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65500 /usr/sbin/ndd -set /dev/udp udp_smallest_anon_port 9000 /usr/sbin/ndd -set /dev/udp udp_largest_anon_port 65500 [root@node1:/]# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port 9000 65500
7、修改内核参数:
[root@node2:/]# cat /etc/system set noexec_user_stack=1 set semsys:seminfo_semmni=100 set semsys:seminfo_semmns=1024 set semsys:seminfo_semmsl=256 set semsys:seminfo_semvmx=32767 set shmsys:shminfo_shmmax=4294967295 set shmsys:shminfo_shmmni=100
8、配置shell资源访问:
[root@node1:/]# cat /etc/profile ulimit -t unlimited ulimit -f unlimited ulimit -d unlimited ulimit -s unlimited ulimit -n unlimited ulimit -v unlimited
二、配置共享存储
对于Oracle 11g RAC,在共享存储中OCR和VOTE磁盘,不能再采用裸设备,而都是通过ASM磁盘组进行管理。 OCR和VOTE磁盘:(建立ASM NORMAL REDUNDANCY) OCR_VOTE DISK1 /dev/rdsk/c0t2d0s0 OCR_VOTE DISK1 /dev/rdsk/c0t2d0s1 OCR_VOTE DISK1 /dev/rdsk/c0t2d0s3 DataBase磁盘:(建立ASM NORMAL REDUNDANCY) ASM_DATA1 /dev/rdsk/c0t2d0s4 ASM_DATA2 /dev/rdsk/c0t2d0s5 RECOVERY AREA:(建立ASM NORMAL REDUNDANCY) ASM_RCY1 /dev/rdsk/c0t2d0s6 ASM_RCY1 /dev/rdsk/c0t2d0s7
1、建立磁盘分区(raw)(在node1)
注意:
在分区时,不能从Cylinder 0开始,而应该从Cylinder 1开始,进行分区,建立raw设备。
[root@node1:/]# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0/pci@0,0/pci8086,2829@d/disk@0,0 1. c0t2d0 /pci@0,0/pci8086,2829@d/disk@2,0 Specify disk (enter its number): 1 selecting c0t2d0 [disk formatted] format> p WARNING - This disk may be in use by an application that has modified the fdisk table. Ensure that this disk is not currently in use before proceeding to use fdisk. format> fdisk No fdisk table exists. The default partition for the disk is: a 100% "SOLARIS System" partition Type "y" to accept the default partition, otherwise type "n" to edit the partition table. y partition> 0 Part Tag Flag Cylinders Size Blocks 0 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 1 Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1024mb partition> 1 Part Tag Flag Cylinders Size Blocks 1 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 132 Enter partition size[0b, 0c, 132e, 0.00mb, 0.00gb]: 1024mb partition> 3 Part Tag Flag Cylinders Size Blocks 3 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 263 Enter partition size[0b, 0c, 263e, 0.00mb, 0.00gb]: 1024mb partition> 4 Part Tag Flag Cylinders Size Blocks 4 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 394 Enter partition size[0b, 0c, 394e, 0.00mb, 0.00gb]: 5gb partition> 5 Part Tag Flag Cylinders Size Blocks 5 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 1047 Enter partition size[0b, 0c, 1047e, 0.00mb, 0.00gb]: 5gb partition> 5 Part Tag Flag Cylinders Size Blocks 5 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 1047 Enter partition size[0b, 0c, 1047e, 0.00mb, 0.00gb]: 5gb partition> 6 Part Tag Flag Cylinders Size Blocks 6 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 1700 Enter partition size[0b, 0c, 1700e, 0.00mb, 0.00gb]: 3gb partition> 7 Part Tag Flag Cylinders Size Blocks 7 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 2092 Enter partition size[0b, 0c, 2092e, 0.00mb, 0.00gb]: 3gb partition> p Current partition table (unnamed): Total disk cylinders available: 2607 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 1 - 131 1.00GB (131/0/0) 2104515 1 unassigned wm 132 - 262 1.00GB (131/0/0) 2104515 2 backup wu 0 - 2606 19.97GB (2607/0/0) 41881455 3 unassigned wm 263 - 393 1.00GB (131/0/0) 2104515 4 unassigned wm 394 - 1046 5.00GB (653/0/0) 10490445 5 unassigned wm 1047 - 1699 5.00GB (653/0/0) 10490445 6 unassigned wm 1700 - 2091 3.00GB (392/0/0) 6297480 7 unassigned wm 2092 - 2483 3.00GB (392/0/0) 6297480 8 boot wu 0 - 0 7.84MB (1/0/0) 16065 9 unassigned wm 0 0 (0/0/0) 0 partition> label Ready to label disk, continue? y partition> quit 在node2查看磁盘分区信息: [root@node2:/]# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 /pci@0,0/pci8086,2829@d/disk@0,0 1. c0t2d0 /pci@0,0/pci8086,2829@d/disk@2,0 Specify disk (enter its number): 1 selecting c0t2d0 [disk formatted] ...... partition> p Current partition table (original): Total disk cylinders available: 2607 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 1 - 131 1.00GB (131/0/0) 2104515 1 unassigned wm 132 - 262 1.00GB (131/0/0) 2104515 2 backup wu 0 - 2606 19.97GB (2607/0/0) 41881455 3 unassigned wm 263 - 393 1.00GB (131/0/0) 2104515 4 unassigned wm 394 - 1046 5.00GB (653/0/0) 10490445 5 unassigned wm 1047 - 1699 5.00GB (653/0/0) 10490445 6 unassigned wm 1700 - 2091 3.00GB (392/0/0) 6297480 7 unassigned wm 2092 - 2483 3.00GB (392/0/0) 6297480 8 boot wu 0 - 0 7.84MB (1/0/0) 16065 9 unassigned wm 0 0 (0/0/0) 0 修改raw设备属性(所有node): [root@node1:/]# chown grid:asmadmin /dev/rdsk/c0t2d0s* [root@node1:/]# chmod 660 /dev/rdsk/c0t2d0s* [root@node1:/]# ls -l /devices/pci@0,0/pci8086,2829@d/disk@2,0:a,raw crw-rw---- 1 grid asmadmin 30, 128 Jan 22 17:31 /devices/pci@0,0/pci8086,2829@d/disk@2,0:a,raw
---未完待续.....