Oracle linux файловая система

Oracle linux файловая система

This chapter includes information about managing the Oracle Cluster File System Version 2 (OCFS2) in Oracle Linux 8 . It includes tasks for configuring, administering, and troubleshooting OCFS2.

In Oracle Linux 8 , Oracle Cluster File Ssystem Version 2 (OCFS2) is supported on Unbreakable Enterprise Kernel (UEK) releases only , starting with Unbreakable Enterprise Kernel Release 6 (UEK R6).

For information about local file system management in Oracle Linux, see Oracle Linux 8: Managing Local File Systems.

About OCFS2

OCFS2 (Oracle Cluster File System Version 2) is a general-purpose shared-disk file system that is intended for use with clusters. OCFS2 offers high performance as well as high availability. Optionally, you can also mount an OCFS2 volume on a standalone, non-clustered system.

Using OCFS2 offers the following benefits:

  • You can use the reflink command with OCFS2 to create copy-on-write clones of individual files. You can also use the cp —reflink command in a similar way that you would on a Btrfs file system. Typically, such clones enable you to save disk space when storing multiple copies of very similar files, such as virtual machine (VM) images or Linux Containers. Note that when using the reflink command, the resulting file system behaves like a clone of the original files ystem, which means that their UUIDs are identical. When using the reflink command to create a clone, you must change the UUID by using the tunefs.ocfs2 command. See Querying and Changing Volume Parameters.
  • Mounting a local OCFS2 file system enables you to subsequently migrate the file system to a cluster file system without requiring any conversion.
  • OCFS2 provides local file-system semantics. Therefore, almost all applications can use OCFS2. Applications that are cluster-aware can use cache-coherent parallel I/O from multiple cluster nodes to balance activity across the cluster, or they can use of the available file-system functionality to fail over and run on another node in the event that a node fails.

OCFS2 Use Cases

The following are some typical use cases for OCFS2.

Load Balancing Use Case

You can use OCFS2 nodes to share resources between client systems. For example, the nodes could export a shared file system by using Samba or NFS. To distribute service requests between the nodes, you can use round-robin DNS, a network load balancer; or, you can specify which node should be used on each client.

Oracle Real Application Cluster Use Case

Oracle Real Application Cluster (RAC) uses its own cluster stack, Cluster Synchronization Services (CSS). You can use O2CB in conjunction with CSS, but note that each stack is configured independently for timeouts, nodes, and other cluster settings. You can use OCFS2 to host the voting disk files and the Oracle cluster registry (OCR), but not the grid infrastructure user’s home, which must exist on a local file system on each node.

Читайте также:  Установка виндовс и линукс на одном компьютере

Because both CSS and O2CB use the lowest node number as a tie breaker in quorum calculations, ensure that the node numbers are the same in both clusters. If necessary, edit the O2CB configuration file, /etc/ocfs2/cluster.conf , to make the node numbering consistent. Then, update this file on all of the nodes. The change takes effect when the cluster is restarted.

Oracle Database Use Case

Specify the noatime option when mounting volumes that host Oracle datafiles, control files, redo logs, voting disk, and OCR. The noatime option disables unnecessary updates to the access time on the inodes.

Specify the nointr mount option to prevent signals interrupting I/O transactions that are in progress.

By default, the init.ora parameter filesystemio_options directs the database to perform direct I/O to the Oracle datafiles, control files, and redo logs. You should also specify the datavolume mount option for volumes that contain the voting disk and OCR. Do not specify this option for volumes that host the Oracle user’s home directory or Oracle E-Business Suite.

To prevent database blocks from becoming fragmented across a disk, ensure that the file system cluster size is at minimum as large as the database block size, which is typically 8KB. If you specify the file system usage type as datafiles when using the mkfs.ocfs2 command, the file system cluster size is set to 128KB.

To enable multiple nodes to maximize throughput by concurrently streaming data to an Oracle datafile, OCFS2 deviates from the POSIX standard by not updating the modification time ( mtime ) on the disk when performing non-extending direct I/O writes. The value of mtime is updated in memory. However, OCFS2 does not write the value to disk unless an application extends or truncates the file or performs a operation to change the file metadata, such as using the touch command. This behavior leads to results with different nodes reporting different time stamps for the same file. Use the following command to view the on-disk timestamp of a file:

