ansible-middleware / amq

A collection to manage AMQ brokers
Apache License 2.0
20 stars 11 forks source link

master/slave via shared storage #183

Closed garethahealy closed 2 months ago

garethahealy commented 2 months ago
SUMMARY

I am testing a shared storage scenario. But hitting issues.

From looking at the code, I need the below vars:

But with the above, I'll get a cluster-connection also created:

I tried the below, thinking that might not add them like federated but it creates an invalid broker.xml

activemq_cluster_discovery: "provided"
activemq_cluster_connections: []
AMQ214019: Invalid configuration
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'static-connectors' is not complete. One of '{"urn:activemq:core":connector-ref}' is expected.
<cluster-connections>
      <cluster-connection name="CLamq1">
        <connector-ref>artemis</connector-ref>
        <message-load-balancing>ON_DEMAND</message-load-balancing>
        <max-hops>1</max-hops>
        <static-connectors>
            </static-connectors>
      </cluster-connection>
    </cluster-connections>

Because I am trying to create a shared storage setup, I wouldn't expect cluster connections.

Do you have any suggestions for what I am doing wrong?

guidograzioli commented 2 months ago

I guess you are setting up a single primary/backup on shared store on a single host? Even in that case my understanding cluster-connections are needed, check the docs:

Also each node, live and backups, will need to have a cluster connection defined even if not part of a cluster. The Cluster Connection info defines how backup servers announce there presence to its live server or any other nodes in the cluster. Refer to Clusters for details on how this is done.

For a simple case like that, I'd rely on "static" and let use the default connectors, otherwise provide the connectors as in the molecule/static_cluster test scenario

guidograzioli commented 2 months ago

If could be useful to add a | length > 0 check there https://github.com/ansible-middleware/amq/blob/main/roles/activemq/templates/cluster_connections.broker.xml.j2#L11 but I am not sure because it could also generate a valid broker.xml with an empty list of static_connectors and no discovery-group

garethahealy commented 2 months ago

Also each node, live and backups, will need to have a clust

hmmm. let me retest then, as might be my miss-understanding.

I think it is for the backup that becomes live to announce itself to the rest of the cluster; in your case there is no rest of the cluster..... but the config is still relevant.

garethahealy commented 2 months ago

Ye, my miss-understanding. Closing