您好,登录后才能下订单哦!
如何实现基于cman+rgmanage+gfs2+iscsi+rbd 高可用文件共享环境搭建,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
说明:rbd以iscsi方式导出作为共享存储。Iscsi target为10.20.18.111 iscsi intinator为10.20.15.163和10.20.15.164。cman+rgmanager管理nfs-server集群,gfs2为集群文件系统,管理集群内文件的并行操作。
# rpm –ivh scsi-target-utils-1.0.38-48.bf6981.ceph.el6.x86_64.rpm # service tgtd start
# sudo tgtadm --lld iscsi --op show --mode system System: State: ready debug: off LLDs: iser: error iscsi: ready Backing stores: rbd (bsoflags sync:direct) rdwr (bsoflags sync:direct) ssc null bsg sg sheepdog Device types: passthrough tape changer controller osd cd/dvd disk iSNS: iSNS=Off iSNSServerIP= iSNSServerPort=3205 iSNSAccessControl=Off
#vi /etc/tgt/targets.conf <target iqn.2015-05.rbdstore.example.com:iscsi> driver iscsi bs-type rbd backing-store iscsi/iscsi-rbd # <iscsi-pool>/<iscsi-rbd-image> </target>
# service tgtd reload Updating target framework daemon configuration
# yum install iscsi-initiator-utils
# iscsiadm -m discovery -t sendtargets -p 10.20.18.111 10.20.18.111:3260,1 iqn.2015-04.rbdstore.example.com:iscsi
# iscsiadm -m node -T iqn.2014-04.rbdstore.example.com:iscsi -p 10.20.18.111:3260 –loginLogging in to [iface: default, target: iqn.2014-04.rbdstore.example.com:iscsi, portal: 192.168.1.102,3260] (multiple) Login to [iface: default, target: iqn.2014-04.rbdstore.example.com:iscsi, portal: 192.168.1.102,3260] successful.
fdisk –l Disk /dev/sda: 1073 MB, 1073741824 bytes 34 heads, 61 sectors/track, 1011 cylinders Units = cylinders of 2074 * 512 = 1061888 bytes Sector size (logical/physical): 512 bytes / 4194304 bytes I/O size (minimum/optimal): 4194304 bytes / 4194304 bytes Disk identifier: 0x00000000
# vi /etc/hosts 10.20.15.165 DEV-L0003557 10.20.15.163 CNSZOSD01
# ssh-keygen -t rsa -P "" # ssh-copy-id -i .ssh/id_rsa.pub root@ CNSZOSD01
(两个节点都配置)
# yum install cman rgmager -y
# ccs_tool create tcluster # ccs_tool addnode CNSZOSD01-n 1 # ccs_tool addnode DEV-L0003557-n 2 # vi /etc/cluster/cluster.conf <dlm enable_fencing="0"/>
# scp /etc/cluster/cluster.conf initiator2:/etc/cluster/
# service cman start # service rgmanager start
# clustat Cluster Status for tcluster @ Fri May 8 13:53:40 2015 Member Status: Quorate Member Name ID Status ------ ---- ---- ------ CNSZOSD01 1 Online DEV-L0003557 2 Online, Local
# yum install gfs2-utils
# mkfs.gfs2 -j 2 -p lock_dlm -t tcluster:sda dev/sda
备注:gfs为日志文件系统,每个节点都要有一个日志,本次实验有两个节点,所以创建两个日志。tcluster为集群名称、sda为锁表名称。
# mount –t gfs2 –o _netdev,nodiratime,noatime /dev/sda /mnt
# yum install -y lvm2-cluster
# lvmconf --enable-cluster
# service clvmd start
# pvcreate /dev/sda 创建物理卷 # vgcreate clustervg /dev/sda 创建卷组 # lvcreate -L 500M -n clusterlv clustervg 创建逻辑卷 # mkfs.gfs2 -j 2 -p lock_dlm -t tcluster:lv /dev/clustervg/clusterlv # mount /dev/clustervg/clusterlv /mnt
# yum -y install nfs-utils rpcbind # yum install nfs-utils
2. NFS的配置文件定义: /etc/exports
# vim /etc/exports /mnt 10.20.*.*(rw,no_root_squash,no_all_squash,sync)
注:配置文件说明:
/mnt 为共享的目录,即rbd所挂目录,使用绝对路径.10.20.*.*允许客户端访问的IP,()里面为权限控制。
# service rpcbind start # service nfs start
# mkdir /usr/local/nfstest
#配置生效
# exportfs -rv
# showmount -e 10.20.16.177
# mount -t nfs 10.20.16.177:/mnt /usr/local/nfstest
# yum install samba samba-client samba-swat
(无需客户端密码验证的简单配置)
# vi /etc/samba/smb.conf [global] //该设置与Samba服务整体运行环境有关,它的设置项目针对所有共享资源
# ----------------------- Network Related Options ------------------------- # # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH # # server string is the equivalent of the NT Description field # # netbios name can be used to specify a server name not tied to the hostname workgroup = WORKGROUP //定义工作组,也就是windows中的工作组概念 server string = David Samba Server Version %v //定义Samba服务器的简要说明 netbios name = DavidSamba //定义windows中显示出来的计算机名称 # --------------------------- Logging Options ----------------------------- # # Log File let you specify where to put logs and how to split them up. log file = /var/log/samba/log.%m //定义Samba用户的日志文件,%m代表客户端主机名 //Samba服务器会在指定的目录中为每个登陆主机建立不同的日志文件 # ----------------------- Standalone Server Options ------------------------ # # Scurity can be set to user, share(deprecated) or server(deprecated) security = share //共享级别,用户不需要账号和密码即可访问 #============================ Share Definitions ============================== [public] //设置针对的是共享目录个别的设置,只对当前的共享资源起作用 comment = Public Stuff //对共享目录的说明文件,自己可以定义说明信息 path = /mnt //用来指定共享的目录,必选项 public = yes //所有人可查看,等效于guest ok = yes
\\10.20.15.163\public
关于如何实现基于cman+rgmanage+gfs2+iscsi+rbd 高可用文件共享环境搭建问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。