openstack 对接 NFS 存储

NFS 服务器端
1. 安装NFS 服务
# yum install -y rpcbind nfs-utils
2. iptables端口设置
# iptables -I INPUT -p tcp --dport 111 -j ACCEPT
# iptables -I INPUT -p tcp --dport 2049 -j ACCEPT
# iptables -I INPUT -p udp --dport 111 -j ACCEPT
# iptables -I INPUT -p udp --dport 2046 -j ACCEPT
# iptables-save > /etc/sysconfig/iptables
3. 关闭防火墙
# systemctl stop firewalld.service
# systemctl disable firewalld.service
4. 启动nfs服务并设置开机自启动
# systemctl start rpcbind
# systemctl start nfs
# systemctl enable rpcbind.service
# systemctl enable nfs-server.service
5. 创建共享目录
# mkdir /home/nfsshares
# chmod 777 -R /home/nfsshares
6. 编辑exports文件,添加客户端
# vim /etc/exports
输入
/home/nfsshares *(rw,insecure,sync,no_root_squash)
7. 检查
# showmount -e 10.10.129.83
Export list for 10.10.129.83 :
/home *

------------------------------------------------------

NFS 客户端
0。 管理节点 创建存储类型:
# source keystonerc_admin
# cinder type-create nfs1
# cinder type-key nfs1 set volume_backend_name= nfs1

计算节点添加相关配置
1。修改 /etc/cinder/cinder.conf
(1) 添加
[ nfs1 ]
nfs_used_ratio=0.95
nfs_oversub_ratio=1.0
volume_driver=cinder.volume.drivers.nfs.NfsDriver
nfs_shares_config=/etc/cinder/ nfsshares
volume_backend_name= nfs1
(2) 修改并添加:
enabled_backends = ..., nfs1

2。/etc/cinder/ nfsshares
(1) 添加
10.10.129.83:/home
(2) 修改文件属性:
# chown root:cinder /etc/cinder/nfsshares
# chown 0640 /etc/cinder/nfsshares

3。 重启cinder-volume服务
# systemctl restart openstack-cinder-volume.service

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

hNicholas

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

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

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

打赏作者

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

抵扣说明:

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

余额充值