Map Mysql to isolated networks

This change adds parameters to specify which networks the MySQL
service will use. If the internal_api network exists the MySQL
service will bind to the IP address on that network, otherwise
the services will default to the IP on the Undercloud 'ctlplane'
network.

This patch also drop the old 'controller_host' variable from
the puppet controller template since it is no longer in use.

Change-Id: I4fba2c957f7db47e916bc269fb4bd32ccc99bd4c
This commit is contained in:
Dan Prince 2015-05-28 10:44:26 -04:00
parent 78c5ba2c01
commit 94d057f0c4
4 changed files with 7 additions and 6 deletions

View File

@ -86,3 +86,4 @@ parameter_defaults:
MemcachedNetwork: internal_api MemcachedNetwork: internal_api
RabbitMqNetwork: internal_api RabbitMqNetwork: internal_api
RedisNetwork: internal_api RedisNetwork: internal_api
MysqlNetwork: internal_api

View File

@ -510,7 +510,6 @@ resources:
server: {get_resource: Controller} server: {get_resource: Controller}
input_values: input_values:
bootstack_nodeid: {get_attr: [Controller, name]} bootstack_nodeid: {get_attr: [Controller, name]}
controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
controller_virtual_ip: {get_param: VirtualIP} controller_virtual_ip: {get_param: VirtualIP}
neutron_enable_tunneling: {get_param: NeutronEnableTunnelling} neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
heat.watch_server_url: heat.watch_server_url:
@ -709,6 +708,7 @@ resources:
rabbitmq_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RabbitMqNetwork]}]} rabbitmq_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RabbitMqNetwork]}]}
redis_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RedisNetwork]}]} redis_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RedisNetwork]}]}
memcached_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MemcachedNetwork]}]} memcached_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MemcachedNetwork]}]}
mysql_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MysqlNetwork]}]}
# Map heat metadata into hiera datafiles # Map heat metadata into hiera datafiles
ControllerConfig: ControllerConfig:
@ -739,7 +739,6 @@ resources:
raw_data: {get_file: hieradata/controller.yaml} raw_data: {get_file: hieradata/controller.yaml}
mapped_data: # data supplied directly to this deployment configuration, etc mapped_data: # data supplied directly to this deployment configuration, etc
bootstack_nodeid: {get_input: bootstack_nodeid} bootstack_nodeid: {get_input: bootstack_nodeid}
controller_host: {get_input: controller_host} #local-ipv4
# Pacemaker # Pacemaker
hacluster_pwd: {get_input: pcsd_password} hacluster_pwd: {get_input: pcsd_password}
@ -844,6 +843,7 @@ resources:
mysql_innodb_buffer_pool_size: {get_input: mysql_innodb_buffer_pool_size} mysql_innodb_buffer_pool_size: {get_input: mysql_innodb_buffer_pool_size}
mysql::server::root_password: {get_input: mysql_root_password} mysql::server::root_password: {get_input: mysql_root_password}
mysql_cluster_name: {get_input: mysql_cluster_name} mysql_cluster_name: {get_input: mysql_cluster_name}
mysql_bind_host: {get_input: mysql_network}
# Neutron # Neutron
neutron::bind_host: {get_input: neutron_api_network} neutron::bind_host: {get_input: neutron_api_network}

View File

@ -92,7 +92,7 @@ if hiera('step') >= 2 {
config_file => $mysql_config_file, config_file => $mysql_config_file,
override_options => { override_options => {
'mysqld' => { 'mysqld' => {
'bind-address' => hiera('controller_host'), 'bind-address' => hiera('mysql_bind_host'),
'max_connections' => '1024', 'max_connections' => '1024',
'open_files_limit' => '-1', 'open_files_limit' => '-1',
}, },
@ -102,7 +102,7 @@ if hiera('step') >= 2 {
# FIXME: this should only occur on the bootstrap host (ditto for db syncs) # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
# Create all the database schemas # Create all the database schemas
# Example DSN format: mysql://user:password@host/dbname # Example DSN format: mysql://user:password@host/dbname
$allowed_hosts = ['%',hiera('controller_host')] $allowed_hosts = ['%',hiera('mysql_bind_host')]
$keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]') $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
class { 'keystone::db::mysql': class { 'keystone::db::mysql':
user => $keystone_dsn[3], user => $keystone_dsn[3],

View File

@ -122,7 +122,7 @@ if hiera('step') >= 1 {
'innodb_locks_unsafe_for_binlog'=> '1', 'innodb_locks_unsafe_for_binlog'=> '1',
'query_cache_size' => '0', 'query_cache_size' => '0',
'query_cache_type' => '0', 'query_cache_type' => '0',
'bind-address' => hiera('controller_host'), 'bind-address' => hiera('mysql_bind_host'),
'max_connections' => '1024', 'max_connections' => '1024',
'open_files_limit' => '-1', 'open_files_limit' => '-1',
'wsrep_provider' => '/usr/lib64/galera/libgalera_smm.so', 'wsrep_provider' => '/usr/lib64/galera/libgalera_smm.so',
@ -263,7 +263,7 @@ MYSQL_HOST=localhost\n",
# Create all the database schemas # Create all the database schemas
# Example DSN format: mysql://user:password@host/dbname # Example DSN format: mysql://user:password@host/dbname
if $sync_db { if $sync_db {
$allowed_hosts = ['%',hiera('controller_host')] $allowed_hosts = ['%',hiera('mysql_bind_host')]
$keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]') $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
class { 'keystone::db::mysql': class { 'keystone::db::mysql':
user => $keystone_dsn[3], user => $keystone_dsn[3],