{{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:diskid IncomingUser iscsi password OutgoingUser iscsi password Lun 0 Path=/dev/md0,Type=fileio */etc/iscsi/iscsid.conf node.startup = automatic node.session.auth.authmethod = CHAP node.session.auth.username = iscsi node.session.auth.password = password discovery.sendtargets.auth.authmethod = CHAP discovery.sendtargets.auth.username = iscsi discovery.sendtargets.auth.password = password node.session.timeo.replacement_timeout = 120 node.conn[0].timeo.login_timeout = 15 node.conn[0].timeo.logout_timeout = 15 node.conn[0].timeo.noop_out_interval = 5 node.conn[0].timeo.noop_out_timeout = 5 node.session.err_timeo.abort_timeout = 15 node.session.err_timeo.lu_reset_timeout = 20 node.session.initial_login_retry_max = 8 node.session.cmds_max = 128 node.session.queue_depth = 32 node.session.xmit_thread_priority = -20 node.session.iscsi.InitialR2T = No node.session.iscsi.ImmediateData = Yes node.session.iscsi.FirstBurstLength = 262144 node.session.iscsi.MaxBurstLength = 16776192 node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144 discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 node.session.iscsi.FastAbort = Yes */etc/hosts 127.0.0.1 localhost 外向きNICのIP hostname.hogehoge.com hostname 192.168.99.1 hostname.mycluster.home hostname 192.168.99.5 ssi5.mycluster.home ssi5 192.168.99.6 ssi6.mycluster.home ssi6 192.168.99.7 ssi7.mycluster.home ssi7 192.168.99.8 ssi8.mycluster.home ssi8 192.168.99.9 ssi9.mycluster.home ssi9 192.168.99.10 ssi10.mycluster.home ssi10 192.168.99.11 ssi11.mycluster.home ssi11 192.168.99.12 ssi12.mycluster.home ssi12 */etc/fstab proc /proc proc defaults 0 0 UUID=hogehoge / ext4 errors=remount-ro 0 1 /boot /srv/tftp/boot none bind 0 0 LABEL=OCFS2 /work ocfs2 _netdev 0 0 /bin /NFSROOT/slave/bin none bind 0 0 /usr /NFSROOT/slave/usr none bind 0 0 /sbin /NFSROOT/slave/sbin none bind 0 0 /home /NFSROOT/slave/home none bind 0 0 /lib /NFSROOT/slave/lib none bind 0 0 /opt /NFSROOT/slave/opt none bind 0 0 /root /NFSROOT/slave/root none bind 0 0 */etc/default/o2cb O2CB_ENABLED=true O2CB_BOOTCLUSTER=ocfs2 O2CB_HEARTBEAT_THRESHOLD=31 O2CB_IDLE_TIMEOUT_MS=30000 O2CB_KEEPALIVE_DELAY_MS=2000 O2CB_RECONNECT_DELAY_MS=2000 *コマンド sudo apt-get install \ libssl-dev iscsitarget-dkms \ iscsitarget open-iscsi ocfs2-tools sudo ne /etc/default/iscsitarget sudo ne /etc/iet/ietd.conf sudo /etc/init.d/iscsitarget start sudo ne /etc/iscsi/iscsid.conf 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 ne /etc/default/o2cb sudo cp \ /usr/share/doc/ocfs2-tools/examples/cluster.conf \ /etc/ocfs2/ sudo ne /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 ne /etc/fstab