码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-03-30 01:15:04      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:api   start   nan   proxy   min   creat   asto   lis   style   

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

控制节点操作:

先决条件:

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:TROVE_DBPASS@controller/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:TROVE_DBPASS@controller/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)-- 数据库服务

标签:api   start   nan   proxy   min   creat   asto   lis   style   

原文地址:https://www.cnblogs.com/ksqinglong/p/8673265.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!