Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
OCFS2 auf openSUSE 12.3
Das Cluster-Filesystem OCFS2 kenne ich von der Arbeit her. Es ermöglicht vielen Nodes (im Büro: über 20) den Zugriff auf dasselbe Filesystem. Und was dort mit SLES 11 (mit HA-Pack) möglich ist, sollte doch zu Hause auch gehen.
Ha.
Installation
Das war der einfache Teil:
zypper se ocfs2 zypper in ocfs2-tools-o2cb ocfs2console
und die Pakete kamen mitsamt ihren Abhängigkeiten, direkt aus dem openSUSE-OSS-Update-Repository.
Filesystem erstellen
Ein Filesystem habe ich via iSCSI vom NAS eingebunden, partitioniert und dann initialisiert:
mkfs.ocfs2 -L wernasocfs2 -T mail --fs-feature-level=default --global-heartbeat \ --cluster-stack o2cb --cluster-name OCFS2WERNAS -F /dev/sdc1 mkfs.ocfs2 1.8.2 Cluster stack: o2cb Cluster name: OCFS2WERNAS Stack Flags: 0x1 NOTE: Feature extended slot map may be enabled Filesystem Type of mail Label: wernasocfs2 Features: sparse extended-slotmap backup-super unwritten inline-data strict-journal-super xattr indexed-dirs refcount discontig-bg Block size: 4096 (12 bits) Cluster size: 4096 (12 bits) Volume size: 1610611687424 (393215744 clusters) (393215744 blocks) Cluster groups: 12191 (tail covers 15104 clusters, rest cover 32256 clusters) Extent allocator size: 100663296 (24 groups) Journal size: 268435456 Node slots: 16 Creating bitmaps: done Initializing superblock: done Writing system files: done Writing superblock: done Writing backup superblock: 6 block(s) Formatting Journals: done Growing extent allocator: done Formatting slot map: done Formatting quota files: done Writing lost+found: done mkfs.ocfs2 successful
Konfiguration
Wesentlich höher als der Aufwand, den ich unter SLES betrieben habe. Ein manuelles Erstellen der /etc/ocfs2/cluster.conf führte zu
o2cb list-nodes OCFS2WERNAS o2cb: Unknown code ____ 251 while loading cluster configuration file '/etc/ocfs2/cluster.conf'
Kein Beinbruch, nehmen wir halt die grafische Oberfläche:
# ocfs2console Traceback (most recent call last): File "/usr/sbin/ocfs2console", line 33, in <module> from ocfs2interface.console import main File "/usr/lib64/python2.7/site-packages/ocfs2interface/console.py", line 26, in <module> from mount import mount, unmount File "/usr/lib64/python2.7/site-packages/ocfs2interface/mount.py", line 20, in <module> import ocfs2 ImportError: /usr/lib64/python2.7/site-packages/ocfs2interface/ocfs2module.so: undefined symbol: io_queue_release
Hm, unter SLES 11 hatte ich nie solche Probleme. Was soll der Mist?
Also brav alles von Hand angelegt:
klops:~ # o2cb add-cluster OCFS2WERNAS klops:~ # o2cb heartbeat-mode OCFS2WERNAS global klops:~ # o2cb add-heartbeat OCFS2WERNAS /dev/disk/by-label/wernasocfs2 klops:~ # o2cb start-heartbeat OCFS2WERNAS Global heartbeat started klops:~ # o2cb list-heartbeats OCFS2WERNAS heartbeat: region = ACA40A8B09D242EA883765E68035E232 cluster = OCFS2WERNAS klops:~ # o2cb add-node --ip 192.168.2.55 --number 0 OCFS2WERNAS klops klops:~ # o2cb add-node --ip 192.168.2.77 --number 1 OCFS2WERNAS sieben klops:~ # o2cb add-node --ip 192.168.2.44 --number 2 OCFS2WERNAS thinkt51 klops:~ # o2cb list-nodes OCFS2WERNAS node: number = 0 name = klops ip_address = 192.168.2.55 ip_port = 7777 cluster = OCFS2WERNAS
Hä? Und wirklich, in der Datei /etc/ocfs2/cluster.conf stand nur der eine Node. Dazu wurde vor vier Wochen schon ein Bug (https://bugzilla.novell.com/show_bug.cgi?id=822190 angelegt), aber der ist immer noch im Status „new“. Ich habe noch einen dazu gelegt (https://bugzilla.novell.com/show_bug.cgi?id=827479), vielleicht hilft das ja.
Übrigens wird die Anzahl der Nodes in der Datei /etc/ocfs2/cluster.conf bei jedem „o2cb add-node“ hochgezählt, aber Einträge für Nodes werden nur für den ersten Node hinzugefügt. Alternativ gäbe es o2cb_ctl, aber:
klops:~ # o2cb_ctl -C -n sieben -t node -a number=1 -a ip_address=192.168.2.77 -a ip_port=7777 -a cluster=OCFS2WERNAS o2cb_ctl: Unable to access cluster service Cannot initialize cluster
Nun, mounten lässt sich das Ding aber:
# mount /dev/disk/by-label/wernasocfs2 /zdisk/ocfs2 # mount | grep ocfs2 ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw,relatime) /dev/sdc1 on /zdisk/ocfs2 type ocfs2 (rw,relatime,_netdev,heartbeat=global,nointr,data=ordered,errors=remount-ro,atime_quantum=60,cluster_stack=o2cb,coherency=full,user_xattr,acl)