OpenStack(Queens)搭建之Trove-Controller节点
一:创建trove数据库并授权
mysql -uroot -p CREATE DATABASE trove; GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'localhost' IDENTIFIED BY 'trove';
GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'%' IDENTIFIED BY 'trove';
二:安装trove组件
yum install openstack-trove python-troveclient
三:获取admin用户的环境变量,并创建服务认证
source /root/admin-openrc
四:创建trove用户
openstack user create --domain default --password-prompt trove
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | fdb0f541e28141719b6a43c8944bf1fb |
| name | trove |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
trove密码随意写
五:把admin用户添加到trove用户和项目中
openstack role add --project service --user trove admin
六:创建trove服务
openstack service create --name trove \
--description "Database" database
+-------------+-----------------------------------+
| Field | Value |
+-------------+-----------------------------------+
| description | Database |
| enabled | True |
| id | 727841c6f5df4773baa4e8a5ae7d72eb |
| name | trove |
| type | database |
+-------------+-----------------------------------+
七:创建镜像服务API端点
openstack endpoint create --region RegionOne \ database public http://controller:8779/v1.0/%\(tenant_id\)s +--------------+----------------------------------------------+ | Field | Value | +--------------+----------------------------------------------+ | enabled | True | | id | 3f4dab34624e4be7b000265f25049609 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 727841c6f5df4773baa4e8a5ae7d72eb | | service_name | trove | | service_type | database | | url | http://controller:8779/v1.0/%\(tenant_id\)s | +--------------+----------------------------------------------+
openstack endpoint create --region RegionOne
database internal http://controller:8779/v1.0/%(tenant_id)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 9489f78e958e45cc85570fec7e836d98 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 727841c6f5df4773baa4e8a5ae7d72eb |
| service_name | trove |
| service_type | database |
| url | http://controller:8779/v1.0/%(tenant_id)s |
+--------------+----------------------------------------------+
openstack endpoint create --region RegionOne
database admin http://controller:8779/v1.0/%(tenant_id)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 76091559514b40c6b7b38dde790efe99 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 727841c6f5df4773baa4e8a5ae7d72eb |
| service_name | trove |
| service_type | database |
| url | http://controller:8779/v1.0/%(tenant_id)s |
+--------------+----------------------------------------------+
八:编辑 /etc/trove/trove.conf,/etc/trove/taskmanager.conf,trove-conductor.conf ,trove-guestagent.conf
[root@controller ~]# egrep -v "^$|^#" /etc/trove/trove.conf [DEFAULT] log_dir = /var/log/trove log_file = trove-api.log 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_ #环境有swift配置此项 notifier_queue_hostname = controller rpc_backend = rabbit auth_strategy = keystone add_addresses = True network_label_regex = .* #网络使用neutron配置此项 api_paste_config = /etc/trove/api-paste.ini default_datastore = mysql [database] connection = mysql+pymysql://trove:trove@controller/trove [oslo_messaging_rabbit] rabbit_host = controller rabbit_userid = openstack rabbit_password = openstack [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 cache = true token_cache_time = 3600
root@controller trove]# egrep -v "^$|^#" /etc/trove/trove-conductor.conf
[DEFAULT]
log_dir = /var/log/trove
log_file = trove-conductor.log
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_ #环境有 swift 配置此项
notifier_queue_hostname = controller
rpc_backend = rabbit
[database]
connection = mysql+trove@controller/trove
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = openstack
[keystone_authtoken]
token_cache_time = 3600
cache = true[root@controller trove]# egrep -v "^$|^#" /etc/trove/trove-taskmanager.conf
[DEFAULT]
log_dir = /var/log/trove
log_file = trove-taskmanager.log
trove_auth_url = http://controller:5000/v2.0
nova_compute_url = http://controller:8774/v2
swift_url = http://controller:8080/v1/AUTH_ #环境有 swift 配置此项
notifier_queue_hostname = controller
rpc_backend = rabbit
nova_proxy_admin_user = admin
nova_proxy_admin_pass = admin
nova_proxy_admin_tenant_name = service
taskmanager_manager = trove.taskmanager.manager.Manager
network_driver = trove.network.neutron.NeutronDriver
guest_config = /etc/trove/trove-guestagent.conf
guest_info = guest_info
injected_config_location = /etc/trove/
cloudinit_location = /etc/trove/cloudinit
trove_security_groups_support = False
[database]
connection = mysql+trove@controller/trove
[oslo_messaging_rabbit]
rabbit_hosts = controller
rabbit_userid = openstack
rabbit_password = openstack[root@controller trove]# egrep -v "^$|^#" /etc/trove/trove-guestagent.conf
[DEFAULT]
log_dir = /var/log/trove/
log_file = trove-guestagent.log
rpc_backend=rabbit
nova_proxy_admin_user = admin
nova_proxy_admin_pass = admin
nova_proxy_admin_tenant_name = service
swift_url = http://192.168.14.1:8080/v1/AUTH_ #环境有 swift 配置此项,此配置文件会注入 trove 镜像,trove 内部没有本地解析,
rpc_backend = rabbit
[oslo_messaging_rabbit]
rabbit_host= 172.30.200.10
rabbit_userid = openstack
rabbit_password = openstack
九:同步数据库
su -s /bin/sh -c "trove-manage db sync" trove
十:开启Ttove服务,并设置开机自启动
systemctl enable openstack-trove-api.service \ openstack-trove-taskmanager.service \ openstack-trove-conductor.service
systemctl start openstack-trove-api.service
openstack-trove-taskmanager.service
openstack-trove-conductor.service
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于