企业自建私有云-openstack-cinder块存储(计算节点)

  1. 安装服务相关的软件包(计算节点)

    yum -y install openstack-cinder targetcli python-keystone openstack-utils python-openstackclient  python2-PyMySQL python-memcached
    
    #cinder-volume服务运行在3个计算节点,使用ceph的话进行安装
    yum install -y ceph-common
    
  2. 修改配置文件((计算节点)

    配置cinder 配置文件

    #备份配置文件/etc/cinder/cinder.conf
    cp -a /etc/cinder/cinder.conf{,.bak}
    grep -Ev '#|^$' 
    /etc/cinder/cinder.conf.bak>/etc/cinder/cinder.conf
    
    vi /etc/cinder/cinder.conf
    [DEFAULT]
    my_ip = 管理网卡ip
    default_volume_type = ceph
    transport_url = rabbit://openstack:RABBIT_CXK_PASS@openstack-controller01:5672,openstack:RABBIT_CXK_PASS@openstack-controller02:5672,openstack:RABBIT_CXK_PASS@openstack-controller03:5672
    auth_strategy = keystone
    enabled_backends = ceph
    #enabled_backends = ceph,lvm,ssd,sata,nfs
    glance_api_version = 2 
    log_dir = /var/log/cinder
    debug=true
    
    #备份服务
    backup_driver = cinder.backup.drivers.ceph
    backup_ceph_conf = /etc/ceph/ceph.conf
    backup_ceph_user = cinder-backup
    backup_ceph_chunk_size = 4194304
    backup_ceph_pool = backups
    backup_ceph_stripe_unit = 0
    backup_ceph_stripe_count = 0
    restore_discard_excess_bytes = true
    
    [database]
    connection = mysql+pymysql://cinder:CINDER_CXK_DBPASS@192.168.188.29/cinder
    
    [keystone_authtoken]
    www_authenticate_uri = http://vip:5000
    auth_url = http://vip:5000
    cache = true
    token_cache_time = 3600
    memcached_servers = openstackcontroller1ip:11211,openstackcontroller2ip:11211,openstackcontroller3ip:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = cinder
    password = CINDER_CXK_PASS
    
    [oslo_concurrency]
    lock_path = /var/lib/cinder/tmp
    
    [ceph]
    volume_driver = cinder.volume.drivers.rbd.RBDDriver
    default_volume_type = ceph
    #标识
    volume_backend_name = ceph
    rbd_pool = volumes
    rbd_ceph_conf = /etc/ceph/ceph.conf
    rbd_flatten_volume_from_snapshot = false
    rbd_max_clone_depth = 5
    rbd_store_chunk_size = 4
    rados_connect_timeout = -1
    rbd_user = cinder
    #注意替换cinder用户访问ceph集群使用的Secret UUID
    #查看virsh secret-list
    rbd_secret_uuid = 77b54383-2456-4cb7-ac90-2c3754fc814f
    
    #[ssd]
    #volume_driver = #cinder.volume.drivers.lvm.LVMVolumeDriver
    #卷组
    #volume_group = cinder-ssd
    #target_protocol = iscsi
    #target_helper = lioadm
    #标识
    #volume_backend_name = ssd
    #[sata]
    #volume_driver = #cinder.volume.drivers.lvm.LVMVolumeDriver
    #卷组
    #volume_group = cinder-sata
    #target_protocol = iscsi
    #target_helper = lioadm
    #标识
    #volume_backend_name = sata
    
    #[nfs]
    #volume_driver = cinder.volume.drivers.nfs.NfsDriver
    #nfs_shares_config = /etc/cinder/nfs_shares
    #标识
    #volume_backend_name = nfs
    
  3. 启动并验证((计算节点)

    systemctl start openstack-cinder-volume.service target.service openstack-cinder-backup.service
    systemctl status openstack-cinder-volume.service target.service openstack-cinder-backup.service
    systemctl enable  nopenstack-cinder-volume.service target.service openstack-cinder-backup.service
    
  4. 验证(在控制节点上操作)

    source /sh/admin-openstack.sh
    
    #列出服务组件以验证每个进程是否成功启动:
    openstack volume service list
    

喜欢的亲可以关注点赞评论哦!以后每天都会更新的哦!本文为小编原创文章; 文章中用到的文件、安装包等可以加小编联系方式获得;
欢迎来交流小编联系方式VX:CXKLittleBrother 进入运维交流群

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

含义小哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值