设为首页 收藏本站
查看: 1239|回复: 0

[经验分享] openstack I版的搭建一十

[复制链接]

尚未签到

发表于 2018-6-2 08:29:02 | 显示全部楼层 |阅读模式
  计算节点和控制节点上都安装一下
  cd /etc/yum.repos.d/
  wget http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.3/CentOS/glusterfs-epel.repo
  yum install glusterfs-server
  验证一下两个节点是否安装成功
  [root@linux-node1 ~]# glusterfs -V
  glusterfs 3.4.5 built on Jul 24 2014 19:11:45
  Repository revision: git://git.gluster.com/glusterfs.git
  Copyright (c) 2006-2013 Red Hat, Inc. <http://www.redhat.com/>
  GlusterFS comes with ABSOLUTELY NO WARRANTY.
  It is licensed to you under your choice of the GNU Lesser
  General Public License, version 3 or any later version (LGPLv3
  or later), or the GNU General Public License, version 2 (GPLv2),
  in all cases as published by the Free Software Foundation.
  

  [root@linux-node2 yum.repos.d]# glusterfs -V
  glusterfs 3.4.5 built on Jul 24 2014 19:11:45
  Repository revision: git://git.gluster.com/glusterfs.git
  Copyright (c) 2006-2013 Red Hat, Inc. <http://www.redhat.com/>
  GlusterFS comes with ABSOLUTELY NO WARRANTY.
  It is licensed to you under your choice of the GNU Lesser
  General Public License, version 3 or any later version (LGPLv3
  or later), or the GNU General Public License, version 2 (GPLv2),
  in all cases as published by the Free Software Foundation.
  启动
  

  

  [root@linux-node1 ~]# /etc/init.d/gluster
  glusterd    glusterfsd
  [root@linux-node1 ~]# /etc/init.d/glusterd start
  Starting glusterd:                                         [确定]
  

  [root@linux-node2 ~]# /etc/init.d/glusterd start
  Starting glusterd:                                         [确定]
  

  

  [root@linux-node1 ~]# cat /etc/hosts
  127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  192.168.33.11 linux-node1.openstack.com linux-node1
  192.168.33.12 linux-node2.openstack.com linux-node2
  [root@linux-node2 ~]# cat /etc/hosts
  127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  192.168.33.12 linux-node2.openstack.com linux-node2
  192.168.33.11 linux-node1.openstack.com linux-node1




  [root@linux-node1 ~]# mkdir /data/gg1
  [root@linux-node2 ~]# mkdir /data/gg2
  咱们创建一个复制的卷,复制两份
  

  [root@linux-node2 ~]# gluster peer detach linux-node1.openstack.com
  peer detach: success
  [root@linux-node2 ~]# gluster peer status
  peer status: No peers present
  

把另外一个节点加入到集群
把node1加入集群


glusterfs无中心的,对等的。
  [root@linux-node2 ~]# gluster peer probe linux-node1.openstack.com
  peer probe: success
  [root@linux-node2 ~]# gluster peer status
  Number of Peers: 1
  

  Hostname: linux-node1.openstack.com
  Port: 24007
  Uuid: af7dd374-12c0-4201-8415-fe1a1e22f851
  State: Peer in Cluster (Connected)
  [root@linux-node2 ~]# gluster volume create demo replica 2 linux-node1.openstack.com:/data/gg1 linux-node2.openstack.com:/data/gg2 force
  volume create: demo: success: please start the volume to access data
  

  启动卷
  [root@linux-node2 ~]# gluster vol start demo
  volume start: demo: success
  

  我们查看一下,我们可以看到,你的数据是放两份的
  [root@linux-node2 ~]# gluster vol info
  Volume Name: demo
  Type: Replicate
  Volume ID: ced081c2-a4de-4f00-8260-5fc0fb36ea9f
  Status: Started
  Number of Bricks: 1 x 2 = 2
  Transport-type: tcp
  Bricks:
  Brick1: linux-node1.openstack.com:/data/gg1
  Brick2: linux-node2.openstack.com:/data/gg2
  

  我们要用这个卷,我们该怎么办?该修改配置文件
  1830gg
  volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
  1107
  glusterfs_shares_config=/etc/cinder/glusterfs_shares
  1120
  glusterfs_mount_point_base=$state_path/mnt
  

  

  我们要先把NFS卸载掉
  umount 192.168.33.11:/data/nfs
  查看一下
  mount
  

  重启一下cinder的相关服务
  [root@linux-node1 ~]# for i in {api,scheduler,volume};do /etc/init.d/openstack-cinder-$i restart;done
  停止 openstack-cinder-api:                                [确定]
  正在启动 openstack-cinder-api:                            [确定]
  停止 openstack-cinder-scheduler:                          [确定]
  正在启动 openstack-cinder-scheduler:                      [确定]
  停止 openstack-cinder-volume:                             [确定]
  正在启动 openstack-cinder-volume:                         [确定]
  [root@linux-node1 ~]# mount
  /dev/sda3 on / type ext4 (rw)
  proc on /proc type proc (rw)
  sysfs on /sys type sysfs (rw)
  devpts on /dev/pts type devpts (rw,gid=5,mode=620)
  tmpfs on /dev/shm type tmpfs (rw)
  /dev/sda1 on /boot type ext4 (rw)
  none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
  sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
  nfsd on /proc/fs/nfsd type nfsd (rw)
  192.168.33.11:/demo on /var/lib/cinder/mnt/4ac2acc000ff60653979b4a905bdecb3 type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
  

  

  创建云硬盘

DSC0000.jpg

DSC0001.jpg

DSC0002.jpg

  我们查看一下云硬盘都存在哪
  [root@linux-node1 ~]# cat /etc/cinder/glusterfs_shares
  192.168.33.11:/demo
  [root@linux-node1 ~]# mount
  /dev/sda3 on / type ext4 (rw)
  proc on /proc type proc (rw)
  sysfs on /sys type sysfs (rw)
  devpts on /dev/pts type devpts (rw,gid=5,mode=620)
  tmpfs on /dev/shm type tmpfs (rw)
  /dev/sda1 on /boot type ext4 (rw)
  none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
  sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
  nfsd on /proc/fs/nfsd type nfsd (rw)
  192.168.33.11:/demo on /var/lib/cinder/mnt/4ac2acc000ff60653979b4a905bdecb3 type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
  [root@linux-node1 ~]# ll /var/lib/cinder/mnt/4ac2acc000ff60653979b4a905bdecb3
  总用量 4
  -rw-rw-rw- 1 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9
  [root@linux-node1 ~]# ll /data/gg1/
  总用量 4
  -rw-rw-rw- 2 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9
  

  [root@linux-node2 ~]# ll /data/gg2/
  总用量 4
  -rw-rw-rw- 2 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9
  一共有三份
  挂载到虚拟机实例上
  

DSC0003.jpg

DSC0004.jpg

DSC0005.jpg

DSC0006.jpg

DSC0007.jpg

接下来,我们要对这块硬盘进行格式化
sudo fdisk /dev/vdb
DSC0008.jpg DSC0009.jpg

  sudo mkfs.ext3 /dev/vdb1

DSC00010.jpg

DSC00011.jpg

  本地文件系统是最好的。
  万兆网卡
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-505979-1-1.html 上篇帖子: 制作openstack 下篇帖子: openstack linux 虚拟机镜像制作
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表