RedHat GFS with GNBD
时间:2009-05-31 来源:djstava
一、环境:
OS:centos 5.1
三台普通PC,如下:
gnbd-server 192.168.12.146
gfs-1 192.168.12.98
gfs-2 192.168.12.145
二、修改/etc/hosts和/etc/sysconfig/network(gfs-1,gfs-2,gnbd-server)
修改/etc/hosts文件如下:
192.168.12.146 gnbd-server
192.168.12.98 gfs-1
192.168.12.145 gfs-2
修改/etc/sysconfig/network,设置相应的hostname
三、system-config-cluster产生配置文件cluster.conf(gnbd-server,需要x-window环境)
利用system-config-cluster简单快捷,添加三个节点:gnbd-server,gfs-1,gfs-2
将产生的cluster.conf文件scp到各个节点/etc/cluster/cluster.conf,重启机器。
四、启动服务(gfs-1,gfs-2,gnbd-server)
service cman start
service clvmd start
service gfs start
service rgmanager start
五、export分区(gnbd-server)
1、/sbin/gnbd_serv -v -n
2、gnbd_export -v -e gfs -d /dev/hda3
3、检查export结果:gnbd_export -v -l
六、节点import gnbd-server的分区(gfs-1,gfs-2)
1、modprobe gnbd
2、gnbd_import -v -i gnbd-server
3、检查import结果:gnbd_import -v -l
4、modprobe gfs
七、在客户端节点上建立gfs文件系统并挂载(gfs-1)
gfs_mkfs -p lock_dlm -t gfsTest:gfs -j 2 /dev/hda3
其中gfsTest为本集群的名称,gfs为文件系统的名称,lock_dlm为时钟协议
八、节点挂载gfs文件系统(gfs-1,gfs-2)
mount.gfs /dev/gnbd/gfs /mnt
九、停止服务(gfs-1,gfs-2,gnbd-server)
service rgmanager stop
service gfs stop
service clvmd stop
service cman stop
additional:
OS:centos 5.1
三台普通PC,如下:
gnbd-server 192.168.12.146
gfs-1 192.168.12.98
gfs-2 192.168.12.145
二、修改/etc/hosts和/etc/sysconfig/network(gfs-1,gfs-2,gnbd-server)
修改/etc/hosts文件如下:
192.168.12.146 gnbd-server
192.168.12.98 gfs-1
192.168.12.145 gfs-2
修改/etc/sysconfig/network,设置相应的hostname
三、system-config-cluster产生配置文件cluster.conf(gnbd-server,需要x-window环境)
利用system-config-cluster简单快捷,添加三个节点:gnbd-server,gfs-1,gfs-2
将产生的cluster.conf文件scp到各个节点/etc/cluster/cluster.conf,重启机器。
四、启动服务(gfs-1,gfs-2,gnbd-server)
service cman start
service clvmd start
service gfs start
service rgmanager start
五、export分区(gnbd-server)
1、/sbin/gnbd_serv -v -n
2、gnbd_export -v -e gfs -d /dev/hda3
3、检查export结果:gnbd_export -v -l
六、节点import gnbd-server的分区(gfs-1,gfs-2)
1、modprobe gnbd
2、gnbd_import -v -i gnbd-server
3、检查import结果:gnbd_import -v -l
4、modprobe gfs
七、在客户端节点上建立gfs文件系统并挂载(gfs-1)
gfs_mkfs -p lock_dlm -t gfsTest:gfs -j 2 /dev/hda3
其中gfsTest为本集群的名称,gfs为文件系统的名称,lock_dlm为时钟协议
八、节点挂载gfs文件系统(gfs-1,gfs-2)
mount.gfs /dev/gnbd/gfs /mnt
九、停止服务(gfs-1,gfs-2,gnbd-server)
service rgmanager stop
service gfs stop
service clvmd stop
service cman stop
additional:
What are the advantages/disadvantages to using GNBD versus iSCSI for exporting storage in a cluster?
The only real advantage of using GNBD is that it has built in fencing. With iSCSI, you still need some somthing to fence all the machines (unless your scsi target supports SCSI-3 persistent reservations). Theoretically, GNBD could run faster, since it doesn't need to do the work to imitate a SCSI device, but but there's a lot of work that needs to be done for GNBD to reach its full speed potential. Since there isn't much active development of GNBD and iSCSI has an active community of developers, if iSCSI isn't already faster than it, it eventually will be. . Using iSCSI also allows a much more seemless transition to a hardware shared storage solution later on.
If you don't have any fencing hardware, and your iSCSI target doesn't support SCSI-3 persistent reservations, then you should probably go with GNBD. Otherwise it's up to you. 相关阅读 更多 +