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

Full example of ha cluster deployment #249

Open
fl0wx opened this issue Dec 20, 2023 · 6 comments
Open

Full example of ha cluster deployment #249

fl0wx opened this issue Dec 20, 2023 · 6 comments
Labels
docs Improvements or additions to documentation question Further information is requested

Comments

@fl0wx
Copy link
Contributor

fl0wx commented Dec 20, 2023

Hey ho, is there any example of a full ha cluster deployment with 2 master instances (including icinga2, icingaweb2, icingadb)? Or can you provide one? :)

thanks and regards
fl0wx

@mocdaniel
Copy link
Contributor

mocdaniel commented Dec 20, 2023

There's no official documentation (yet), but you could have a look at my homelab setup which provisions exactly this, using the collection.

One thing that isn't HA even after using the linked playbook is syncing file-based configuration of Icinga Web from one master instance to another. For this, you'd need to jump through quite some more hoops, unfortunately, which is why it's out of the scope of this collection.

@mocdaniel mocdaniel added docs Improvements or additions to documentation question Further information is requested labels Dec 20, 2023
@fl0wx
Copy link
Contributor Author

fl0wx commented Dec 20, 2023

thanks a lot :) ill take a look into this :)

@aneffati
Copy link

aneffati commented Dec 21, 2023

Thanks a lot, I'm also looking for the same example for HA cluster with 2 masters .
My issue that I don't get the icinga2 service started and I have the following error when I run : icinga2 daemon -C

[2023-12-21 04:42:18 -0500] critical/config: Error: Endpoint object for 'icinga-primary-1' is missing.
Location: in /etc/icinga2/features-enabled/api.conf: 1:0-1:23
/etc/icinga2/features-enabled/api.conf(1): object ApiListener "api" {
                                           ^^^^^^^^^^^^^^^^^^^^^^^^
/etc/icinga2/features-enabled/api.conf(2):   ticket_salt = TicketSalt
/etc/icinga2/features-enabled/api.conf(3):   accept_config = false
[2023-12-21 04:42:18 -0500] critical/config: 1 error

My config is like the following

icinga2_features:
  - name: api
    ca_host: none  
    endpoints:
      - name: icinga-primary-1.{{ env }}.local
        host: icinga-primary-1.{{ env }}.local
      - name: icinga-primary-2.{{ env }}.local
        host: icinga-primary-2.{{ env }}.local
    zones:
      - name: "master"
        endpoints:
          - icinga-primary-1.{{ env }}.local
          - icinga-primary-2.{{ env }}.local
          
icinga2_objects:
  icinga-primary-1.{{ env }}.local:
    - name: icingaweb
      type: ApiUser
      file: local.d/apiusers.conf
      password: "***********"
      permissions: ['*']
  
  icinga-primary-2.{{ env }}.local:
    - name: icingaweb
      type: ApiUser
      file: local.d/apiusers.conf
      password: "***********"
      permissions: ['*']

Not sure but did we need to create also Objects type Zone and Endpoints also or they are not needed. I tried them but also nothing was changed
Any idea ?

Thanks
Achraf

@mkayontour
Copy link
Member

mkayontour commented Dec 21, 2023

Can you put the following in quotes:

icinga2_features:
  - name: api
    ca_host: none  
    endpoints:
      - name: "icinga-primary-1.{{ env }}.local"
        host: "icinga-primary-1.{{ env }}.local"
      - name: "icinga-primary-2.{{ env }}.local"
        host: "icinga-primary-2.{{ env }}.local"
    zones:
      - name: "master"
        endpoints:
          - "icinga-primary-1.{{ env }}.local"
          - "icinga-primary-2.{{ env }}.local"

@aneffati
Copy link

I followed the same config example provided mocdaniel and also I tried with quotes but I'm still getting the same issue.

@mkayontour
Copy link
Member

Ok, can you post the zones.conf, what is the result. Please post the following files zones.conf and constants.conf. If available redact secrets before posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants