RAC在配置OGG的时候需要用到共享目录,这个时候可以使用ACFS或者NFS等方式实现共享目录,下面通过NFS的方式演示下共享目录的创建过程。
主机1IP信息
[root@rac1 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:23:D9:65
inet addr:192.168.40.191 Bcast:192.168.40.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe23:d965/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:163312 errors:0 dropped:0 overruns:0 frame:0
TX packets:1494856 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15263703 (14.5 MiB) TX bytes:2126244832 (1.9 GiB)
主机2IP信息
[root@rac2 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:46:6B:6D
inet addr:192.168.40.192 Bcast:192.168.40.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe46:6b6d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26613 errors:0 dropped:0 overruns:0 frame:0
TX packets:24670 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4908734 (4.6 MiB) TX bytes:2140392 (2.0 MiB)
主机1配置LVM
[root@rac1 ~]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb42a09fd.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n <=====创建新的分区
Command action
e extended
p primary partition (1-4)
p <=====创建主分区
Partition number (1-4): 1 <=====选择分区
First cylinder (1-391, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-391, default 391): +1000M <======创建分区的大小
Command (m for help): t <=======修改分区类型
Selected partition 2
Hex code (type L to list codes): 8e <======8e代表LVM
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): p
Disk /dev/sde: 32210 MB, 32212254720 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb42a09fd
Device Boot Start End Blocks Id System
/dev/sde1 1 2 160330+ 8e Linux LVM
Command (m for help): w <=====保存修改
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]#
[root@rac1 ~]# pvcreate /dev/sde1 <======创建pv
Physical volume "/dev/sde1" successfully created
[root@rac1 ~]# vgcreate OGG_GROUP /dev/sde1 <======创建vg
Volume group "OGG_GROUP" successfully created
[root@rac1 ~]#
[root@rac1 ~]# vgdisplay
--- Volume group ---
VG Name OGG_GROUP
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 996.00 MiB
PE Size 4.00 MiB
Total PE 249
Alloc PE / Size 248 / 992.00 MiB
Free PE / Size 1 / 4.00 MiB
VG UUID sva7bJ-AlJx-3SAN-OOnj-8Ern-VNoj-f6Ux2V
[root@rac1 ~]# lvcreate -L 1000M -n ogg OGG_GROUP <======创建LV -L指定大小 -n指定LV的名字
Logical volume "ogg" created
[root@rac1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/OGG_GROUP/ogg
LV Name ogg
VG Name OGG_GROUP
LV UUID u4Zj2g-iHw4-Gr1v-3W31-MfwA-7eRp-ZKrMbe
LV Write Access read/write
LV Creation host, time rac1.localdomain, 2018-06-03 08:06:48 +0800
LV Status available
# open 1
LV Size 992.00 MiB
Current LE 248
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
[root@rac1 ~]# mkdir -p /ogg
[root@rac1 ~]# mount /dev/OGG_GROUP/ogg /ogg <=====挂载LV目录
[root@rac1 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 47371632 33105036 11860248 74% /
tmpfs 953788 72 953716 1% /dev/shm
/dev/sda1 198337 34392 153705 19% /boot
/dev/mapper/OGG_GROUP-ogg 999832 525296 423748 56% /ogg
主机1配置mount
[root@rac1 ~]# cat /etc/exports
/ogg 192.168.40.192(rw,sync)
[root@rac1 ~]# exportfs -r
[root@rac1 ~]# showmount -e
Export list for rac1.localdomain:
/ogg 192.168.40.192
[root@rac1 ~]#
主机2挂载ogg目录
[root@rac2 ~]# mkdir -p /ogg
[root@rac2 ~]# mount -t nfs 192.168.40.191:/ogg /ogg
[root@rac2 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 47371632 22921584 22043700 51% /
tmpfs 953788 72 953716 1% /dev/shm
/dev/sda1 198337 34395 153702 19% /boot
192.168.40.191:/ogg 999936 525312 423936 56% /ogg
[root@rac2 ~]#
[root@rac2 ~]#