Este conteúdo não está disponível no idioma selecionado.
6.3. Configure the Block Storage Service
6.3.1. Configure the Block Storage Service Database Connection Copiar o linkLink copiado para a área de transferência!
/etc/cinder/cinder.conf file. It must be updated to point to a valid database server before starting the service.
sql_connection configuration key on each system hosting Block Storage services:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT sql_connection mysql://USER:PASS@IP/DB
# openstack-config --set /etc/cinder/cinder.conf \
DEFAULT sql_connection mysql://USER:PASS@IP/DB
- Replace USER with the Block Storage service database user name, usually
cinder. - Replace PASS with the password of the database user.
- Replace IP with the IP address or host name of the server hosting the database service.
- Replace DB with the name of the Block Storage service database, usually
cinder.
Important
6.3.2. Create the Block Storage Service Identity Records Copiar o linkLink copiado para a área de transferência!
services tenant. For more information, see:
keystonerc_admin file and on which the keystone command-line utility is installed.
Procedure 6.2. Creating Identity Records for the Block Storage Service
- Set up the shell to access Keystone as the administrative user:
source ~/keystonerc_admin
# source ~/keystonerc_adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
cinderuser:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with a secure password that will be used by the Block Storage service when authenticating with the Identity service. - Link the
cinderuser and theadminrole together within the context of theservicestenant:[(keystone_admin)]# openstack role add --project services --user cinder admin
[(keystone_admin)]# openstack role add --project services --user cinder adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
cinderandcinderv2Block Storage service entries:[(keystone_admin)]# openstack service create --name cinder \ --description "Cinder Volume Service" \ volume[(keystone_admin)]# openstack service create --name cinder \ --description "Cinder Volume Service" \ volumeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
cinderendpoint entry:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace IP with the IP address or host name of the server hosting the Block Storage API service (openstack-cinder-api). To install and run multiple instances of the API service, repeat this step for the IP address or host name of each instance.
6.3.3. Configure Block Storage Service Authentication Copiar o linkLink copiado para a área de transferência!
root user.
Procedure 6.3. Configuring the Block Storage Service to Authenticate Through the Identity Service
- Set the authentication strategy to
keystone:openstack-config --set /etc/cinder/cinder.conf \ DEFAULT auth_strategy keystone
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT auth_strategy keystoneCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Identity service host that the Block Storage services must use:
openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken auth_host IP
# openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken auth_host IPCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace IP with the IP address or host name of the server hosting the Identity service. - Set the Block Storage services to authenticate as the correct tenant:
openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_tenant_name services
# openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_tenant_name servicesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace services with the name of the tenant created for the use of OpenStack Networking. Examples in this guide useservices. - Set the Block Storage services to authenticate using the
cinderadministrative user account:openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_user cinder
# openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_user cinderCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Block Storage services to use the correct
cinderadministrative user account password:openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_password PASSWORD
# openstack-config --set /etc/cinder/cinder.conf \ keystone_authtoken admin_password PASSWORDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with the password set when thecinderuser was created.
6.3.4. Configure the Firewall to Allow Block Storage Service Traffic Copiar o linkLink copiado para a área de transferência!
root user.
Procedure 6.4. Configuring the Firewall to Allow Block Storage Service Traffic
- Open the
/etc/sysconfig/iptablesfile in a text editor. - Add an INPUT rule allowing TCP traffic on ports
3260and8776to the file. The new rule must appear before any INPUT rules that REJECT traffic:-A INPUT -p tcp -m multiport --dports 3260,8776 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 3260,8776 -j ACCEPTCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the changes to the
/etc/sysconfig/iptablesfile. - Restart the
iptablesservice to ensure that the change takes effect:systemctl restart iptables.service
# systemctl restart iptables.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3.5. Configure the Block Storage Service to Use SSL Copiar o linkLink copiado para a área de transferência!
cinder.conf file to configure SSL.
| Configuration Option | Description |
|---|---|
backlog
|
The number of backlog requests with which to configure the socket.
|
tcp_keepidle
|
Sets the value of TCP_KEEPIDLE in seconds for each server socket.
|
ssl_ca_file
|
The CA certificate file to use to verify connecting clients.
|
ssl_cert_file
|
The certificate file to use when starting the server securely.
|
ssl_key_file
|
The private key file to use when starting the server securely.
|
6.3.6. Configure RabbitMQ Message Broker Settings for the Block Storage Service Copiar o linkLink copiado para a área de transferência!
root user.
Procedure 6.5. Configuring the Block Storage Service to use the RabbitMQ Message Broker
- Set RabbitMQ as the RPC back end:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombuCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the name of the RabbitMQ host:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_host RABBITMQ_HOST
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_host RABBITMQ_HOSTCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace RABBITMQ_HOST with the IP address or host name of the message broker. - Set the message broker port to
5672:openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_port 5672
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_port 5672Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the RabbitMQ username and password created for the Block Storage service when RabbitMQ was configured:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_userid cinder
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_userid cinderCopy to Clipboard Copied! Toggle word wrap Toggle overflow openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_password CINDER_PASS
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_password CINDER_PASSCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replacecinderand CINDER_PASS with the RabbitMQ user name and password created for the Block Storage service. - When RabbitMQ was launched, the
cinderuser was granted read and write permissions to all resources: specifically, through the virtual host/. Configure the Block Storage service to connect to this virtual host:openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_virtual_host /
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_virtual_host /Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3.7. Enable SSL Communication Between the Block Storage Service and the Message Broker Copiar o linkLink copiado para a área de transferência!
- Enable SSL communication with the message broker:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace /path/to/client.crt with the absolute path to the exported client certificate.
- Replace /path/to/clientkeyfile.key with the absolute path to the exported client key file.
- If your certificates were signed by a third-party Certificate Authority (CA), you must also run the following command:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT kombu_ssl_ca_certs /path/to/ca.crt
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT kombu_ssl_ca_certs /path/to/ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace /path/to/ca.crt with the absolute path to the CA file provided by the third-party CA (see Section 2.3.4, “Enable SSL on the RabbitMQ Message Broker” for more information).
6.3.8. Populate the Block Storage Database Copiar o linkLink copiado para a área de transferência!
Important
Procedure 6.6. Populating the Block Storage Service Database
- Log in to the system hosting one of the Block Storage services.
- Switch to the
cinderuser:su cinder -s /bin/sh
# su cinder -s /bin/shCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Initialize and populate the database identified in
/etc/cinder/cinder.conf:cinder-manage db sync
$ cinder-manage db syncCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3.9. Increase the Throughput of the Block Storage API Service Copiar o linkLink copiado para a área de transferência!
openstack-cinder-api) runs in one process. This limits the number of API requests that the Block Storage service can process at any given time. In a production environment, you should increase the Block Storage API throughput by allowing openstack-cinder-api to run in as many processes as the machine capacity allows.
osapi_volume_workers, allows you to specify the number of API service workers (or OS processes) to launch for openstack-cinder-api.
openstack-cinder-api host:
openstack-config --set /etc/cinder/cinder.conf \ DEFAULT osapi_volume_workers CORES
# openstack-config --set /etc/cinder/cinder.conf \
DEFAULT osapi_volume_workers CORES