Configuring the Trove system is the final piece of the puzzle. If you have used an automated system (like SaltStack or DevStack), the configuration should automatically be done, provided the configuration parameters were passed down to the scripts.
If we have installed from source or from a repository manually, then the configuration becomes a mandatory part.
Before we start the configuration, we will need the following information handy. Some of this information will be new, and some of it will already exist based on the other components that are already installed (MySQL IP and Port, RabbitMQ server configuration, and so on).
We always follow a practice to fill out the details in a tabular format so that we can easily access them.
Please note that the table is filled with details from our existing environment, but these will be different for your environment.
Requirement |
Value |
---|---|
Hostname/IP of controller node |
172.22.6.246 |
Database IP and port |
localhost:3306 |
RabbitMQ server |
localhost |
RabbitMQ username |
stackrabbit |
RabbitMQ password |
rabb1tpwd |
MySQL root password |
dbr00tpwd |
Keystone admin username |
admin |
Keystone admin password |
adm1npwd |
Trove password |
oss3rvice |
Trove DB password |
tr0v3db |
We can log in to the MySQL server using the command:
mysql -u root –p
We will then create the database and assign user permissions to it. We could also use the root account to access the database. However, in a production environment, it is recommended that we use service accounts rather than the root account.
create database trove; grant all privileges on trove.* TO trove@'localhost' identified by 'tr0v3db'; grant all privileges on trove.* TO trove@'%' identified by 'tr0v3db';
We will have to create the Trove user, service, and endpoint in the Keystone system. In order to do this, we will first export the required environment variables.
export OS_TENANT_NAME=admin export OS_AUTH_URL=http://172.22.6.246:5000/v2.0 export OS_USERNAME=admin export OS_PASSWORD=adm1npwd
We will also save this in a file and source it to export the variables for us.
keystone user-create --name trove –pass oss3rvice keystone user-role-add --user trove --tenant service --role admin
This will create the user and add it as an admin in the service tenant. We will then create a service and its endpoint.
keystone service-create --name trove --type database --description "Trove: The OpenStack Database Service"
This command will output the unique ID of the service, which you should note down and substitute in the following command to create the endpoint for the service.
Although the command mentions the region name as regionOne
, you will have to set that to the region name being used in your environment.
keystone endpoint-create --service-id <Insert Service ID here> --publicurl http:// 172.22.6.246:8779/v1.0/%(tenant_id)s --internalurl http://172.22.6.246:8779/v1.0/%(tenant_id)s --adminurl http://172.22.6.246:8779/v1.0/%(tenant_id)s --region regionOne
The Keystone endpoints can be verified by the command keystone endpoint-list
or openstack endpoint list
.
The details can be seen by the command openstack endpoint show trove
.
We will need to modify the following configuration files for Trove to work:
/etc/trove/trove-conductor.conf
/etc/trove/trove.conf
/etc/trove/trove-taskmanager.conf
/etc/trove/trove-guestagent.conf
In the main Trove configuration file, which is located at /etc/trove/trove.conf
, we will edit the configuration to ensure the following is present. Please substitute the values from your environment, wherever applicable.
[DEFAULT] trove_api_workers = 2 use_syslog = False debug = True default_datastore = mysql sql_connection = mysql://trove:tr0v3db@localhost/trove rabbit_password = rabb1tpwd rabbit_userid = openstack [keystone_authtoken] signing_dir = /var/cache/trove cafile = /opt/stack/data/ca-bundle.pem auth_uri = http://172.22.6.246:5000 project_domain_id = default project_name = service user_domain_id = default password = oss3rvice username = trove auth_url = http:// 172.22.6.246:35357 auth_plugin = password
Both the /etc/trove/trove-conductor.conf
and /etc/trove/trove-taskmanager.conf
files should be updated to contain the following:
[DEFAULT] use_syslog = False debug = True trove_auth_url = http://172.22.6.246:35357/v2.0 nova_proxy_admin_pass = nova_proxy_admin_tenant_name = trove nova_proxy_admin_user = radmin taskmanager_manager = trove.taskmanager.manager.Manager sql_connection = mysql://trove:tr0v3db@localhost/trove rabbit_password = rabb1tpwd rabbit_userid = openstack
This file is different in the sense that this is used by the guest agent, which is installed on the instance and not on the Trove server. This file is sent to the guest instance by the trove-taskmanager
service using cloud-init
.
Please edit the file as shown next, by setting the auth_url
and rabbit_host
, userid
, and password
:
[DEFAULT] log_file = trove-guestagent.log log_dir = /var/log/trove/ ignore_users = os_admin control_exchange = trove trove_auth_url = http://172.22.6.246:35357/v3 nova_proxy_admin_pass = nova_proxy_admin_tenant_name = trove nova_proxy_admin_user = radmin rabbit_password = rabb1tpwd rabbit_host = 10.1.10.1 rabbit_userid = stackrabbit