Shared File Systems service共享文件系统(manila):
安装配置manila服务(控制节点)
创建用户(manila)
openstack user create --domain default --password-prompt manila
将用户manila关联至租户(项目service)和role上:
openstack role add --project service --user manila admin
创建manila服务实体:
openstack service create --name manila --description "OpenStack Shared File Systems" share
openstack service create --name manilav2 --description "OpenStack Shared File Systems" sharev2
注:共享文件系统服务需要两个服务实体。
创建manila服务和manilav2端点(endpoint):
openstack endpoint create --region RegionOne share public http://con.colinshi.top:8786/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne share internal http://con.colinshi.top:8786/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne share admin http://con.colinshi.top:8786/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne sharev2 public http://con.colinshi.top:8786/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne sharev2 internal http://con.colinshi.top:8786/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne sharev2 admin http://con.colinshi.top:8786/v2/%\(tenant_id\)s
注:共享文件系统服务需要每个服务实体的配置一组端点(public, internal, admin)。
安装manila服务:
yum install openstack-manila python-manilaclient
编辑配置文件/etc/manila/manila.conf:
[DEFAULT]
transport_url = rabbit://rabbit:[email protected]
default_share_type = default_share_type
share_name_template = share-%s
rootwrap_config = /etc/manila/rootwrap.conf
api_paste_config = /etc/manila/api-paste.ini
auth_strategy = keystone
my_ip = 10.0.0.51
[database]
connection = mysql+pymysql://root:[email protected]/manila
[keystone_authtoken]
auth_uri = http://con.colinshi.top:5000
auth_url = http://con.colinshi.top:35357
memcached_servers = con.colinshi.top:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = manila
password = manila
[oslo_concurrency]
lock_path = /var/lock/manila
初始化heat服务的数据库:
su -s /bin/sh -c "manila-manage db sync" manila
启动manila服务,并将其配置为开机自启:
systemctl enable openstack-manila-api.service openstack-manila-scheduler.service
systemctl start openstack-manila-api.service openstack-manila-scheduler.service
安装配置manila服务(share节点):
安装manila服务:
yum install openstack-manila-share python2-PyMySQL
编辑配置文件/etc/manila/manila.conf:
[DEFAULT]
transport_url = rabbit://rabbit:[email protected]
default_share_type = default_share_type
rootwrap_config = /etc/manila/rootwrap.conf
auth_strategy = keystone
my_ip = 10.0.0.54
[database]
connection = mysql+pymysql://root:[email protected]/manila
[keystone_authtoken]
auth_uri = http://con.colinshi.top:5000
auth_url = http://con.colinshi.top:35357
memcached_servers = con.colinshi.top:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = manila
password = manila
[oslo_concurrency]
lock_path = /var/lock/manila
文件共享系统(选项1):没有支持文件共享服务器管理的驱动
安装LVM和NFS包:
yum install lvm2 nfs-utils nfs4-acl-tools portmap
启动LVM的metadata服务并且设置该服务随系统启动:
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
编辑配置文件/etc/lvm/lvm.conf:
devices {
filter = [ "a/sdb/", "r/.*/"]
注:在devices部分,添加一个过滤器,只接受/dev/sdb设备,拒绝其他所有设备,这里的设置同Block Storage Service(cinder)类似。
注:只有实例可以访问文件共享系统服务的卷组。但是,底层的操作系统也可以管理这些设备并将其与卷关联。默认情况下,LVM卷扫描工具会扫描/dev目录,查找包含卷的块存储设备。如果在他们的卷上有使用LVM的项目,扫描工具检测到这些卷时会尝试缓存它们,这可能会在底层操作系统和项目卷上产生各种问题。您必须重新配置LVM,让它只扫描包含cinder-volume和manila-volumes卷组的设备。
创建LVM 物理卷 /dev/sdb:
pvcreate /dev/sdb
创建LVM卷组manila-volumes:
vgcreate manila-volumes /dev/sdb
编辑配置文件/etc/manila/manila.conf:
[DEFAULT]
enabled_share_backends = lvm
enabled_share_protocols = NFS
[lvm]
share_backend_name = LVM
share_driver = manila.share.drivers.lvm.LVMShareDriver
driver_handles_share_servers = False
lvm_share_volume_group = manila-volumes
lvm_share_export_ip = 10.0.0.54
文件共享系统(选项2):有驱动支持的文件共享服务器管理:本选项需要(私有网络)的补充,同样也需要在节点上安装一些网络服务组件。
安装网络服务组件:
yum install openstack-neutron openstack-neutron-linuxbridge ebtables
编辑配置文件/etc/manila/manila.conf:
[DEFAULT]
enabled_share_backends = generic
enabled_share_protocols = NFS
[neutron]
url = http://con.colinshi.top:9696
auth_uri = http://con.colinshi.top:5000
auth_url = http://con.colinshi.top:35357
memcached_servers = con.colinshi.top:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
[nova]
auth_uri = http://con.colinshi.top:5000
auth_url = http://con.colinshi.top:35357
memcached_servers = con.colinshi.top:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova
[cinder]
auth_uri = http://con.colinshi.top:5000
auth_url = http://con.colinshi.top:35357
memcached_servers = con.colinshi.top:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = cinder
password = cinder
[generic]
share_backend_name = GENERIC
share_driver = manila.share.drivers.generic.GenericShareDriver
driver_handles_share_servers = True
service_instance_flavor_id = 100
service_image_name = manila-service-image
service_instance_user = manila
service_instance_password = manila
interface_driver = manila.network.linux.interface.BridgeInterfaceDriver
启动manila服务,并将其配置为开机自启:
systemctl enable openstack-manila-share.service target.service
systemctl start openstack-manila-share.service target.service
验证操作:
manila service-list
列出服务组件以验证是否每个进程都成功启动
注:mkdir /var/lib/manila,并赋予manila的权限。
安装完毕后能够提供NFS文件服务
参考资料:https://docs.openstack.org/keystone/pike/getting-started/index.html