简体   繁体   English

人偶资源订购不起作用

[英]Puppet Resource Ordering not working

I have a large manifest that sets up an OpenStack Controller node that also has HAProxy, Galera and RabbitMQ co-located on the same host. 我有一个很大的清单,它设置了一个OpenStack Controller节点,该节点还将HAProxy,Galera和RabbitMQ共同放置在同一主机上。 I am running into problems because the HAProxy service always seems to be the last thing to start. 我遇到了问题,因为HAProxy服务似乎总是要启动的最后一件事。 This creates a problem as I am suppose to connect to the Galera DB cluster through the HAProxies VIP. 因为我想通过HAProxies VIP连接到Galera数据库集群,所以这会造成问题。 So all the attempts by the various OpenStack services are not able to set up their relational database tables. 因此,各种OpenStack服务的所有尝试都无法建立其关系数据库表。 This would not be a problem if the HAProxy service starts first. 如果HAProxy服务先启动,这不会有问题。 I have tried all kinds of things to get my puppet manifest to force application of my HAProxy profile before anything else. 我已经尝试了各种方法来使人偶显示清单,以强制我先应用HAProxy配置文件。 Here's a couple of things I have tried: 这是我尝试过的几件事:

    #Service <|name=='haproxy' or name=='keepalived'|> -> Exec <| |>
    #Exec<| title == 'nova-db-sync' |> ~> Service<| title == $nova_title |>
    #Service<| title == 'haproxy' |> ~> Exec<| title == 'nova-db-sync' |>
    #Service<| title == 'haproxy' |> ~> Exec<| title == 'Exec[apic-ml2-db-manage --config-file /etc/neutron/neutron.conf upgrade head]' |>

     Service['haproxy'] -> Exec['keystone-manage db_sync']
    #Class ['wraphaproxy'] -> Class ['wrapgalera'] -> Class['wraprabbitmq'] -> Class['keystone']
# -> Class['wraprabbitmq'] -> Class['keystone']
#
#   setup HAproxy
notify { "This host ${ipaddress} is in ${haproxy_ipaddress}":}
    if ( $ipaddress in $haproxy_ipaddress ) {
notify { "This host is an haproxy host ${ipaddress} is in ${haproxy_ipaddress}":}
       require wraphaproxy
#       class { 'wraphaproxy':
#           before => [
#              Class['wrapgalera'],
#              Class['wraprabbitmq'],
#              Class['keystone'],
#              Class['glance'],
#              Class['cinder'],
#              Class['neutron'],
#              Class['nova'],
#              Class['ceilometer'],
#              Class['horizon'],
#              Class['heat'],
#           ]
#       }
    }

The class wraphaproxy is the class that configures and starts the HAProxy service. wraphaproxy类是配置和启动HAProxy服务的类。 It seems that no matter what I do the OpenStack Puppet modules attempt to do their "db sync's" before the HAProxy service is ready. 看来,无论我做什么,OpenStack Puppet模块都会在HAProxy服务准备就绪之前尝试执行其“数据库同步”。

OK. 好。 It turns out that I need to use HAProxy::Service['haproxy'] instead of just Service['haproxy'] . 事实证明,我需要使用HAProxy::Service['haproxy']而不是Service['haproxy'] So I have this in my code: 所以我的代码中有这个:

 Haproxy::Service['haproxy'] -> Exec['keystone-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['glance-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['nova-db-sync']
 Haproxy::Service['haproxy'] -> Exec['glance-manage db_sync']
 Haproxy::Service['haproxy'] -> Exec['neutron-db-sync']
 Haproxy::Service['haproxy'] -> Exec['heat-dbsync']
 Haproxy::Service['haproxy'] -> Exec['ceilometer-dbsync']
 Haproxy::Service['haproxy'] -> Exec['cinder-manage db_sync']

Please if someone out there knows of a better way by maybe using anchors or resource collectors please reply. 如果有人知道使用锚或资源收集器有更好的方法,请回复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM