diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-06-09 07:15:33 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-06-09 07:15:33 +0000 |
commit | 0625ac253e5c7d92dcfbc15c083f058dca7a6192 (patch) | |
tree | 5021a84c1fb403200c5b447951e09cb1b321e6c5 | |
parent | 33db97ccf9e44a43ace9f2259504f993ee2e812b (diff) | |
parent | 8def87e4499c798bead52b956915007b3e590812 (diff) |
Merge "Add Redis as a Pacemaker resource"
-rw-r--r-- | controller.yaml | 3 | ||||
-rw-r--r-- | environments/puppet-pacemaker.yaml | 3 | ||||
-rw-r--r-- | overcloud-without-mergepy.yaml | 4 | ||||
-rw-r--r-- | puppet/controller-puppet.yaml | 5 | ||||
-rw-r--r-- | puppet/manifests/overcloud_controller_pacemaker.pp | 61 |
5 files changed, 59 insertions, 17 deletions
diff --git a/controller.yaml b/controller.yaml index 51dba076..9fc91562 100644 --- a/controller.yaml +++ b/controller.yaml @@ -364,6 +364,9 @@ parameters: default: 5672 description: Set rabbit subscriber port, change this if using SSL type: number + RedisVirtualIP: + type: string + default: '' # Has to be here because of the ignored empty value bug SnmpdReadonlyUserName: default: ro_snmp_user description: The user name for SNMPd with readonly rights running on all Overcloud nodes diff --git a/environments/puppet-pacemaker.yaml b/environments/puppet-pacemaker.yaml index f235cf8f..70e1b3ed 100644 --- a/environments/puppet-pacemaker.yaml +++ b/environments/puppet-pacemaker.yaml @@ -2,3 +2,6 @@ # Overcloud controller with Pacemaker. resource_registry: OS::TripleO::ControllerConfig: ../puppet/controller-config-pacemaker.yaml + +parameter_defaults: + RedisVirtualIP: 192.0.2.142 diff --git a/overcloud-without-mergepy.yaml b/overcloud-without-mergepy.yaml index 583634f1..661497ce 100644 --- a/overcloud-without-mergepy.yaml +++ b/overcloud-without-mergepy.yaml @@ -399,6 +399,9 @@ parameters: Specifies the interface where the public-facing virtual ip will be assigned. This should be int_public when a VLAN is being used. type: string + RedisVirtualIP: + type: string + default: '' # Has to be here because of the ignored empty value bug SSLCertificate: default: '' description: If set, the contents of an SSL certificate .crt file for encrypting SSL endpoints. @@ -663,6 +666,7 @@ resources: RabbitClientPort: {get_param: RabbitClientPort} SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName} SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword} + RedisVirtualIP: {get_param: RedisVirtualIP} SSLCertificate: {get_param: SSLCertificate} SSLKey: {get_param: SSLKey} SSLCACertificate: {get_param: SSLCACertificate} diff --git a/puppet/controller-puppet.yaml b/puppet/controller-puppet.yaml index e3a07f36..05bd27ab 100644 --- a/puppet/controller-puppet.yaml +++ b/puppet/controller-puppet.yaml @@ -373,6 +373,9 @@ parameters: default: 5672 description: Set rabbit subscriber port, change this if using SSL type: number + RedisVirtualIP: + type: string + default: '' # Has to be here because of the ignored empty value bug SnmpdReadonlyUserName: default: ro_snmp_user description: The user name for SNMPd with readonly rights running on all Overcloud nodes @@ -753,6 +756,7 @@ resources: horizon_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, HorizonNetwork]}]} 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_vip: {get_param: RedisVirtualIP} memcached_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MemcachedNetwork]}]} mysql_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MysqlNetwork]}]} ceph_cluster_network: {get_attr: [NetIpSubnetMap, net_ip_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]} @@ -979,6 +983,7 @@ resources: rabbitmq::erlang_cookie: {get_input: rabbit_cookie} # Redis redis::bind: {get_input: redis_network} + redis_vip: {get_input: redis_vip} # Misc memcached::listen_ip: {get_input: memcached_network} neutron_public_interface_ip: {get_input: neutron_public_interface_ip} diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp index ef34d911..9642fc2e 100644 --- a/puppet/manifests/overcloud_controller_pacemaker.pp +++ b/puppet/manifests/overcloud_controller_pacemaker.pp @@ -55,6 +55,7 @@ if hiera('step') >= 1 { class { '::tripleo::loadbalancer' : controller_hosts => $controller_node_ips, controller_hosts_names => $controller_node_names, + redis => false, manage_vip => false, haproxy_service_manage => false, } @@ -106,6 +107,13 @@ if hiera('step') >= 1 { service_manage => false, } + # Redis + class { '::redis' : + bind => '0.0.0.0', + service_manage => false, + notify_service => false, + } + # Galera if str2bool(hiera('enable_galera', 'true')) { $mysql_config_file = '/etc/my.cnf.d/galera.cnf' @@ -238,25 +246,35 @@ if hiera('step') >= 2 { require => Class['::mysql::server'], before => Exec['galera-ready'], } - } - - # Redis - $redis_node_ips = hiera('redis_node_ips') - $redis_master_hostname = downcase(hiera('bootstrap_nodeid')) - if $redis_master_hostname == $::hostname { - $slaveof = undef - } else { - $slaveof = "${redis_master_hostname} 6379" - } - class {'::redis' : - slaveof => $slaveof, - } + pacemaker::resource::ocf { 'redis': + ocf_agent_name => 'heartbeat:redis', + master_params => '', + meta_params => 'notify=true ordered=true interleave=true', + resource_params => 'wait_last_known_master=true', + require => Class['::redis'], + } + $redis_vip = hiera('redis_vip') + pacemaker::resource::ip { 'vip-redis': + ip_address => $redis_vip, + } + pacemaker::constraint::base { 'redis-master-then-vip-redis': + constraint_type => 'order', + first_resource => 'redis-master', + second_resource => "ip-${redis_vip}", + first_action => 'promote', + second_action => 'start', + require => [Pacemaker::Resource::Ocf['redis'], + Pacemaker::Resource::Ip['vip-redis']], + } + pacemaker::constraint::colocation { 'vip-redis-with-redis-master': + source => "ip-${redis_vip}", + target => 'redis-master', + score => 'INFINITY', + require => [Pacemaker::Resource::Ocf['redis'], + Pacemaker::Resource::Ip['vip-redis']], + } - if count($redis_node_ips) > 1 { - Class['::tripleo::redis_notification'] -> Service['redis-sentinel'] - include ::redis::sentinel - include ::tripleo::redis_notification } exec { 'galera-ready' : @@ -1183,6 +1201,15 @@ if hiera('step') >= 4 { Pacemaker::Resource::Service[$::mongodb::params::service_name]], } } + pacemaker::constraint::base { 'vip-redis-then-ceilometer-central': + constraint_type => 'order', + first_resource => "ip-${redis_vip}", + second_resource => "${::ceilometer::params::agent_central_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name], + Pacemaker::Resource::Ip['vip-redis']], + } pacemaker::constraint::base { 'keystone-then-ceilometer-central-constraint': constraint_type => 'order', first_resource => "${::keystone::params::service_name}-clone", |