{{category PCクラスタ}} *iSCSI+OCFS2で高速共有ディスク  Debian squeezeにおいて、mdadmで構築したRAIDボリュームをiSCSI+OCFS2で共有する設定。 */etc/ocfs2/cluster.conf node: ip_port = 7777 ip_address = 192.168.99.1 number = 0 name = blackthunder cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.5 number = 1 name = ssi5 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.6 number = 2 name = ssi6 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.7 number = 3 name = ssi7 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.8 number = 4 name = ssi8 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.9 number = 5 name = ssi9 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.10 number = 6 name = ssi10 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.11 number = 7 name = ssi11 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.99.12 number = 8 name = ssi12 cluster = ocfs2 cluster: node_count = 8 name = ocfs2 */etc/default/iscsitarget ISCSITARGET_ENABLE=true ISCSITARGET_OPTIONS="" */etc/iet/ietd.conf Target iqn.hostname:ocfs2 IncomingUser iscsi password OutgoingUser iscsi password Lun 0 Path=/dev/md0,Type=fileio *コマンド sudo apt-get install \ libssl-dev iscsitarget-dkms \ iscsitarget open-iscsi ocfs2-tools sudo nano -w /etc/default/iscsitarget #ISCSITARGET_ENABLEをtrueに sudo nano -w /etc/iet/ietd.conf #変更点は以下 #IncomingUser username password #OutgoingUser username password #Target targetname:diskid #IncomingUser username password #OutgoingUser username password #Lun 0 Path=/dev/md0,Type=fileio sudo /etc/init.d/iscsitarget start sudo nano -w /etc/iscsi/iscsid.conf #変更点は以下 #node.startup = automatic #node.session.auth.authmethod = CHAP #node.session.auth.username = username #node.session.auth.password = password #discovery.sendtargets.auth.authmethod = CHAP #discovery.sendtargets.auth.username = username #discovery.sendtargets.auth.password = password sudo /etc/init.d/open-iscsi start sudo iscsiadm -m discovery -t st -p localhost sudo iscsiadm -m node \ --targetname targetname:diskid \ --portal 127.0.0.1 --login sudo nano -w /etc/default/o2cb #変更点は以下 #O2CB_ENABLED=true #O2CB_BOOTCLUSTER=ocfs2 sudo cp \ /usr/share/doc/ocfs2-tools/examples/cluster.conf \ /etc/ocfs2/ sudo nano -w /etc/ocfs2/cluster.conf sudo /etc/init.d/o2cb start sudo fdisk n p 1 (そのままEnter) (そのままEnter) w sudo mkfs.ocfs2 -L OCFS2 /dev/sdg1 sudo mkdir -p /work sudo mount -L OCFS2 /work sudo nano -w /etc/fstab #変更点は以下 #LABEL=OCFS2 /work ocfs2 _netdev 0 0