openstack I版的搭建一十--基于glusterfs的云硬盘

计算节点和控制节点上都安装一下

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

验证一下两个节点是否安装成功

[[email protected] ~]# 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.

[[email protected] 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.

启动

[[email protected] ~]# /etc/init.d/gluster

glusterd    glusterfsd

[[email protected] ~]# /etc/init.d/glusterd start

Starting glusterd:                                         [确定]

[[email protected] ~]# /etc/init.d/glusterd start

Starting glusterd:                                         [确定]

[[email protected] ~]# 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

[[email protected] ~]# 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

[[email protected] ~]# mkdir /data/gg1

[[email protected] ~]# mkdir /data/gg2

咱们创建一个复制的卷,复制两份

[[email protected] ~]# gluster peer detach linux-node1.openstack.com

peer detach: success

[[email protected] ~]# gluster peer status

peer status: No peers present

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

把node1加入集群

glusterfs无中心的,对等的。

[[email protected] ~]# gluster peer probe linux-node1.openstack.com

peer probe: success

[[email protected] ~]# 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)

[[email protected] ~]# 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

启动卷

[[email protected] ~]# gluster vol start demo

volume start: demo: success

我们查看一下,我们可以看到,你的数据是放两份的

[[email protected] ~]# 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的相关服务

[[email protected] ~]# 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:                         [确定]

[[email protected] ~]# 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)

创建云硬盘

我们查看一下云硬盘都存在哪

[[email protected] ~]# cat /etc/cinder/glusterfs_shares

192.168.33.11:/demo

[[email protected] ~]# 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)

[[email protected] ~]# ll /var/lib/cinder/mnt/4ac2acc000ff60653979b4a905bdecb3

总用量 4

-rw-rw-rw- 1 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9

[[email protected] ~]# ll /data/gg1/

总用量 4

-rw-rw-rw- 2 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9

[[email protected] ~]# ll /data/gg2/

总用量 4

-rw-rw-rw- 2 root root 1073741824 8月  27 15:58 volume-ca55ee76-956c-4fb6-96ce-d0a5d1f45aa9

一共有三份

挂载到虚拟机实例上

接下来,我们要对这块硬盘进行格式化

sudo fdisk /dev/vdb

sudo mkfs.ext3 /dev/vdb1

本地文件系统是最好的。

万兆网卡

时间: 2024-10-17 07:16:06

openstack I版的搭建一十--基于glusterfs的云硬盘的相关文章

openstack I版的搭建二

[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# cd keystone-2014.1 [[email protected] keystone-2014.1]# python setup.py install [[email protected] keystone-2014.1]# cd etc/ [[email protected] etc]# ll 总用量 72 -rw-rw-r-- 1 1004 1004

openstack I版的搭建六--

[[email protected] init.d]# chkconfig openstack-neutron-linuxbridge-agent on [[email protected] init.d]# chkconfig openstack-nova-compute on [[email protected] ~]# nova host-list +---------------------------+-------------+----------+ | host_name    

openstack I版的搭建四--

[[email protected]]# cd /usr/local/src/neutron-2014.1 [[email protected] neutron-2014.1]# python setup.py install [[email protected] etc]# pwd /usr/local/src/neutron-2014.1/etc [[email protected] etc]# mkdir /etc/neutron [[email protected] etc]# mkdi

openstack I版的搭建五--

登陆 用户demo登陆 如果你在启动某个服务的时候,没启动起来,没日子 那么我们就手动启动一下. [[email protected] ~]# neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini 这样的

openstack I版的搭建三--Nova

安装Nova [[email protected] src]# cd ~ [[email protected] ~]# cd /usr/local/src/nova-2014.1 [[email protected] nova-2014.1]# python setup.py install [[email protected] nova]# pwd /usr/local/src/nova-2014.1/etc/nova [ro[email protected] nova]# ll 总用量 48

openstack I版的搭建八--

[[email protected] ~]# ifconfig brq39513fa0-54 Link encap:Ethernet  HWaddr 00:0C:29:3B:15:9F inet addr:192.168.33.11  Bcast:192.168.33.255  Mask:255.255.255.0 inet6 addr: fe80::48c3:d8ff:fe32:61b4/64 Scope:Link UP BROADCAST RUNNING MULTICAST  MTU:150

openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三

openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 二 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四 以下操作在控制节点执行control

OpenStack pike版 安装openstack服务(4) 续安装openstack服务(3) &nbsp; &nbsp;

Compute service overview 计算服务概述 OpenStack用于对主机的计算和管理云计算系统.OpenStack的计算是一个基础设施即服务(IaaS)系统的一个重要组成部分.主要模块是用python实现的. OpenStack计算与OpenStack身份验证交互用来完成认证:OpenStack镜像服务用于磁盘和服务器镜像:用户和管理接口为OpenStack Dashboard.镜像访问受到项目和用户的限制,每个项目的配额是有限的(例如,实例的数量).OpenStack计算可

【openstack N版】——认证服务keystone

一. 基础环境 1.1环境介绍 linux-node1(控制节点) 1 #系统版本 2 [[email protected] ~]# cat /etc/redhat-release 3 CentOS Linux release 7.2.1511 (Core) 4 #内核版本 5 [[email protected] ~]# uname -r 6 3.10.0-327.36.3.el7.x86_64 7 #主机名 8 [[email protected] ~]# hostname 9 linux-