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