单节点配置虚拟机
二、安装虚拟机
此处虚拟机选用VMwareServerv1.0.5Build80187.exe
安装vmtool
点击vm选择install vmware tools==>install
系统提示警告:
引用
WARNING:You cannot install the VMware Tools package until the guest operating system is running.If your guest operating system is not running,choose Cancel
and install the VMware tools package later.
配置hosts文件
引用
[iyunv@mcrac1 ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
172.16.4.81 mcrac1
172.16.4.82 mcrac1_vip
192.168.0.10 mcrac1_priv
172.16.4.83 mcrac2
172.16.4.84 mcrac2_vip
192.168.0.11 mcrac2_priv
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 []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
创建asm磁盘出现以下问题:
引用
[iyunv@mcrac1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [FAILED]
[iyunv@mcrac1 ~]# tail -f /var/log/oracleasm
Writing disk header: oracleasm-write-label: Unable to clear device "/dev/sdc1": No space left on device
failed
Unable to label device "/dev/sdc1"
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Disk "VOL1" does not exist or is not instantiated
Writing disk header: oracleasm-write-label: Unable to clear device "/dev/sdc1": No space left on device
failed
Unable to label device "/dev/sdc1"
解决办法:
重新划分pdisk将扩展分区变为主分区
引用
[iyunv@mcrac1 raw]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [ OK ]
[iyunv@mcrac1 raw]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "VOL2" as an ASM disk: [ OK ]
[iyunv@mcrac1 raw]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [ OK ]
配置raw设备
引用
[iyunv@mcrac1 ~]# cat /etc/sysconfig/rawdevices
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdc1
/dev/raw/raw2 /dev/sdd1
/dev/raw/raw3 /dev/sde1
[iyunv@mcrac1 ~]# /sbin/service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdc1
/dev/raw/raw1: bound to major 8, minor 32
/dev/raw/raw2 --> /dev/sdd1
/dev/raw/raw2: bound to major 8, minor 48
/dev/raw/raw3 --> /dev/sde1
/dev/raw/raw3: bound to major 8, minor 64
done
[iyunv@mcrac1 raw]# chown oracle:dba *
[iyunv@mcrac1 raw]# ls -rtl
total 0
crw-rw---- 1 oracle dba 162, 1 Mar 30 12:25 raw1
crw-rw---- 1 oracle dba 162, 2 Mar 30 12:25 raw2
crw-rw---- 1 oracle dba 162, 3 Mar 30 12:25 raw3
Configure Nodes --> Add --> 输入NODE名和IP --> OK --> Apply
出现如下错误:
引用
o2cb_ctl: Unable to access cluster service while creating node
Could not add node node1
双节点cluster.conf文件显示
引用
[iyunv@mcrac1 ocfs2]# more cluster.conf
node:
ip_port = 7777
ip_address = 172.16.4.81
number = 0
name = mcrac1
cluster = ocfs2
node:
ip_port = 7777
ip_address = 172.16.4.83
number = 1
name = mcrac2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
双节点执行
引用
[iyunv@mcrac1 ocfs2]# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
引用
[iyunv@mcrac1 ocfs2]# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets ('[]'). Hitting
<ENTER> without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [31]: 61
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
引用
[iyunv@mcrac1 ocfs2]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2
二节点mount
引用
root@mcrac2 ocfs2]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2
ocfs2_hb_ctl: Bad magic number in inode while reading uuid
mount.ocfs2: Error when attempting to run /sbin/ocfs2_hb_ctl: "Operation not permitted"
[iyunv@mcrac2 ocfs2]# mounted.ocfs2 -f
Device FS Nodes
/dev/sdb1 ocfs2 Unknown: Bad magic number in inode
解决办法:
经过检查发现,这个问题是由于在为虚拟机创建磁盘的时候没有选择“allocate all disk space now”,导致ocfs在加入第二个节点时出错,关掉虚拟机删除该磁盘,重新创建一个立即分配空间的盘再格式化,两个节点都能正常mount了。
The root.sh script on rac2 invoked the VIPCA automatically but it failed with the error "The
given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs."
As you are using a non-routable IP address (192.168.x.x) for the public interface, the Oracle
Cluster Verification Utility (CVU) could not find a suitable public interface. A workaround is to
run VIPCA manually.
十四、安装数据库
二节点启动ASM实例报错
引用
SQL> startup
ASM instance started
Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficientnumber of disks for diskgroup
"DATADG
后台alert日志显示
引用
Wed Mar 31 10:30:39 2010
SQL> ALTER DISKGROUP ALL MOUNT
Wed Mar 31 10:30:39 2010
NOTE: cache registered group DATADG number=1 incarn=0xc102e171
Wed Mar 31 10:30:39 2010
Loaded ASM Library - Generic Linux, version 2.0.4 (KABI_V2) library for asmlib interface
Wed Mar 31 10:30:39 2010
ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]
Wed Mar 31 10:30:39 2010
ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]
Wed Mar 31 10:30:39 2010
ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]
Wed Mar 31 10:30:39 2010
ERROR: no PST quorum in group 1: required 1, found 0
Wed Mar 31 10:30:39 2010
NOTE: cache dismounting group 1/0xC102E171 (DATADG)
NOTE: dbwr not being msg'd to dismount
ERROR: diskgroup DATADG was not mounted
解决办法:
init+ASM2节点添加
引用
asm_diskstring=ORCL:*
添加之后,后台alert显示
引用
Wed Mar 31 11:01:23 2010
SQL> ALTER DISKGROUP ALL MOUNT
Wed Mar 31 11:01:23 2010
NOTE: cache registered group DATADG number=1 incarn=0xc105b157
Wed Mar 31 11:01:23 2010
Loaded ASM Library - Generic Linux, version 2.0.4 (KABI_V2) library for asmlib interface
Wed Mar 31 11:01:23 2010
ERROR: no PST quorum in group 1: required 2, found 0
Wed Mar 31 11:01:23 2010
NOTE: cache dismounting group 1/0xC105B157 (DATADG)
NOTE: dbwr not being msg'd to dismount
ERROR: diskgroup DATADG was not mounted