Hi,
On 24.12.2013 10:54, Andre Marschalek wrote:
hello,
i try to build a cluster with 2 nodes and the cluster itself works
(ssl and communication) but if i change config files on one node
nothing will be replicated to the other node, i always see sending 0
config files… in the logs
for example create a whatever.conf under /etc/icinga2/conf.d/ and do a
service icinga2 reload on icinga-node-sw
please could you tell me what is wrong?
Show the connection and replication logs for the cluster component
(having mainlog enabled, or debuglog).
And please always share the installation method and exact version
(icinga2 --version).
config node 1
I guess, that's the config master in this example, namely
'icinga-mode-sw', right?
include <itl/itl.conf>
include "features-enabled/*.conf"
include_recursive "conf.d" "*.conf"
library "cluster"
object ClusterListener "cluster" {
ca_path = "/etc/icinga2/ca/ca.crt",
cert_path = "/etc/icinga2/ca/icinga-node-sw.crt",
key_path = "/etc/icinga2/ca/icinga-node-sw.key",
bind_port = 8888,
peers = [ "icinga-node-mt" ]
}
object Endpoint "icinga-node-sw" {
host = "icinga-node-sw",
port = 8888,
config_files = [ "/etc/icinga2/conf.d/*.conf" ]
}
object Endpoint "icinga-node-mt" {
host = "icinga-node-mt",
port = 8888
}
*If* icinga-node-sw should send its configuration to icinga-node-mt,
you'll need to configure that into that endpoint. That's the local view
of the cluster node, sending its configuration to the remote peer.
Like so
object Endpoint "icinga-node-sw" {
host = "icinga-node-sw",
port = 8888
}
object Endpoint "icinga-node-mt" {
host = "icinga-node-mt",
port = 8888,
config_files = [ "/etc/icinga2/conf.d/*.conf" ]
}
config node 2
include <itl/itl.conf>
include "features-enabled/*.conf"
include_recursive "conf.d" "*.conf"
If that option includes duplicated information distributed via cluster,
it may render the configuration invalid by causing duplicate objects.
Leaving or removing that include highly depends on the usage of this
node (for example, acting as checker only, receiving its configuration
from the "master" only).
library "cluster"
object ClusterListener "cluster" {
ca_path = "/etc/icinga2/ca/ca.crt",
cert_path = "/etc/icinga2/ca/icinga-node-mt.crt",
key_path = "/etc/icinga2/ca/icinga-node-mt.key",
bind_port = 8888,
peers = [ "icinga-node-sw" ]
}
object Endpoint "icinga-node-mt" {
host = "icinga-node-mt",
port = 8888,
accept_config = [ “icinga-node-sw” ]
}
object Endpoint "icinga-node-sw" {
host = "icinga-node-sw",
port = 8888
}
include (IcingaLocalStateDir + "/lib/icinga2/cluster/config/*/*")
The above setting would tell icinga-node-mt to accept config from the
icinga-node-sw peer. That's obviously correct. But for better reading,
you should order your EndPoint objects the same on each host.
object Endpoint "icinga-node-sw" {
host = "icinga-node-sw",
port = 8888
}
object Endpoint "icinga-node-mt" {
host = "icinga-node-mt",
port = 8888,
accept_config = [ “icinga-node-sw” ]
}
You may even use the same endpoint configuration on all nodes, but you
need to keep in mind, which local instance/node looks at those endpoints.
In your example, both nodes would share
object Endpoint "icinga-node-sw" {
host = "icinga-node-sw",
port = 8888
}
object Endpoint "icinga-node-mt" {
host = "icinga-node-mt",
port = 8888,
accept_config = [ “icinga-node-sw” ],
config_files = [ "/etc/icinga2/conf.d/*.conf" ]
}
On icinga-node-sw, this will send the config_files defined to
icinga-node-mt.
On icinga-node-mt, accept_config will allow icinga-node-sw to send
config over.
That may sound complicated, but if you got better ideas on the attribute
naming, please share them with us. For now, it works like that.
best regards,
Michael
--
DI (FH) Michael Friedrich
mail: michael.friedr...@gmail.com
twitter: https://twitter.com/dnsmichi
jabber: dnsmi...@jabber.ccc.de
irc: irc.freenode.net/icinga dnsmichi
icinga open source monitoring
position: lead core developer
url: https://www.icinga.org
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users