Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add broker cluster peer port by default when network_peers is specified #253

Closed
wants to merge 1 commit into from
Closed

Add broker cluster peer port by default when network_peers is specified #253

wants to merge 1 commit into from

Conversation

serialh0bbyist
Copy link

This should satisfy #252

@serialh0bbyist
Copy link
Author

I also formatted some of the if and unless statements based on whether or not they were nested in the erb template.


<% if $choria::broker::cluster_peer_port > 0 {-%>
<% } -%>
<% unless $choria::broker::network_peers.empty { -%>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately its not this easy, you can have a broker with no declared peers, with its port open, thats a valid configuration.

In a setup like above if a new broker connects to this broker that has no known peers it will solicit the peer list from this new incoming peer and connect to them all. They also gossip the topology continuesly to keep this going, so you can have say 2 seed brokers and any number of unconfigured ones that learn the topology without configuration. We dont use it this way in the puppet modules, but its supported.

So we need something like (psuedo code):

if len(peers) > 0 {
   if peer_port == 0 {
     peer_port = 4223 // default port
   }

   configure_peer_port
   configure_peers
} else if peer_port > 0 {
   configure_peer_port
}

@serialh0bbyist serialh0bbyist closed this by deleting the head repository Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants