zoukankan      html  css  js  c++  java
  • 第 6 章 Cinder

    NFS Volume Provider(Part I)

     

    NFS 更多的应用在实验或小规模 cinder 环境,由于性能和缺乏高可用的原因在生产环境中不太可能使用,但是学习 NFS volume provider 的意义在于:

    1、理解 cinder-volume 如何支持多 backend

    2、更重要的,可以理解 cinder-volume,nova-compute 和 volume provider 是如何协同工作,共同为 instance 提供块存储。

    3、举一反三,能够快速理解并接入其他生产级 backend ,比如 Ceph,商业存储等。

     

    下图展示了 cinder、nova 是如何与 NFS volume provider 协调工作的:

    NFS Volume Provider

    就是通常说的 NFS Server,提供远程 NFS 目录,NFS Clinet 可以 mount 这些远程目录到本地,然后像使用本地目录一样创建、读写文件以及子目录。

    cinder-volume

    存储节点通过 NFS driver 管理 NFS volume provider 中的 volume,这些 volume 在 NFS 中实际上是一个个文件。

    nova-compute

    计算节点将 NFS volume provider 存放 volume 的目录 mount 到本地,然后将 volume 文件作为虚拟硬盘映射给 instance。

     

    这里有几点需要强调:

    1、在 Cinder 的 driver 架构中,运行 cinder-volume 的存储节点和 Volume Provider 可以是完全独立的两个实体。

    cinder-volume 通过 driver 与 Volume Provider 通信,控制和管理 volume。

    2、Instance 读写 volume 时,数据流不需要经过存储节点,而是直接对 Volume Provider 中的 volume 进行读写。

    正如上图所示,存储节点与 NFS Volume Provider 的连接只用作 volume 的管理和控制(绿色连线);

    真正的数据读写,是通过计算节点和 NFS Volume Proiver 之间的连接完成的(紫色连线)。

    这种设计减少了中间环节,存储节点不直接参与数据传输,保证了读写效率。

    3、其他 Volume Provider(例如 ceph,swift,商业存储等)均遵循这种控制流与数据流分离的设计。

     

     

    配置 NFS Volume Provider

    在实验环境中,NFS volume provider 的 NFS 远程目录为 10.12.28.8:/storage

    cinder-volume 服务节点上 mount point 为 /nfs_storage。

    在 /etc/cinder/cinder.conf 中添加 nfs backend

    1、enabled_backends = lvmdriver-1,nfs

    让 cinder-volume 使用 nfs backend

    2、[nfs] 中细配置 nfs backend。包括:

    a) 指定存储节点上 /nfs_storage 为 nfs 的 mount point。

    nfs_mount_point_base = /nfs_storage

    b) 查看 /etc/cinder/nfs_shares 活动 nfs 共享目录列表。nfs_shares_config = /etc/cinder/nfs_shares,其内容为

    10.12.28.8:/storage

    列表中只有 10.12.28.8:/storage。如果希望有多个 nfs 共享目录存放 volume,则可以添加到该文件中。

    c) nfs volume driver。

    volume_driver=cinder.volume.drivers.nfs.NfsDriver

    d) 设置 volume backend name。

    在 cinder 中需要根据这里的 volume_backend_name 创建对应的 volume type,这个非常重要。

    volume_backend_name = nfs

    3、重启 cinder-volume,cinder service-list 确认 nfs cinder-volume 服务正常工作。

    创建 nfs volume type

    打开GUI页面Admin -> Volume -> Volume Types,点击 “Create Volume Type”。

    命名 nfs,点击“Create Volume Type”。

    选择 nfs volume tyep,点击下拉菜单“View Extra Specs”

    点击“Create”,Key 输入 volume_backend_name ;Value 输入 nfs。

    ---------------------------------------------------------引用来自----------------------------------------------------------------

    https://www.cnblogs.com/CloudMan6/p/5683352.html

    https://mp.weixin.qq.com/s?__biz=MzIwMTM5MjUwMg==&mid=2653587707&idx=1&sn=609e98574ca5e83117bd9fde55d44f2a&chksm=8d3080e2ba4709f436dd2caf6ab8fc5b10a5a16b878921eb5ea4f1b5fd97f139623c540cff4d&scene=21#wechat_redirect

  • 相关阅读:
    PDO预处理语句规避SQL注入攻击
    单例模式
    接口测试框架-[pytest+requests+excel]读取excel表格+requests参数化+pytest测试报告
    git 常用命令
    测试基础
    jmeter 安装
    软件测试常用网址
    MAC下安装配置Tomcat
    python 第六十二章 Django orm 跨表查询
    python 第六十二章 Django cookie和session
  • 原文地址:https://www.cnblogs.com/gsophy/p/11089637.html
Copyright © 2011-2022 走看看