Oracle DBA Forum  

Вернуться   Oracle DBA Forum > Работа > temp

Ответ
 
Опции темы Опции просмотра
  #1  
Старый 26.02.2011, 23:37
Marley Marley вне форума
Senior Member
 
Регистрация: 19.09.2009
Сообщений: 7,385
По умолчанию [OEL5 x86_64, NFS]

На nas создаем RAID массив 5:

[[email protected] ~]# ls /dev/sd*

Код:
/dev/sda  /dev/sdb  /dev/sdc  /dev/sdd

[[email protected] ~]# fdisk /dev/sda

Код:
The number of cylinders for this disk is set to 40960.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-40960, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-40960, default 40960):
Using default value 40960

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
Повторяем на остальных дисках.


Результат:


[[email protected] ~]# fdisk -l

Код:
Disk /dev/hda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2087    16763796   83  Linux
/dev/hda2            2088        4698    20972857+  83  Linux
/dev/hda3            4699        5220     4192965   82  Linux swap / Solaris

Disk /dev/sda: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       40960    41943024   fd  Linux raid autodetect

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       40960    41943024   fd  Linux raid autodetect

Disk /dev/sdc: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       40960    41943024   fd  Linux raid autodetect

Disk /dev/sdd: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       40960    41943024   fd  Linux raid autodetect

Создание RAID-массива

[[email protected] ~]# mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

Код:
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 41942912K
mdadm: array /dev/md0 started.

Создание файловой системы поверх RAID-массива


[[email protected] etc]# mkfs.ext3 /dev/md0

Код:
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
15728640 inodes, 31457184 blocks
1572859 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
960 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[email protected] etc]# mdadm --detail --scan --verbose

Код:
ARRAY /dev/md0 level=raid5 num-devices=4 metadata=0.90 spares=1 UUID=d82453f3:11ff237d:2b891314:538aabb5
   devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1

Создание конфигурационного файла mdadm.conf


mkdir /etc/mdadm
echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
mdadm --detail --scan --verbose | awk '/ARRAY/ {print}' >> /etc/mdadm/mdadm.conf


mkdir /raid


{
chown -R oracle11:oinstall /raid
chmod -R 777 /raid
}



vi /etc/fstab

добавляем

Код:
/dev/md0              /raid          ext3      defaults
mount /raid


df -h

Код:
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1              16G  843M   15G   6% /
none                 1004M     0 1004M   0% /dev/shm
/dev/hda2              20G   76M   19G   1% /home
/dev/hdb1              40G   80M   38G   1% /share
------------------------------------

// Расшариваем диск

vi /etc/exports

добавить

Код:
/raid *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
chkconfig --level 345 nfs on
service nfs restart

==================================================


На всех узлах кластера:

Смонтируем второй диск в /u1 на всех узлах кластера

[[email protected] ~]# fdisk /dev/hdb

Код:
The number of cylinders for this disk is set to 5221.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-5221, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221):
Using default value 5221

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[[email protected] ~]# mkfs.ext3 /dev/hdb1

Код:
 

mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
5242880 inodes, 10484412 blocks
524220 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
320 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
done

This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
-----------------------

{
mkdir /u01
mkdir /u02
}




vi /etc/fstab

добавляем

Код:
/dev/hdb1              /u01          ext3      defaults
nas:/raid /u02 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
service nfs restart

mount /u01
mount /u02

[[email protected] ~]# df -h

Код:
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1              16G  1.7G   14G  11% /
/dev/hda2              20G  173M   19G   1% /home
tmpfs                1006M     0 1006M   0% /dev/shm
/dev/hdb1              40G  177M   38G   1% /u01
nas:/raid             119G  188M  112G   1% /u02

{
chown -R oracle11:oinstall /u01
chmod -R 775 /u01

chown -R oracle11:oinstall /u02
chmod -R 775 /u02
}
__________________
Чат форума (требуется аккаунт на github или twitter)

Последний раз редактировалось Marley; 28.05.2012 в 12:49.
Ответить с цитированием
Ответ

Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Текущее время: 17:02. Часовой пояс GMT +3.


Powered by vBulletin®