link: http://www.l4l.be/index.php/linuxdocs/46-storage/112-iscsi-enterprise-target-installatie
Installatie
Zorg er voor dat de compiler en bijbehorende tools geinstalleerd staan, ook is openssl-dev nodig. Onder Ubuntu doe je dit met:
apt-get install build-essential libssl-dev
Download IETd, also-known-as iscsitarget:
wget http://downloads.sourceforge.net/project/iscsitarget/iscsitarget/0.4.17/iscsitarget-0.4.17.tar.gz
Pak het uit:
tar xzvf iscsitarget-0.4.17.tar.gz
cd iscsitarget-0.4.17
Als je nu zou willen compileren, dan loop je tegen het volgende probleem op:
iscsitarget-0.4.17/kernel/block-io.c: In function ‘blockio_open_path’:
iscsitarget-0.4.17/kernel/block-io.c:164: error: implicit declaration of function ‘open_bdev_excl’
iscsitarget-0.4.17/kernel/block-io.c:164: warning: assignment makes pointer from integer without a cast
iscsitarget-0.4.17/kernel/block-io.c: In function ‘blockio_detach’:
iscsitarget-0.4.17/kernel/block-io.c:328: error: implicit declaration of function ‘close_bdev_excl’
iscsitarget-0.4.17/kernel/block-io.o] Error 1
iscsitarget-0.4.17/kernel] Error 2
Met andere woorden er is een probleem... Open het bestand block-io.c in je favoriete editor, en ga naar regel 164. Daar staat:
bdev = open_bdev_excl(path, flags, THIS_MODULE);
Verander dit in:
bdev = open_bdev_exclusive(path, flags, THIS_MODULE);
Ook is er een verandering nodig in regel 328, voor het gemak geef ik hier de volledige verandering weer:
static void
blockio_detach(struct iet_volume *volume)
{
struct blockio_data *bio_data = volume->private;
int flags = FMODE_READ | (LUReadonly(volume) ? 0 : FMODE_WRITE);
if (bio_data->bdev)
close_bdev_exclusive(bio_data->bdev, flags);
kfree(bio_data->path);
kfree(volume->private);
}
Nu kun je compileren/installeren:
make
sudo make install
2010年1月19日 星期二
iscsitarget make error block-io.c
2008年1月15日 星期二
OpenGFS description
http://linux.softpedia.com/get/System/Filesystems/OpenGFS-1471.shtml
OpenGFS is a clustered filesystem. It's usefulness is thought to be mostly in SAN's, but goes well beyond that. It can be used with iSCSI, HyperSCSI, and even firewire.
OpenGFS is undergoing many changes at the moment, we appreciate any help in testing the current development branch. For those less adventurous souls we have our current stable branch (0.2.1).
Here are some key features of "OpenGFS":
Multiple clients per server
· We don't have to worry about two reads or writes overlapping on the server as the server opens the block file in syncronous mode, and network receives are keep apart with mutexes. Everything else must be handled by higherlevel layers, e.g. the OpenGFS filesystem.
Transparent reconnection.
· The loss of a server does not mean that programs using the device file immediatily get errors. Activity on the device pauses, and remains paused until gnbd gets reconnected to a server, and re-issuse any unfulfilled requests.
Other proccesses Suspending IO.
· Simply, some other process can come and state that the device should stop talking (or trying to talk) to the server. Think `Entering cluster tansition'
Notification of change of server.
· Just change the ip and port of where the device looks for a server.
Resumption of service.
· Connect to the server again, and re-issue any requests that haven't gotten replies yet.
Currently gnbd has a kernel thread and a TCP socket for each opened block device. If either of these fail, the device is still opened. This is to allow modification of some parameters via ioctl.
There is a short and simple userland program to set the ip and port. Done with those ioctls.
Server ip and port can also be specified at module load. This uses the config option durring insmod. More details in the main.c file.
OpenGFS is a clustered filesystem. It's usefulness is thought to be mostly in SAN's, but goes well beyond that. It can be used with iSCSI, HyperSCSI, and even firewire.
OpenGFS is undergoing many changes at the moment, we appreciate any help in testing the current development branch. For those less adventurous souls we have our current stable branch (0.2.1).
Here are some key features of "OpenGFS":
Multiple clients per server
· We don't have to worry about two reads or writes overlapping on the server as the server opens the block file in syncronous mode, and network receives are keep apart with mutexes. Everything else must be handled by higherlevel layers, e.g. the OpenGFS filesystem.
Transparent reconnection.
· The loss of a server does not mean that programs using the device file immediatily get errors. Activity on the device pauses, and remains paused until gnbd gets reconnected to a server, and re-issuse any unfulfilled requests.
Other proccesses Suspending IO.
· Simply, some other process can come and state that the device should stop talking (or trying to talk) to the server. Think `Entering cluster tansition'
Notification of change of server.
· Just change the ip and port of where the device looks for a server.
Resumption of service.
· Connect to the server again, and re-issue any requests that haven't gotten replies yet.
Currently gnbd has a kernel thread and a TCP socket for each opened block device. If either of these fail, the device is still opened. This is to allow modification of some parameters via ioctl.
There is a short and simple userland program to set the ip and port. Done with those ioctls.
Server ip and port can also be specified at module load. This uses the config option durring insmod. More details in the main.c file.
FreeBSD UFS/ZFS Snapshot
http://people.freebsd.org/~rse/snapshot/
Additionally, with the help of md(4) and mdconfig(8) you can mount UFS snapshots as read-only filesystems, too. For illustration purposes, look at this sample session where a snapshot of /var is created on UFS:
# echo "before" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /var/tmp/foo.txt
# test -d /var/.snap mkdir /var/.snap
# mount -u -o snapshot /var/.snap/test /var
# ls -l /var/.snap/test
-r-------- 1 root operator 2147483784 Sep 3 16:19 /var/.snap/test
# echo "after" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# mdconfig -a -t vnode -f /var/.snap/test -u 1
# mount -o ro /dev/md1 /mnt
# ls -l /mnt/tmp/foo.txt /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /mnt/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# cat /mnt/tmp/foo.txt /var/tmp/foo.txt
before
after
# umount /mnt
# mdconfig -d -u 1
# rm -f /var/.snap/test
The same session with /var on ZFS could look like this:
# echo "before" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /var/tmp/foo.txt
# zfs snapshot `zfs list -H -o name /var`@test
# ls -ld /var/.zfs/snapshot/test
drwxr-xr-x 23 root operator 23 Sep 3 16:19 /var/.zfs/snapshot/test
# echo "after" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# ls -l /var/.zfs/snapshot/test/tmp/foo.txt /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /mnt/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# cat /var/.zfs/snapshot/test/tmp/foo.txt /var/tmp/foo.txt
before
after
# zfs destroy `zfs list -H -o name /var`@test
Additionally, with the help of md(4) and mdconfig(8) you can mount UFS snapshots as read-only filesystems, too. For illustration purposes, look at this sample session where a snapshot of /var is created on UFS:
# echo "before" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /var/tmp/foo.txt
# test -d /var/.snap mkdir /var/.snap
# mount -u -o snapshot /var/.snap/test /var
# ls -l /var/.snap/test
-r-------- 1 root operator 2147483784 Sep 3 16:19 /var/.snap/test
# echo "after" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# mdconfig -a -t vnode -f /var/.snap/test -u 1
# mount -o ro /dev/md1 /mnt
# ls -l /mnt/tmp/foo.txt /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /mnt/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# cat /mnt/tmp/foo.txt /var/tmp/foo.txt
before
after
# umount /mnt
# mdconfig -d -u 1
# rm -f /var/.snap/test
The same session with /var on ZFS could look like this:
# echo "before" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /var/tmp/foo.txt
# zfs snapshot `zfs list -H -o name /var`@test
# ls -ld /var/.zfs/snapshot/test
drwxr-xr-x 23 root operator 23 Sep 3 16:19 /var/.zfs/snapshot/test
# echo "after" >/var/tmp/foo.txt
# ls -l /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# ls -l /var/.zfs/snapshot/test/tmp/foo.txt /var/tmp/foo.txt
-rw-r--r-- 1 root wheel 7 Sep 3 16:19 /mnt/tmp/foo.txt
-rw-r--r-- 1 root wheel 6 Sep 3 16:20 /var/tmp/foo.txt
# cat /var/.zfs/snapshot/test/tmp/foo.txt /var/tmp/foo.txt
before
after
# zfs destroy `zfs list -H -o name /var`@test
2008年1月10日 星期四
iscsi-target
目的是做模擬磁盤陣列櫃
三台服務器
01-----iscsi-target---192.168.0.1
02----iscsi-initiator--192.168.0.2
03----iscsi-initiator--192.168.0.3
首先去下載iscsi-target(下載地址自己google吧)!
有些喜歡下載源代碼包編譯安裝.有些喜歡下載src.rpm包.我就圖方便省事.直接下載了iscsi-target0.42.src.rpm.
安裝的環境是RHEL U4 內核為kernel-2.6.9.4.10_ELsmp x86_64
安裝步驟.
01# rpmbuild -ba iscsitarget-0.42.src.rpm
01# rpm -ivh /usr/src/redhat/RPMS/x86_64/iscsitarget*
01# vi /etc/ietd.conf
# iscsi target configuration
Target iqn.2000-12.com.digicola:storage.lun1
IncomingUser gfs secretsecret
OutgoingUser
Lun 0 Path=/dev/sdb,Type=fileio
Alias iDISK0
配置以上內容.
最後
01# /etc/init.d/iscsi-target start
01# netstat -an
檢查是否開啟3260端口
這樣iscsi-target就算配置完成了.
接下來配置iscsi-initiator
iscsi-initiator在RHEL系統上默認都安裝的.如果沒有請用查找iscsi-initiator的rpm包安裝
02#vi /etc/iscsi.conf
DiscoveryAddress=192.168.0.1
OutgoingUserName=gfs
OutgoingPassword=secretsecret
LoginTimeout=15
DiscoveryAddress=192.168.0.1
配置完成後
02#/etc/init.d/iscsi start
iscsi啟動成功.
fdisk -l
就能看到多一個分區.
03配置和02一樣.
配置成功後你就可以為所欲為了.哈哈.
三台服務器
01-----iscsi-target---192.168.0.1
02----iscsi-initiator--192.168.0.2
03----iscsi-initiator--192.168.0.3
首先去下載iscsi-target(下載地址自己google吧)!
有些喜歡下載源代碼包編譯安裝.有些喜歡下載src.rpm包.我就圖方便省事.直接下載了iscsi-target0.42.src.rpm.
安裝的環境是RHEL U4 內核為kernel-2.6.9.4.10_ELsmp x86_64
安裝步驟.
01# rpmbuild -ba iscsitarget-0.42.src.rpm
01# rpm -ivh /usr/src/redhat/RPMS/x86_64/iscsitarget*
01# vi /etc/ietd.conf
# iscsi target configuration
Target iqn.2000-12.com.digicola:storage.lun1
IncomingUser gfs secretsecret
OutgoingUser
Lun 0 Path=/dev/sdb,Type=fileio
Alias iDISK0
配置以上內容.
最後
01# /etc/init.d/iscsi-target start
01# netstat -an
檢查是否開啟3260端口
這樣iscsi-target就算配置完成了.
接下來配置iscsi-initiator
iscsi-initiator在RHEL系統上默認都安裝的.如果沒有請用查找iscsi-initiator的rpm包安裝
02#vi /etc/iscsi.conf
DiscoveryAddress=192.168.0.1
OutgoingUserName=gfs
OutgoingPassword=secretsecret
LoginTimeout=15
DiscoveryAddress=192.168.0.1
配置完成後
02#/etc/init.d/iscsi start
iscsi啟動成功.
fdisk -l
就能看到多一個分區.
03配置和02一樣.
配置成功後你就可以為所欲為了.哈哈.
訂閱:
文章 (Atom)