sudo debugfs.ocfs2 -R "stat /file_path" device | grep "mtime:"

Setting Up an OCFS2 Cluster

A cluster consists of members called nodes. For best performance, each node in the cluster should have at least two network interfaces. The first interface is connected to a public network to allow general access to the systems, while the second interface is used for private communications between the nodes and the cluster heartbeat . This second interface determines how the cluster nodes coordinate their access to shared resources and how they monitor each other’s state.

Both network interfaces must be connected through a network switch. Additionally, you must ensure that all of the network interfaces are configured and working before configuring the cluster.

Planning for an OCFS2 Cluster

Aside from setting up the proper equipment, prepare the following for the cluster:

  • Designated cluster members, specifically, their hostnames and corresponding IP addresses.
  • Heartbeat mode to use in the cluster.
Читайте также:  Linux remove all empty lines

In a cluster configuration, small packets travel throughout the entire setup over a specific UDP port, including all the networks configured for cluster. These packets establish routes between the cluster nodes and become indicators of whether the cluster network is up or down. Essentially, the packets are the way you can determine the health of the cluster. For this reason, these packets are also called heartbeats .

You can configure a cluster to run in either of the following heartbeat modes:

  • Local heartbeat thread for each shared device (default heartbeat mode). In this configuration, a node starts a heartbeat thread when the node mounts an OCFS2 volume and stops the thread when the node unmounts the volume. CPU overhead is large on nodes that mount a large number of OCFS2 volumes because each mount requires a separate heartbeat thread. Likewise, a large number of mounts increases the risk of a node becoming isolated out of the cluster, also known as fencing , due to a heartbeat I/O timeout on a single mount.
  • Global heartbeat on specific shared devices. This mode enables you to configure any OCFS2 volume as a global heartbeat device, provided that the volume occupies a whole disk device and not a partition. In this mode, the heartbeat to the device starts when the cluster becomes online and stops when the cluster goes offline. This mode is recommended for clusters that mount a large number of OCFS2 volumes. A node fences itself out of the cluster if a heartbeat I/O timeout occurs on more than half of the global heartbeat devices. To provide redundancy against failure of one of the devices, you should configure at least three global heartbeat devices.

The following figure shows a cluster of four nodes that are connected by using a network switch to a LAN and a network storage server. The nodes and storage server are also connected by using a switch to a private network that is used for the local cluster heartbeat.

Figure 3-1 Cluster Configuration by Using a Private Network

The figure shows a cluster of four nodes that are connected by using a network switch to a LAN and a network storage server. The nodes and the storage server are also connected by using a switch to a private network, which is used for the cluster heartbeat.

Although you can configure and use OCFS2 without using a private network, such a configuration increases the probability of a node fencing itself out of the cluster due to an I/O heartbeat timeout.

The following table provides recommendations for minimum cluster size settings for different file system size ranges:

Источник

OCFS2

Oracle Cluster Filesystem 2 (OCFS2) — файловая система, предназначенная для совместного использования двумя или более Linux-системами, одновременно работающими с одним и тем же разделяемым хранилищем (shared storage). Обладает высокой производительностью и надёжностью. Разрабатывается компанией Oracle. Является свободным программным обеспечением. Входит в состав ядра Linux, начиная с 2.6.16 (март 2006).

Файловая система обладает семантикой локальной файловой системы и не требует никакой специальной модификации программного обеспечения, использующего её.

В настоящий момент файловая система OCFS2 используется в продукте компании Oracle — Real Application Cluster. Кроме этого, её часто применяют при построении масштабируемых Web-серверов, файловых, почтовых систем, а также для хранения образов виртуальных машин.

Читайте также:  Linux format new disk

Файловая система работает поверх разделяемого хранилища, доступ к которому может осуществляться при помощи таких протоколов как iSCSI, AoE или DRBD.

