cinder nfs配置操作
Posted blog-lhong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cinder nfs配置操作相关的知识,希望对你有一定的参考价值。
cinder nfs配置操作
#####重启计算机服务 ###cinder 节点操作 yum install -y nfs-utils rpcbind mkdir -p /data/nfs echo ‘ /data/nfs *(rw,no_root_squash) ‘ >>/etc/exports #all_squash:将远程访问的所有普通用户及所属组都映射为匿名用户或用户组; #no_all_squash:访问用户先与本机用户匹配,匹配失败后再映射为匿名用户或用户组; #root_squash:将root用户及所属组都映射为匿名用户或用户组; #no_root_squash:来访的root用户保持root帐号权限; systemctl enable rpcbind nfs systemctl restart rpcbind nfs systemctl reload rpcbind nfs echo ‘[nfs] volume_driver = cinder.volume.drivers.nfs.NfsDriver nfs_shares_config = /etc/cinder/nfs_shares nfs_mount_point_base = $state_path/mnt volume_backend_name=nfs_volumes ‘ >>/etc/cinder/cinder.conf tail /etc/cinder/cinder.conf sed -i ‘s/^enabled_backends.*=/enabled_backends=nfs,/g‘ /etc/cinder/cinder.conf grep enabled_backends /etc/cinder/cinder.conf echo ‘localhost:/data/nfs‘ >/etc/cinder/nfs_shares chown root.cinder /etc/cinder/nfs_shares chmod 640 /etc/cinder/nfs_shares #chgrp cinder /etc/cinder/nfs_shares systemctl restart openstack-cinder-volume.service ####主节点 操作 source /root/admin-openrc.sh cinder service-list |grep nfs ##创建云硬盘类型,关联volum NFS cinder type-create nfs cinder type-key nfs set volume_backend_name=nfs_volumes #####删除 nfs 配置 sed -i ‘/[nfs]/,$d‘ /etc/cinder/cinder.conf tail /etc/cinder/cinder.conf sed -i ‘s/^enabled_backends = nfs,/enabled_backends=/g‘ /etc/cinder/cinder.conf grep enabled_backends /etc/cinder/cinder.conf rm -f /etc/cinder/nfs_shares systemctl restart openstack-cinder-volume.service source /root/admin-openrc.sh cinder service-list |grep nfs
以上是关于cinder nfs配置操作的主要内容,如果未能解决你的问题,请参考以下文章