码迷,mamicode.com
首页 > 其他好文 > 详细

cinder nfs配置操作

时间:2019-10-26 15:33:53      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:bind   poi   led   chown   utils   etc   -o   min   ash   

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配置操作

标签:bind   poi   led   chown   utils   etc   -o   min   ash   

原文地址:https://www.cnblogs.com/blog-lhong/p/11743108.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!