[править] Возможности файловой системы OCFS2

  • Блоки переменного размера;
  • Гибкое выделение пространства (экстенты, разреженные файлы (с 2.6.22), незаписанные экстенты с возможностью создания дырок);
  • Журналирование (поддерживаются режимы ordered и writeback);
  • В системах различных аппаратных платформ работает одинаково (x86, x86_64, ia64 и ppc64);
  • Поддержка встроенного Clusterstack с распределённой системой управления блокировками (Distributed Lock Manager);
  • Поддержка буферизованного, прямого, асинхронного, splice() ввода/вывода, а также возможность отображения памяти на файловую систему (Memory Mapped I/Os);
  • Разнообразные утилиты, обеспечивающие всестороннюю поддержку файловой системы.

[править] Программы

Данная страница находится в разработке.
Эта страница ещё не закончена. Информация, представленная здесь, может оказаться неполной или неверной.

Если вы считаете, что её стоило бы доработать как можно быстрее, пожалуйста, скажите об этом.

  • mkfs.ocfs2 — создать файловую систему OCFS2;
  • mount.ocfs2 — примонтировать файловую систему OCFS2;
  • mounted.ocfs2 — найти все файловые системы OCFS2 на данном узле;
  • fsck.ocfs2 — проверить целостность файловой системы OCFS2;
  • o2cb — остановка, запуск, настройка кластера (стек OCFS2); включает в свой состав несколько компонентов (o2nm, o2hb, o2net, o2dlm).
  • ocfs2console — графичейский интерфейс для управления OCFS2.
  • o2nm — менеджер узлов (node manager);
  • o2hb — heratbeat agent;
  • o2net — сетевой агент;
  • o2dlm — распределённый менеджер блокировок (distributed lock manager).

[править] Настройка

/etc/ocfs2/cluster.conf /etc/sysconfig/o2cb
node: ip_port = 7777 ip_address = 192.168.2.100 number = 0 name = linux1 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.2.101 number = 1 name = linux2 cluster = ocfs2 cluster: node_count = 2 name = ocfs2

Конфигурационный файл описывает инсталляцию из двух узлов (linux1, linux2), их адреса и порты, на которых доступны служба.

Величины таймаутов описываются в файле /etc/sysconfig/o2cb. Сконфигурировать таймауты можно с помощью инициализационного скрипта o2cb.

После того как конфигурация кластера описана, можно создать файловую систему:

Здесь мы предполагаем, что на узлах доступно разделяемое хранилище /dev/drbd1.

/dev/drbd1 /ocfs2/vol1 ocfs2 defaults 0 0
/etc/init.d/o2cb online CLUSTER-NAME

[править] Настройка квот

Квоты настраивались на Debian 6 2.6.32-5-686

[править] Информации о квотах ocfs2

Квоты в ocfs2 хранятся в мета данных и автоматически синхронизируются каждые 10 сек с мастер нодой, потому файлов aquota.group и aquota.user вы не увидите. quotacheck и repquota у вас так же не будет работать. Мастер нодой в данном контексте является любая нода которая добавляет квоту. ocfs не использует модуль ядра quota_v2.

Требования: ocfs2-tools >= 1.6, пакет можно скачать с нестабильной ветки дебиана. Прямые руки и немного мозга.

размонтируем ocfs2 на всех нодах. На мастере делаем

tunefs.ocfs2 --fs-features=usrquota /dev/sdb && tunefs.ocfs2 --fs-features=grpquota /dev/sdb

добавляем на всех нодах в /etc/fstab

/dev/sdb /stor ocfs2 defaults,usrquota,grpquota 0 0

Если по каким-то причинам вам не достаточно времени синхронизации раз в 10 сек. Вы это можете изменить

tunefs.ocfs2 --usrquota-sync-interval=5 /dev/sdb && tunefs.ocfs2 --grpquota-sync-interval=5 /dev/sdb

Пакет quota не обязательно должен стоять на всех нодах, достаточно на мастере и бекапном мастере. Добавляются квоты как обычно это делается edquota либо setquota. Просмотр так же как обычно quota -v -u имя

Источник

Оцените статью
Adblock
detector