OpenStack 安装文档(13)-- 数据库服务

Posted ksqinglong

tags:

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

数据库服务 — 安装和配置:

控制节点操作:

先决条件:

1、如下操作。

# mysql -u root -p***
> CREATE DATABASE trove;
> GRANT ALL PRIVILEGES ON trove.* TO ‘trove‘@‘localhost‘ IDENTIFIED BY ‘TROVE_DBPASS‘;
> GRANT ALL PRIVILEGES ON trove.* TO ‘trove‘@‘%‘ IDENTIFIED BY ‘TROVE_DBPASS‘;
> exit;
# . admin-openrc
# openstack user create --domain default --password-prompt trove
# openstack role add --project service --user trove admin
# openstack service create --name trove --description "Database" database
# openstack endpoint create --region RegionOne database public http://controller:8779/v1.0/%\(tenant_id\)s
# openstack endpoint create --region RegionOne database internal http://controller:8779/v1.0/%\(tenant_id\)s
# openstack endpoint create --region RegionOne database admin http://controller:8779/v1.0/%\(tenant_id\)s

安装并配置组件::

1、安装包。

# yum install -y openstack-trove openstack-trove-guestagent python-troveclient 
# cd /etc/trove/
# mv api-paste.ini api-paste.bak
# curl -o /etc/trove/api-paste.ini http://git.openstack.org/cgit/openstack/trove/plain/etc/trove/api-paste.ini

2、编辑 /etc/trove/trove.conf  文件和  /etc/trove/trove-taskmanager.conf  文件和  /etc/trove/trove-conductor.conf   文件。

[DEFAULT]
log_dir = /var/log/trove
trove_auth_url = http://controller:5000/v2.0
nova_compute_url = http://controller:8774/v2
cinder_url = http://controller:8776/v1
swift_url = http://controller:8080/v1/AUTH_
notifier_queue_hostname = controller
rpc_backend = rabbit

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

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

3、编辑 /etc/trove/trove.conf  文件。[DEFAULT]中的network_label_regex、api_paste_config为替换。

[DEFAULT]
auth_strategy = keystone
network_label_regex = 192.168.226.151
api_paste_config = /etc/trove/api-paste.ini

[keystone_authtoken]
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 = trove
password = TROVE_PASS

4、编辑  /etc/trove/trove-taskmanager.conf  文件。找到注释的内容再替换内容。

[DEFAULT]
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
# It proxys the token received from the user to send to nova
# via this admin users creds,
# basically acting like the client via that proxy token.
nova_proxy_admin_user = admin
nova_proxy_admin_pass = ADMIN_PASS
nova_proxy_admin_tenant_name = service
taskmanager_manager = trove.taskmanager.manager.Manager

5、编辑 /etc/trove/trove-guestagent.conf  文件。[DEFAULT]为我自己行添加,官方文档没添加这部分。

[DEFAULT]
rpc_backend = rabbit        # 官方文档没有这句
log_dir = /var/log/trove    # 官方文档没有这句
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
# It proxys the token received from the user to send to nova
# via this admin users creds,
# basically acting like the client via that proxy token.
nova_proxy_admin_user = admin
nova_proxy_admin_pass = ADMIN_PASS
nova_proxy_admin_tenant_name = service
trove_auth_url = http://controller:35357/v2.0

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack         # 官方文档没有这句
rabbit_password = RABBIT_PASS

[database]    # 官方文档没有这项
connection = mysql+pymysql://trove:[email protected]/trove

 

6、完成安装。

# su -s /bin/sh -c "trove-manage db_sync" trove
# mysql -utrove -pTROVE_DBPASS -hcontroller -t trove -e "show tables"
# systemctl enable openstack-trove-api openstack-trove-taskmanager openstack-trove-conductor
# systemctl start  openstack-trove-api openstack-trove-taskmanager openstack-trove-conductor

验证操作:

控制节点操作:

1、操作1。

# admin-openrc
# trove list
+----+------+-----------+-------------------+--------+-----------+------+
| id | name | datastore | datastore_version | status | flavor_id | size |
+----+------+-----------+-------------------+--------+-----------+------+
+----+------+-----------+-------------------+--------+-----------+------+

2、

# wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
# glance image-create --name "mysqlTest" --disk-format qcow2 --container-format bare --file CentOS-7-x86_64-GenericCloud.qcow2
# trove list

以上是关于OpenStack 安装文档(13)-- 数据库服务的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack 安装文档(08)-- 块存储服务

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

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

OpenStack-Ocata版的官方安装文档

Centos7.4安装openstack(queens)详细安装部署块存储服务

OpenStack 安装文档(11)-- 编排服务