ISCSI-Target auf DRBD-Cluster mit Bonding

Hier eine kleine Mitschrift zur Installation eines ISCSI-Target auf einem DRBD-Cluster mit Bonding der Netzwerkkarten.

Installiert wird zu Testzwecken in VirtualBox/Oracle VM aber lässt sich auch auf Hardware umsetzten.

Installation Node 1

512MB RAM

8GB HDD

4GB HDD (drbd)

Deact Audio

Deact Ser

Deact USB

Deact System/Absolutes Zeigegerät

Netzwerk

Adapter 1

Netzbrücke

Adapter 2

Netzbrücke

Adapter 3

Internes Netzwerk

DRBD

Adapter 4

Internes Netzwerk

DRBD

ubuntu 10.04 server

ETH0 Adresse für internet bei Installation

hostname (storage-cl0)

domain   (domain.local)

Gesamte Platte (ohne lvm) (Testinstallation)

OpenSSH server

apt-get update && apt-get dist-upgrade

apt-get install drbd8-utils heartbeat ifenslave iscsitarget

/etc/modprobe.d/bonding.conf

———————————————–

options bonding max_bonds=2

alias bond0 bonding

options bond0 mode=0 miimon=100

alias bond1 bonding

options bond1 mode=0 miimon=100

———————————————–

/etc/network/interfaces

———————————————–

auto lo

iface lo inet loopback

# Netz zu Clients

auto bond0

iface bond0 inet static

address 192.168.254.182

netmask 255.255.255.0

network 192.168.254.0

broadcast 192.168.254.255

gateway 192.168.254.1

post-up ifenslave bond0 eth0 eth1

pre-down ifenslave -d bond0 eth0 eth1

# Netz DRBD

auto bond1

iface bond1 inet static

address 192.168.200.11

netmask 255.255.255.0

post-up ifenslave bond1 eth2 eth3

pre-down ifenslave -d bond1 eth2 eth3

———————————————–

/etc/hosts

———————————————–

127.0.0.1       localhost

192.168.254.182 storage-cl0.domain.local

192.168.200.11  storage-cl0

192.168.200.12  storage-cl1

———————————————–

reboot

fdisk /dev/sdb

n, p, 1, ENTER, ENTER, w

/etc/drbd.d/drbd0.res

———————————————–

resource drbd0 {

protocol C;

startup {

wfc-timeout 30;

degr-wfc-timeout 30;

}

net {

cram-hmac-alg sha1;

shared-secret “secret”;

}

on storage-cl0 {

device /dev/drbd0;

disk /dev/sdb1;

address 192.168.200.11:7788;

meta-disk internal;

}

on storage-cl1 {

device /dev/drbd0;

disk /dev/sdb1;

address 192.168.200.12:7788;

meta-disk internal;

}

syncer {

rate 250M;

}

}

———————————————–

drbdadm create-md drbd0

/etc/init.d/drbd start

drbdadm — –overwrite-data-of-peer primary drbd0

/etc/default/iscsitarget

———————————————–

ISCSITARGET_ENABLE=true

———————————————–

/etc/ietd.conf

———————————————–

Target iqn.2010.storage:drbd0

Lun 0 Path=/dev/drbd0,Type=fileio

Alias storage-drbd0

MaxConnections  6

———————————————–

/etc/initiators.allow

———————————————–

ALL 192.168.100.0/24

———————————————–

update-rc.d iscsitarget disable default


/etc/ha.d/ha.cf

———————————————–

logfile /var/log/ha-log

debugfile /var/log/ha-debug

logfacility local0

udpport 694

keepalive 2

deadtime 10

warntime 5

initdead 115

bcast bond1

node storage-cl0 storage-cl1

crm off

auto_failback off

———————————————–

/etc/ha.d/authkeys

———————————————–

auth 3

3 md5 secret

———————————————–

chmod 600 /etc/ha.d/authkeys

/etc/ha.d/harecources

———————————————–

storage-cl0 IPaddr2::192.168.100.100/16/bond0 drbddisk::drbd0 iscsitarget

———————————————–

reboot

Installation Node 2

512MB RAM

8GB HDD

4GB HDD (drbd)

Deact Audio

Deact Ser

Deact USB

Deact System/Absolutes Zeigegerät

Netzwerk

Adapter 1

Netzbrücke

Adapter 2

Netzbrücke

Adapter 3

Internes Netzwerk

DRBD

Adapter 4

Internes Netzwerk

DRBD

ubuntu 10.04 server

ETH0 Adresse für internet bei Installation

hostname (storage-cl0)

domain   (domain.local)

Gesamte Platte (ohne lvm) (Testinstallation)

OpenSSH server

apt-get update && apt-get dist-upgrade

apt-get install drbd8-utils heartbeat ifenslave iscsitarget

/etc/modprobe.d/bonding.conf

———————————————–

options bonding max_bonds=2

alias bond0 bonding

options bond0 mode=0 miimon=100

alias bond1 bonding

options bond1 mode=0 miimon=100

———————————————–

/etc/network/interfaces

———————————————–

auto lo

iface lo inet loopback

# Netz zu Clients

auto bond0

iface bond0 inet static

address 192.168.254.183

netmask 255.255.255.0

network 192.168.254.0

broadcast 192.168.254.255

gateway 192.168.254.1

post-up ifenslave bond0 eth0 eth1

pre-down ifenslave -d bond0 eth0 eth1

# Netz DRBD

auto bond1

iface bond1 inet static

address 192.168.200.12

netmask 255.255.255.0

post-up ifenslave bond1 eth2 eth3

pre-down ifenslave -d bond1 eth2 eth3

———————————————–

/etc/hosts

———————————————–

127.0.0.1       localhost

192.168.254.183 storage-cl1.domain.local

192.168.200.11  storage-cl0

192.168.200.12  storage-cl1

———————————————–

reboot

fdisk /dev/sdb

n, p, 1, ENTER, ENTER, w

/etc/drbd.d/drbd0.res

———————————————–

resource drbd0 {

protocol C;

startup {

wfc-timeout 30;

degr-wfc-timeout 30;

}

net {

cram-hmac-alg sha1;

shared-secret “secret”;

}

on storage-cl0 {

device /dev/drbd0;

disk /dev/sdb1;

address 192.168.200.11:7788;

meta-disk internal;

}

on storage-cl1 {

device /dev/drbd0;

disk /dev/sdb1;

address 192.168.200.12:7788;

meta-disk internal;

}

syncer {

rate 250M;

}

}

———————————————–

drbdadm create-md drbd0

/etc/init.d/drbd start

/etc/default/iscsitarget

———————————————–

ISCSITARGET_ENABLE=true

———————————————–

/etc/ietd.conf

———————————————–

Target iqn.2010.storage:drbd0

Lun 0 Path=/dev/drbd0,Type=fileio

Alias storage-drbd0

MaxConnections  6

———————————————–

/etc/initiators.allow

———————————————–

ALL 192.168.100.0/24

———————————————–

update-rc.d iscsitarget disable default


/etc/ha.d/ha.cf

———————————————–

logfile /var/log/ha-log

debugfile /var/log/ha-debug

logfacility local0

udpport 694

keepalive 2

deadtime 10

warntime 5

initdead 115

bcast bond1

node storage-cl0 storage-cl1

crm off

auto_failback off

———————————————–

/etc/ha.d/authkeys

———————————————–

auth 3

3 md5 secret

———————————————–

chmod 600 /etc/ha.d/authkeys


/etc/ha.d/harecources

———————————————–

storage-cl1 IPaddr2::192.168.100.100/16/bond0 drbddisk::drbd0 iscsitarget

———————————————–

reboot

Viel Spass

ISCSI-Target auf DRBD-Cluster mit Bonding

Autor:
Datum: Donnerstag, 2. September 2010 13:46
Trackback: Trackback-URL Themengebiet: GNU/Linux

Feed zum Beitrag: RSS 2.0 Diesen Artikel kommentieren

Kommentar abgeben