OpenStack 安装文档(09)-- 文件共享系统服务

Posted ksqinglong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack 安装文档(09)-- 文件共享系统服务相关的知识,希望对你有一定的参考价值。

文件共享系统服务 — 安装并配置控制节点:

控制节点上操作:

    先决条件:

1、数据库相关操作。

# mysql -u root -p***
> CREATE DATABASE manila;
> GRANT ALL PRIVILEGES ON manila.* TO ‘manila‘@‘localhost‘ IDENTIFIED BY ‘MANILA_DBPASS‘;
> GRANT ALL PRIVILEGES ON manila.* TO ‘manila‘@‘%‘ IDENTIFIED BY ‘MANILA_DBPASS‘;
> exit;

2、添加用户相关操作。

# . admin-openrc
# openstack user create --domain default --password-prompt manila
# openstack role add --project service --user manila admin
# openstack service create --name manila --description "OpenStack Shared File Systems" share
# openstack service create --name manilav2 --description "OpenStack Shared File Systems" sharev2
# openstack endpoint create --region RegionOne share public http://controller:8786/v1/%\(tenant_id\)s
# openstack endpoint create --region RegionOne share internal http://controller:8786/v1/%\(tenant_id\)s
# openstack endpoint create --region RegionOne share admin http://controller:8786/v1/%\(tenant_id\)s
# openstack endpoint create --region RegionOne sharev2 public http://controller:8786/v2/%\(tenant_id\)s
# openstack endpoint create --region RegionOne sharev2 internal http://controller:8786/v2/%\(tenant_id\)s
# openstack endpoint create --region RegionOne sharev2 admin http://controller:8786/v2/%\(tenant_id\)s

    安装并配置组件:

1、安装包。

# yum install -y openstack-manila python-manilaclient

2、编辑  /etc/manila/manila.conf  文件,添加或修改内容。

[database]
connection = mysql+pymysql://manila:[email protected]/manila

[DEFAULT]
rpc_backend = rabbit
default_share_type = default_share_type
rootwrap_config = /etc/manila/rootwrap.conf
auth_strategy = keystone
my_ip = 192.168.226.151

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

[keystone_authtoken]
memcached_servers = controller:11211
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = manila
password = MANILA_PASS

[oslo_concurrency]
lock_path = /var/lib/manila/tmp

3、同步文件分享系统的数据库

# su -s /bin/sh -c "manila-manage db sync" manila
# mysql -umanila -pMANILA_DBPASS -hcontroller -t manila -e "show tables"

4、启动文件分享服务并设置随系统启动。

# systemctl enable openstack-manila-api openstack-manila-scheduler
# systemctl start  openstack-manila-api openstack-manila-scheduler

文件共享系统服务 — 安装并配置一个分享节点:

在分享节点上操作(计算节点代替分享节点):

    安装并配置组件:

1、安装包。

# yum install -y openstack-manila-share python2-PyMySQL

2、编辑  /etc/manila/manila.conf  文件。添加或修改内容。

[database]
connection = mysql://manila:[email protected]/manila

[DEFAULT]
rpc_backend = rabbit
default_share_type = default_share_type
rootwrap_config = /etc/manila/rootwrap.conf
auth_strategy = keystone
my_ip = 192.168.226.152

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

[keystone_authtoken]
memcached_servers = controller:11211
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = manila
password = MANILA_PASS

[oslo_concurrency]
lock_path = /var/lib/manila/tmp

文件共享系统服务 — 配置共享服务器管理支持选项,这里选有驱动支持的文件共享服务器管理进行演示(没有支持文件共享服务器管理的驱动):

在分享节点上操作(计算节点代替分享节点):

安装并配置组件:

1、安装包

# yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables 

2、编辑  /etc/manila/manila.conf  文件。添加或修改内容。[generic]添加在最后。

[DEFAULT]
enabled_share_backends = generic
enabled_share_protocols = NFS,CIFS

[neutron]
url = http://controller:9696
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS

[nova]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS

[cinder]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = cinder
password = CINDER_PASS

[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

 

安装完成:

1、启动文件共享系统服务及其依赖的服务,并将其配置为随系统启动。

# systemctl enable openstack-manila-share
# systemctl start  openstack-manila-share

文件共享系统服务 — 验证服务:

在控制节点上操作:

1、验证操作。

# . admin-openrc
# manila service-list
+----+------------------+------------------+------+---------+-------+----------------------------+
| Id | Binary           | Host             | Zone | Status  | State | Updated_at                 |
+----+------------------+------------------+------+---------+-------+----------------------------+
| 1  | manila-scheduler | controller       | nova | enabled | up    | 2018-03-27T15:58:42.000000 |
| 2  | manila-share     | [email protected] | nova | enabled | up    | 2018-03-27T15:58:40.000000 |
+----+------------------+------------------+------+---------+-------+----------------------------+ 

以上是关于OpenStack 安装文档(09)-- 文件共享系统服务的主要内容,如果未能解决你的问题,请参考以下文章

Openstack 安装部署指南翻译系列 之 Manila服务安装(Share Storage)

openstack-mitaka文件共享服务(controller安装与部署)

openstack-mitaka文件共享服务(blockstorage配置)

OpenStack 搭建

初识openstack之——安装Image

云计算|OpenStack|社区版OpenStack安装部署文档(二---OpenStack运行环境搭建)