Merge "Add Galera as a Pacemaker resource when EnablePacemaker"
This commit is contained in:
commit
1d2f406c34
|
@ -208,6 +208,10 @@ parameters:
|
||||||
description: Keystone key for signing tokens.
|
description: Keystone key for signing tokens.
|
||||||
type: string
|
type: string
|
||||||
hidden: true
|
hidden: true
|
||||||
|
MysqlClustercheckPassword:
|
||||||
|
type: string
|
||||||
|
hidden: true
|
||||||
|
default: '' # Has to be here because of the ignored empty value bug
|
||||||
MysqlClusterUniquePart:
|
MysqlClusterUniquePart:
|
||||||
description: A unique identifier of the MySQL cluster the controller is in.
|
description: A unique identifier of the MySQL cluster the controller is in.
|
||||||
type: string
|
type: string
|
||||||
|
|
|
@ -598,6 +598,7 @@ resources:
|
||||||
MysqlClusterUniquePart: {get_attr: [MysqlClusterUniquePart, value]}
|
MysqlClusterUniquePart: {get_attr: [MysqlClusterUniquePart, value]}
|
||||||
MysqlInnodbBufferPoolSize: {get_param: MysqlInnodbBufferPoolSize}
|
MysqlInnodbBufferPoolSize: {get_param: MysqlInnodbBufferPoolSize}
|
||||||
MysqlRootPassword: {get_attr: [MysqlRootPassword, value]}
|
MysqlRootPassword: {get_attr: [MysqlRootPassword, value]}
|
||||||
|
MysqlClustercheckPassword: {get_attr: [MysqlClustercheckPassword, value]}
|
||||||
NeutronPublicInterfaceIP: {get_param: NeutronPublicInterfaceIP}
|
NeutronPublicInterfaceIP: {get_param: NeutronPublicInterfaceIP}
|
||||||
NeutronFlatNetworks: {get_param: NeutronFlatNetworks}
|
NeutronFlatNetworks: {get_param: NeutronFlatNetworks}
|
||||||
NeutronBridgeMappings: {get_param: NeutronBridgeMappings}
|
NeutronBridgeMappings: {get_param: NeutronBridgeMappings}
|
||||||
|
@ -760,6 +761,11 @@ resources:
|
||||||
properties:
|
properties:
|
||||||
length: 10
|
length: 10
|
||||||
|
|
||||||
|
MysqlClustercheckPassword:
|
||||||
|
type: OS::Heat::RandomString
|
||||||
|
properties:
|
||||||
|
length: 10
|
||||||
|
|
||||||
MysqlClusterUniquePart:
|
MysqlClusterUniquePart:
|
||||||
type: OS::Heat::RandomString
|
type: OS::Heat::RandomString
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -54,6 +54,14 @@ resources:
|
||||||
list_join:
|
list_join:
|
||||||
- ','
|
- ','
|
||||||
- {get_param: controller_ips}
|
- {get_param: controller_ips}
|
||||||
|
controller_node_names:
|
||||||
|
list_join:
|
||||||
|
- ','
|
||||||
|
- {get_param: controller_names}
|
||||||
|
galera_node_names:
|
||||||
|
list_join:
|
||||||
|
- ','
|
||||||
|
- {get_param: controller_names}
|
||||||
rabbit_node_ips:
|
rabbit_node_ips:
|
||||||
list_join:
|
list_join:
|
||||||
- ','
|
- ','
|
||||||
|
|
|
@ -63,10 +63,19 @@ resources:
|
||||||
input_values:
|
input_values:
|
||||||
step: 3
|
step: 3
|
||||||
|
|
||||||
|
ControllerDeploymentOvercloudServices_Step5:
|
||||||
|
type: OS::Heat::StructuredDeployments
|
||||||
|
depends_on: ControllerDeploymentOvercloudServices_Step4
|
||||||
|
properties:
|
||||||
|
servers: {get_param: servers}
|
||||||
|
config: {get_resource: ControllerPuppetConfig}
|
||||||
|
input_values:
|
||||||
|
step: 4
|
||||||
|
|
||||||
# Note, this should come last, so use depends_on to ensure
|
# Note, this should come last, so use depends_on to ensure
|
||||||
# this is created after any other resources.
|
# this is created after any other resources.
|
||||||
ExtraConfig:
|
ExtraConfig:
|
||||||
depends_on: ControllerDeploymentOvercloudServices_Step4
|
depends_on: ControllerDeploymentOvercloudServices_Step5
|
||||||
type: OS::TripleO::NodeExtraConfigPost
|
type: OS::TripleO::NodeExtraConfigPost
|
||||||
properties:
|
properties:
|
||||||
servers: {get_param: servers}
|
servers: {get_param: servers}
|
||||||
|
|
|
@ -226,6 +226,10 @@ parameters:
|
||||||
type: string
|
type: string
|
||||||
hidden: true
|
hidden: true
|
||||||
default: '' # Has to be here because of the ignored empty value bug
|
default: '' # Has to be here because of the ignored empty value bug
|
||||||
|
MysqlClustercheckPassword:
|
||||||
|
type: string
|
||||||
|
hidden: true
|
||||||
|
default: '' # Has to be here because of the ignored empty value bug
|
||||||
NeutronBridgeMappings:
|
NeutronBridgeMappings:
|
||||||
description: >
|
description: >
|
||||||
The OVS logical->physical bridge mappings to use. See the Neutron
|
The OVS logical->physical bridge mappings to use. See the Neutron
|
||||||
|
@ -553,6 +557,7 @@ resources:
|
||||||
enable_swift_storage: {get_param: EnableSwiftStorage}
|
enable_swift_storage: {get_param: EnableSwiftStorage}
|
||||||
mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
|
mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
|
||||||
mysql_root_password: {get_param: MysqlRootPassword}
|
mysql_root_password: {get_param: MysqlRootPassword}
|
||||||
|
mysql_clustercheck_password: {get_param: MysqlClustercheckPassword}
|
||||||
mysql_cluster_name:
|
mysql_cluster_name:
|
||||||
str_replace:
|
str_replace:
|
||||||
template: tripleo-CLUSTER
|
template: tripleo-CLUSTER
|
||||||
|
@ -775,6 +780,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_clustercheck_password: {get_input: mysql_clustercheck_password}
|
||||||
|
|
||||||
# Neutron
|
# Neutron
|
||||||
neutron::bind_host: {get_input: controller_host}
|
neutron::bind_host: {get_input: controller_host}
|
||||||
|
|
|
@ -94,6 +94,10 @@ horizon::allowed_hosts: '*'
|
||||||
|
|
||||||
mysql::server::manage_config_file: true
|
mysql::server::manage_config_file: true
|
||||||
|
|
||||||
|
|
||||||
|
tripleo::loadbalancer::galera_master_ip: "%{hiera('bootstrap_nodeid_ip')}"
|
||||||
|
tripleo::loadbalancer::galera_master_hostname: "%{hiera('bootstrap_nodeid')}"
|
||||||
|
|
||||||
tripleo::loadbalancer::keystone_admin: true
|
tripleo::loadbalancer::keystone_admin: true
|
||||||
tripleo::loadbalancer::keystone_public: true
|
tripleo::loadbalancer::keystone_public: true
|
||||||
tripleo::loadbalancer::neutron: true
|
tripleo::loadbalancer::neutron: true
|
||||||
|
|
|
@ -33,9 +33,10 @@ if $::hostname == downcase(hiera('bootstrap_nodeid')) {
|
||||||
if hiera('step') >= 1 {
|
if hiera('step') >= 1 {
|
||||||
|
|
||||||
$controller_node_ips = split(hiera('controller_node_ips'), ',')
|
$controller_node_ips = split(hiera('controller_node_ips'), ',')
|
||||||
|
$controller_node_names = split(downcase(hiera('controller_node_names')), ',')
|
||||||
class { '::tripleo::loadbalancer' :
|
class { '::tripleo::loadbalancer' :
|
||||||
controller_hosts => $controller_node_ips,
|
controller_hosts => $controller_node_ips,
|
||||||
|
controller_hosts_names => $controller_node_names,
|
||||||
manage_vip => false,
|
manage_vip => false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,19 +141,98 @@ if hiera('step') >= 2 {
|
||||||
} else {
|
} else {
|
||||||
$mysql_config_file = '/etc/my.cnf.d/server.cnf'
|
$mysql_config_file = '/etc/my.cnf.d/server.cnf'
|
||||||
}
|
}
|
||||||
# TODO Galara
|
$galera_nodes = downcase(hiera('galera_node_names', $::hostname))
|
||||||
class { 'mysql::server':
|
$galera_nodes_count = count(split($galera_nodes, ','))
|
||||||
config_file => $mysql_config_file,
|
$clustercheck_password = hiera('mysql_clustercheck_password')
|
||||||
override_options => {
|
$mysql_root_password = hiera('mysql::server::root_password')
|
||||||
|
|
||||||
|
$mysqld_options = {
|
||||||
'mysqld' => {
|
'mysqld' => {
|
||||||
'bind-address' => hiera('controller_host')
|
'skip-name-resolve' => '1',
|
||||||
|
'binlog_format' => 'ROW',
|
||||||
|
'default-storage-engine' => 'innodb',
|
||||||
|
'innodb_autoinc_lock_mode' => '2',
|
||||||
|
'innodb_locks_unsafe_for_binlog'=> '1',
|
||||||
|
'query_cache_size' => '0',
|
||||||
|
'query_cache_type' => '0',
|
||||||
|
'bind-address' => hiera('controller_host'),
|
||||||
|
'wsrep_provider' => '/usr/lib64/galera/libgalera_smm.so',
|
||||||
|
'wsrep_cluster_name' => 'galera_cluster',
|
||||||
|
'wsrep_slave_threads' => '1',
|
||||||
|
'wsrep_certify_nonPK' => '1',
|
||||||
|
'wsrep_max_ws_rows' => '131072',
|
||||||
|
'wsrep_max_ws_size' => '1073741824',
|
||||||
|
'wsrep_debug' => '0',
|
||||||
|
'wsrep_convert_LOCK_to_trx' => '0',
|
||||||
|
'wsrep_retry_autocommit' => '1',
|
||||||
|
'wsrep_auto_increment_control' => '1',
|
||||||
|
'wsrep_drupal_282555_workaround'=> '0',
|
||||||
|
'wsrep_causal_reads' => '0',
|
||||||
|
'wsrep_notify_cmd' => '',
|
||||||
|
'wsrep_sst_method' => 'rsync',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class { '::mysql::server':
|
||||||
|
create_root_user => false,
|
||||||
|
create_root_my_cnf => false,
|
||||||
|
config_file => $mysql_config_file,
|
||||||
|
override_options => $mysqld_options,
|
||||||
|
service_manage => false,
|
||||||
|
}
|
||||||
|
|
||||||
|
if $pacemaker_master {
|
||||||
|
$sync_db = true
|
||||||
|
|
||||||
|
pacemaker::resource::ocf { 'galera' :
|
||||||
|
resource_name => 'heartbeat:galera',
|
||||||
|
options => "enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}' meta master-max=${galera_nodes_count} ordered=true op promote timeout=300s on-fail=block --master",
|
||||||
|
require => Class['::mysql::server'],
|
||||||
|
before => Exec['galera-ready'],
|
||||||
|
}
|
||||||
|
|
||||||
|
mysql_user { 'clustercheckuser@localhost' :
|
||||||
|
password_hash => mysql_password($clustercheck_password),
|
||||||
|
require => Exec['galera-ready'],
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$sync_db = false
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { 'galera-ready' :
|
||||||
|
command => '/bin/mysql -e "SHOW GLOBAL VARIABLES LIKE \'read_only\'" | /bin/grep -i off',
|
||||||
|
timeout => 3600,
|
||||||
|
tries => 60,
|
||||||
|
try_sleep => 60,
|
||||||
|
environment => 'HOME=/root',
|
||||||
|
require => Class['::mysql::server'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/etc/sysconfig/clustercheck' :
|
||||||
|
ensure => file,
|
||||||
|
content => "MYSQL_USERNAME=clustercheckuser\n
|
||||||
|
MYSQL_PASSWORD=${clustercheck_password}\n
|
||||||
|
MYSQL_HOST=localhost\n",
|
||||||
|
require => Exec['galera-ready'],
|
||||||
|
}
|
||||||
|
|
||||||
|
xinetd::service { 'galera-monitor' :
|
||||||
|
port => '9200',
|
||||||
|
server => '/usr/bin/clustercheck',
|
||||||
|
per_source => 'UNLIMITED',
|
||||||
|
log_on_success => '',
|
||||||
|
log_on_failure => 'HOST',
|
||||||
|
flags => 'REUSE',
|
||||||
|
service_type => 'UNLISTED',
|
||||||
|
user => 'root',
|
||||||
|
group => 'root',
|
||||||
|
require => File['/etc/sysconfig/clustercheck'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
||||||
|
if $sync_db {
|
||||||
$allowed_hosts = ['%',hiera('controller_host')]
|
$allowed_hosts = ['%',hiera('controller_host')]
|
||||||
$keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
|
$keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
|
||||||
class { 'keystone::db::mysql':
|
class { 'keystone::db::mysql':
|
||||||
|
@ -161,6 +241,7 @@ if hiera('step') >= 2 {
|
||||||
host => $keystone_dsn[5],
|
host => $keystone_dsn[5],
|
||||||
dbname => $keystone_dsn[6],
|
dbname => $keystone_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
$glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
|
$glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
|
||||||
class { 'glance::db::mysql':
|
class { 'glance::db::mysql':
|
||||||
|
@ -169,6 +250,7 @@ if hiera('step') >= 2 {
|
||||||
host => $glance_dsn[5],
|
host => $glance_dsn[5],
|
||||||
dbname => $glance_dsn[6],
|
dbname => $glance_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
$nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
|
$nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
|
||||||
class { 'nova::db::mysql':
|
class { 'nova::db::mysql':
|
||||||
|
@ -177,6 +259,7 @@ if hiera('step') >= 2 {
|
||||||
host => $nova_dsn[5],
|
host => $nova_dsn[5],
|
||||||
dbname => $nova_dsn[6],
|
dbname => $nova_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
$neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
|
$neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
|
||||||
class { 'neutron::db::mysql':
|
class { 'neutron::db::mysql':
|
||||||
|
@ -185,6 +268,7 @@ if hiera('step') >= 2 {
|
||||||
host => $neutron_dsn[5],
|
host => $neutron_dsn[5],
|
||||||
dbname => $neutron_dsn[6],
|
dbname => $neutron_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
$cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
|
$cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
|
||||||
class { 'cinder::db::mysql':
|
class { 'cinder::db::mysql':
|
||||||
|
@ -193,6 +277,7 @@ if hiera('step') >= 2 {
|
||||||
host => $cinder_dsn[5],
|
host => $cinder_dsn[5],
|
||||||
dbname => $cinder_dsn[6],
|
dbname => $cinder_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
$heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
|
$heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
|
||||||
class { 'heat::db::mysql':
|
class { 'heat::db::mysql':
|
||||||
|
@ -201,6 +286,7 @@ if hiera('step') >= 2 {
|
||||||
host => $heat_dsn[5],
|
host => $heat_dsn[5],
|
||||||
dbname => $heat_dsn[6],
|
dbname => $heat_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
}
|
}
|
||||||
if downcase(hiera('ceilometer_backend')) == 'mysql' {
|
if downcase(hiera('ceilometer_backend')) == 'mysql' {
|
||||||
$ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
|
$ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
|
||||||
|
@ -210,6 +296,8 @@ if hiera('step') >= 2 {
|
||||||
host => $ceilometer_dsn[5],
|
host => $ceilometer_dsn[5],
|
||||||
dbname => $ceilometer_dsn[6],
|
dbname => $ceilometer_dsn[6],
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
|
require => Exec['galera-ready'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +346,8 @@ if hiera('step') >= 2 {
|
||||||
|
|
||||||
} #END STEP 2
|
} #END STEP 2
|
||||||
|
|
||||||
if hiera('step') >= 3 {
|
if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid')))
|
||||||
|
or hiera('step') >= 4 {
|
||||||
|
|
||||||
include ::keystone
|
include ::keystone
|
||||||
|
|
||||||
|
@ -307,14 +396,18 @@ if hiera('step') >= 3 {
|
||||||
class { 'glance::api':
|
class { 'glance::api':
|
||||||
known_stores => [$glance_store]
|
known_stores => [$glance_store]
|
||||||
}
|
}
|
||||||
include ::glance::registry
|
class { '::glance::registry' :
|
||||||
|
sync_db => $sync_db,
|
||||||
|
}
|
||||||
include join(['::glance::backend::', $glance_backend])
|
include join(['::glance::backend::', $glance_backend])
|
||||||
|
|
||||||
class { 'nova':
|
class { 'nova':
|
||||||
glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
|
glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
|
||||||
}
|
}
|
||||||
|
|
||||||
include ::nova::api
|
class { '::nova::api' :
|
||||||
|
sync_db => $sync_db,
|
||||||
|
}
|
||||||
include ::nova::cert
|
include ::nova::cert
|
||||||
include ::nova::conductor
|
include ::nova::conductor
|
||||||
include ::nova::consoleauth
|
include ::nova::consoleauth
|
||||||
|
@ -323,7 +416,9 @@ if hiera('step') >= 3 {
|
||||||
include ::nova::scheduler
|
include ::nova::scheduler
|
||||||
|
|
||||||
include ::neutron
|
include ::neutron
|
||||||
include ::neutron::server
|
class { '::neutron::server' :
|
||||||
|
sync_db => $sync_db,
|
||||||
|
}
|
||||||
include ::neutron::agents::dhcp
|
include ::neutron::agents::dhcp
|
||||||
include ::neutron::agents::l3
|
include ::neutron::agents::l3
|
||||||
|
|
||||||
|
@ -459,6 +554,7 @@ if hiera('step') >= 3 {
|
||||||
include ::ceilometer::collector
|
include ::ceilometer::collector
|
||||||
class { '::ceilometer::db' :
|
class { '::ceilometer::db' :
|
||||||
database_connection => $ceilometer_database_connection,
|
database_connection => $ceilometer_database_connection,
|
||||||
|
sync_db => $sync_db,
|
||||||
}
|
}
|
||||||
class { 'ceilometer::agent::auth':
|
class { 'ceilometer::agent::auth':
|
||||||
auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
|
auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
|
||||||
|
@ -467,7 +563,9 @@ if hiera('step') >= 3 {
|
||||||
Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
|
Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
|
||||||
|
|
||||||
# Heat
|
# Heat
|
||||||
include ::heat
|
class { '::heat' :
|
||||||
|
sync_db => $sync_db,
|
||||||
|
}
|
||||||
include ::heat::api
|
include ::heat::api
|
||||||
include ::heat::api_cfn
|
include ::heat::api_cfn
|
||||||
include ::heat::api_cloudwatch
|
include ::heat::api_cloudwatch
|
||||||
|
|
Loading…
Reference in New Issue