Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying the Trove Database Service on OpenStack Train

Tech May 16 1

Environment Specifications

Operating System: CentOS Linux release 7.9.2009 (Core)

OpenStack Release: Train

Installing Trove Packages

Execute the package installation command on the controller node to deploy the necessary Trove components.

yum install -y openstack-trove-guestagent openstack-trove python-troveclient openstack-trove-ui

Database and Service Credential Configuration

Access the database server to create the Trove database and grant appropriate access rights.

mysql -u root -p
CREATE DATABASE trove;
GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'localhost' IDENTIFIED BY 'TroveDBPass123';
GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'%' IDENTIFIED BY 'TroveDBPass123';
FLUSH PRIVILEGES;
exit;

Create the service user and API endpoints in Keystone.

openstack user create --domain default --password TroveUserPass123 trove
openstack role add --project service --user trove admin
openstack service create --name trove --description "Database as a Service" database

openstack endpoint create --region RegionOne database public http://ctrl-node:8779/v1.0/%\(tenant_id\)s
openstack endpoint create --region RegionOne database internal http://ctrl-node:8779/v1.0/%\(tenant_id\)s
openstack endpoint create --region RegionOne database admin http://ctrl-node:8779/v1.0/%\(tenant_id\)s

Trove Configuration Files

Navigate to /etc/trove/ and edit the following configuration files. Ensure that database connection strings, RabbitMQ details, and authentication URLs reflect the specific environment parameters.

trove-conductor.conf

[DEFAULT]
log_dir = /var/log/trove
log_file = trove-conductor.log
trove_auth_url = http://ctrl-node:5000/v3/
notifier_queue_hostname = ctrl-node
nova_proxy_admin_user = admin
nova_proxy_admin_pass = AdminSecurePass
nova_proxy_admin_tenant_name = admin
rpc_backend = rabbit

[oslo_messaging_rabbit]
rabbit_host = ctrl-node
rabbit_userid = openstack
rabbit_password = RabbitMQPass123

[database]
connection = mysql://trove:TroveDBPass123@ctrl-node/trove

trove.conf

[DEFAULT]
log_dir = /var/log/trove
log_file = trove-api.log
trove_auth_url = http://ctrl-node:5000/v3/
notifier_queue_hostname = ctrl-node
rpc_backend = rabbit
nova_proxy_admin_user = admin
nova_proxy_admin_pass = AdminSecurePass
nova_proxy_admin_tenant_name = admin
nova_compute_service_type = compute
cinder_service_type = volumev2
network_driver = trove.network.neutron.NeutronDriver
default_neutron_networks = 99887766-39a1-4336-8417-112233445566
auth_strategy = keystone
add_addresses = True
network_label_regex = .*
api_paste_config = api-paste.ini

[oslo_messaging_rabbit]
rabbit_host = ctrl-node
rabbit_userid = openstack
rabbit_password = RabbitMQPass123

[database]
connection = mysql://trove:TroveDBPass123@ctrl-node/trove

[keystone_authtoken]
auth_uri = http://ctrl-node:5000/v3/
auth_url = http://ctrl-node:5000/v3/
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = trove
password = TroveUserPass123

trove-guestagent.conf

[DEFAULT]
rpc_backend = rabbit
nova_proxy_admin_user = admin
nova_proxy_admin_pass = AdminSecurePass
nova_proxy_admin_tenant_id = a1b2c3d4-61e6-4c0d-8fbc-fd4e961ecee8
trove_auth_url = http://ctrl-node:5000/v3/
swift_url = http://ctrl-node:8080/v1/AUTH_a1b2c3d4-61e6-4c0d-8fbc-fd4e961ecee8
os_region_name = RegionOne
swift_service_type = object-store
log_file = trove-guestagent.log
rabbit_password = RabbitMQPass123
rabbit_host = 192.168.10.20
rabbit_userid = openstack
rabbit_port = 5672

[oslo_messaging_rabbit]
rabbit_host = 192.168.10.20
rabbit_userid = openstack
rabbit_password = RabbitMQPass123

trove-taskmanager.conf

[DEFAULT]
log_dir = /var/log/trove
log_file = trove-taskmanager.log
trove_auth_url = http://ctrl-node:5000/v3/
nova_compute_url = http://ctrl-node:8774/v2.1
notifier_queue_hostname = ctrl-node
rpc_backend = rabbit
nova_proxy_admin_user = admin
nova_proxy_admin_pass = AdminSecurePass
nova_proxy_admin_tenant_id = a1b2c3d4-61e6-4c0d-8fbc-fd4e961ecee8
taskmanager_manager = trove.taskmanager.manager.Manager
notification_driver = messagingv2
network_driver = trove.network.neutron.NeutronDriver
default_neutron_networks = 99887766-39a1-4336-8417-112233445566
network_label_regex = .*
guest_config = /etc/trove/trove-guestagent.conf
guest_info = guest_info.conf
injected_config_location = /etc/trove/conf.d
cloudinit_location = /etc/trove/cloudinit

[oslo_messaging_rabbit]
rabbit_host = ctrl-node
rabbit_userid = openstack
rabbit_password = RabbitMQPass123

[database]
connection = mysql://trove:TroveDBPass123@ctrl-node/trove

Key parameters requiring environment-specific substitution include:

  • Administrator Project ID: nova_proxy_admin_tenant_id
  • Neutron Network ID: default_neutron_networks
  • Keystone Auth URL: trove_auth_url
  • Object Storage URL: swift_url (must include the project ID suffix)

Database Initialization

Populate the Trove database schema.

su -s /bin/sh -c "trove-manage db_sync" trove

If the command fails with a missing module error for MySQLdb, install the appropriate Python database driver.

pip install MySQL-python
# Or for Python 3 environments:
pip install mysqlclient

Rerun the synchronization command after package installation.

Service Activation

Restart the web server and enable the Trove services to start on boot.

systemctl restart httpd
systemctl enable openstack-trove-api.service openstack-trove-taskmanager.service openstack-trove-conductor.service
systemctl restart openstack-trove-api.service openstack-trove-taskmanager.service openstack-trove-conductor.service

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.