~ubuntu-branches/ubuntu/vivid/ctdb/vivid-proposed

« back to all changes in this revision

Viewing changes to web/iscsi.html

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Parent
  • Date: 2008-04-26 15:21:27 UTC
  • Revision ID: james.westby@ubuntu.com-20080426152127-58mv5ojv5q362ise
Tags: upstream-1.0.34+git200804242206
ImportĀ upstreamĀ versionĀ 1.0.34+git200804242206

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--#set var="TITLE" value="CTDB and iSCSI" -->
 
2
<!--#include virtual="header.html" -->
 
3
 
 
4
<h1>Setting up HA iSCSI with CTDB</h1>
 
5
 
 
6
<p>
 
7
You can use CTDB to create a HA iSCSI Target.
 
8
</p>
 
9
 
 
10
<p>
 
11
Since the iSCSI Target is not
 
12
clusterized nor integrated with CTDB in the same sense Samba is, this
 
13
implementation will only create a HA solution for iSCSI where each public address is assinged its own iscsi target name and the LUNs that are created are only accessible through one specific target (i.e. one public address at a time).
 
14
 
 
15
</p>
 
16
 
 
17
<p>
 
18
! This feature ONLY works when public addresses are used. It is not supported, nor does it work, if you use the LVS feature to present the entire cluster as one single ip address. !
 
19
 
 
20
</p>
 
21
 
 
22
<h2>Prereqs</h2>
 
23
Configure CTDB as above and set it up to use public ipaddresses.<br>
 
24
Verify that the CTDB cluster works.
 
25
 
 
26
<h2>Install the iSCSI target software on all nodes</h2>
 
27
On RHEL5 this package is called "scsi-target-utils" and it needs to be installed
 
28
on all nodes in the cluster. The easiest way to install this package is by using :
 
29
 
 
30
<pre>
 
31
onnode all yum install scsi-target-utils -y
 
32
</pre>
 
33
 
 
34
Make sure that the service is not started automatically when booting, we want CTDB to start/stop this service :
 
35
<pre>
 
36
onnode all chkconfig tgtd off
 
37
</pre>
 
38
 
 
39
<h2>/etc/sysconfig/iscsi</h2>
 
40
 
 
41
Create this file and add the following three lines to it :
 
42
 
 
43
<pre>
 
44
   CTDB_MANAGES_ISCSI=yes
 
45
   CTDB_START_ISCSI_SCRIPTS=/gpfs/iscsi/
 
46
</pre>
 
47
 
 
48
<p>
 
49
CTDB_MANAGES_ISCSI=yes just tells CTDB event script for iSCSI that CTDB should start and stop the iSCSI target service as required.
 
50
</p>
 
51
 
 
52
<p>
 
53
CTDB_START_ISCSI_SCRIPTS=<directory on shared storage>
 
54
This is a directory on shared storage where the scripts to start and configure the iscsi service are held. There is one script for each public address named <public address>.sh .
 
55
</p>
 
56
 
 
57
 
 
58
<h2>Example: create a LUN that will be hosted on public ip address 10.1.1.1</h2>
 
59
<p>
 
60
Before you cna export a LUN you must create it as a file in the shared filesystem. When doing so, make sure you create it as a real file and not a sparse file!<br />
 
61
While it is much quicker to create a sparse file if you want a file with filesize 100Gb, SCSI has no concept of "disk full" so if you run out of backing space for the sparse file, the scsi initiators will be "surprised" and "unhappy".
 
62
</p>
 
63
<pre>
 
64
dd if=/dev/zero of=/gpfs/iscsi/10.1.1.1.lun.1 bs=1024 count=102400
 
65
</pre>
 
66
<p>
 
67
to create a 100MByte file to export as an iSCSI LUN.
 
68
</p>
 
69
 
 
70
<h2>Example: 10.1.1.1.sh</h2>
 
71
<p>
 
72
This example shellscript is used to configure the iscsi target that is hosted onthe public address 10.1.1.1
 
73
</p>
 
74
<pre>
 
75
#!/bin/sh
 
76
# script to set up the iscsi target and luns hosted by public address
 
77
# 10.1.1.1
 
78
 
 
79
 
 
80
#create a target
 
81
tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2007-11.com.ctdb:iscsi.target.10.1.1.1
 
82
 
 
83
#attach a lun
 
84
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /gpfs/iscsi/10.1.1.1.lun.1
 
85
 
 
86
# no security, allow everyone to access this lun
 
87
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
 
88
</pre>
 
89
 
 
90
 
 
91
<p>
 
92
iqn.2007-11.com.ctdb:iscsi.target.10.1.1.1 in the example above is the iscsi name that is assigned to the target. Dont use this name, pick your own name!
 
93
</p>
 
94
 
 
95
<p>
 
96
See the documentation for the tgtadm command for more information on how you want to set up your environment.
 
97
</p>
 
98
 
 
99
<h2>Perform a ctdb recovery to start the iscsi service</h2>
 
100
<pre>
 
101
ctdb recover
 
102
</pre>
 
103
 
 
104
<!--#include virtual="footer.html" -->
 
105