Closed icinga-migration closed 10 years ago
Updated by mfriedrich on 2014-05-22 18:30:47 +00:00
Updated by mfriedrich on 2014-06-10 13:59:55 +00:00
Imho that should rather be a global zone being synced to all nodes, flagged with a configuration attribute like `global = true`. That way the configuration naming is not scattered with an additional global constant, and everyone may just use whatever zone name they prefer.
Updated by mfriedrich on 2014-06-11 12:11:13 +00:00
Updated by mfriedrich on 2014-06-11 12:53:57 +00:00
Updated by tobiasvdk on 2014-06-11 12:55:25 +00:00
Having a zone marked as global
which gets synchronized to all nodes sounds very good.
Updated by Anonymous on 2014-06-11 14:55:03 +00:00
Applied in changeset 2ca2f9535de9c55d5d81bda6a4b47047dcc40ca4.
Updated by tobiasvdk on 2014-06-12 09:19:02 +00:00
Using 2.0.0~beta2+icingasnap201406112056.8d344eb~wheezy
the shared zone is sometimes created in /var/lib/icinga2/api/zones
on the endpoint but no files got sychronized. Sometime even the directory does not exists.
Starting icinga I see
[2014-06-12 11:09:37 +0200] information/ApiListener: Syncing zone: karlsruhe
[2014-06-12 11:09:38 +0200] information/ApiListener: Syncing zone: master
[2014-06-12 11:09:38 +0200] information/ApiListener: Syncing zone: shared
Couldn't find anything about the "shared" zone in icinga2.log
or debug.log
master zones.conf
/**
object Endpoint "icinga21" { //host = NodeName host = "192.168.178.41" }
object Endpoint "icinga21-ka" { host = "10.1.1.31" }
/**
object Zone "master" { endpoints = ["icinga21"] }
/*
object Zone "shared" { global = true }
/**
object Zone "karlsruhe" { endpoints = ["icinga21-ka"] parent = "master" }
object Zone "frankfurt-am" { //endpoints = ["icinga21-ffa"] parent = "master" }
object Zone "las-vegas" { //endpoints = ["icinga21-lv"] parent = "master" }
object Zone "office" { //endpoints = ["icinga21-office"] parent = "master" }
// vim: filetype=icinga2
icinga21-ka
zones.conf
:
/**
object Endpoint "icinga21" { //host = NodeName host = "192.168.178.41" }
object Endpoint "icinga21-ka" { host = "10.1.1.31" }
/**
object Zone "master" { endpoints = ["icinga21"] }
/**
object Zone "karlsruhe" { endpoints = ["icinga21-ka"] parent = "master" }
Updated by tobiasvdk on 2014-06-12 09:22:53 +00:00
On the master icinga21
the directory /var/lib/icinga2/api/zones/shared
exists with all files.
Updated by mfriedrich on 2014-06-12 09:28:18 +00:00
The slaves don't have the shared zone configured. why?
Updated by tobiasvdk on 2014-06-12 09:30:49 +00:00
Adding the "shared" zone definition on icinga21-ka
results in the following error:
# service icinga2 checkconfig
[....] checking Icinga2 configuration
[2014-06-12 11:29:02 +0200] information/icinga-app: Icinga application loader (version: 2.0.0~beta2+icingasnap201406112056.8d344eb~wheezy)
[2014-06-12 11:29:02 +0200] information/icinga-app: Loading application type: icinga/IcingaApplication
[2014-06-12 11:29:02 +0200] information/Utility: Loading library 'libicinga.so'
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Adding include search dir: /usr/share/icinga2/include
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/icinga2.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/constants.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/zones.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/itl
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command.conf
[2014-06-12 11:29:02 +0200] information/Utility: Loading library 'libmethods.so'
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-icinga.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/timeperiod.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-plugins.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/api.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/checker.conf
[2014-06-12 11:29:02 +0200] information/Utility: Loading library 'libchecker.so'
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/debuglog.conf
[2014-06-12 11:29:02 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/mainlog.conf
[2014-06-12 11:29:02 +0200] information/ConfigItem: Validating config items (step 1)...
[2014-06-12 11:29:02 +0200] information/ConfigItem: Committing config items
[2014-06-12 11:29:02 +0200] information/ConfigItem: Triggering OnConfigLoaded signal for config items
[2014-06-12 11:29:02 +0200] information/ApiListener: My API identity: icinga21-ka
[2014-06-12 11:29:02 +0200] information/ApiListener: Syncing zone: shared
Caught unhandled exception.
Current time: 2014-06-12 11:29:02 +0200
***
* Application version: 2.0.0~beta2+icingasnap201406112056.8d344eb~wheezy
* Installation root: /usr
* Sysconf directory: /etc
* Local state directory: /var
* Package data directory: /usr/share/icinga2
* State path: /var/lib/icinga2/icinga2.state
* PID path: /var/run/icinga2/icinga2.pid
* Application type: icinga/IcingaApplication
***
../../../lib/base/utility.cpp(611): Throw in function static bool icinga::Utility::GlobRecursive(const icinga::String&, const icinga::String&, const boost::function&, int)
Dynamic exception type: boost::exception_detail::clone_impl
std::exception::what: std::exception
[icinga::StackTrace*] =
(0) libbase.so: void boost::throw_exception(icinga::posix_error const&) (+0x4a) [0x7f440f1e860a] (??:0)
(1) libbase.so: void boost::exception_detail::throw_exception_(icinga::posix_error const&, char const*, char const*, int) (+0x3c) [0x7f440f1e866c] (??:0)
(2) libbase.so: icinga::Utility::GlobRecursive(icinga::String const&, icinga::String const&, boost::function const&, int) (+0x903) [0x7f440f2564c3] (??:0)
(3) libremote.so: icinga::ApiListener::LoadConfigDir(icinga::String const&) (+0x92) [0x7f440ac60c42] (??:0)
(4) libremote.so: icinga::ApiListener::SyncZoneDir(boost::shared_ptr const&) const (+0x1c0) [0x7f440ac62110] (??:0)
(5) libremote.so: icinga::ApiListener::SyncZoneDirs() const (+0x57b) [0x7f440ac62afb] (??:0)
(6) libremote.so: icinga::ApiListener::OnConfigLoaded() (+0x2ed) [0x7f440ac4402d] (??:0)
(7) libbase.so: icinga::WorkQueue::WorkerThreadProc() (+0x354) [0x7f440f264f44] (??:0)
(8) libboost_thread.so.1.49.0: (+0x10629) [0x7f440f8e5629] (??:0)
(9) libpthread.so.0: (+0x6b50) [0x7f440f4c3b50] (??:0)
(10) libc.so.6: clone (+0x6d) [0x7f440d5650ed] (??:0)
[icinga::ContextTrace*] =
[boost::errinfo_errno_*] = 2, "No such file or directory"
[boost::errinfo_file_name_*] = /etc/icinga2/zones.d/shared
[boost::errinfo_api_function_*] = opendir
***
* This would indicate a runtime problem or configuration error. If you believe this is a bug in Icinga 2
* please submit a bug report at https://dev.icinga.org/ and include this stack trace as well as any other
* information that might be useful in order to reproduce this problem.
***
Aborted
[FAIL] checking Icinga2 configuration ... failed!
Updated by mfriedrich on 2014-06-12 12:23:08 +00:00
Implemented it the wrong way, and used the wrong cluster config, sorry.
Updated by mfriedrich on 2014-06-12 12:40:24 +00:00
@tobiasvdk
Please re-test.
Updated by tobiasvdk on 2014-06-12 13:13:15 +00:00
Will test it tomorrow morning.
Updated by tobiasvdk on 2014-06-12 20:02:47 +00:00
Works!
Updated by mfriedrich on 2014-06-12 20:06:28 +00:00
Merci!
This issue has been migrated from Redmine: https://dev.icinga.com/issues/6254
Created by tobiasvdk on 2014-05-21 11:51:20 +00:00
Assignee: mfriedrich Status: Resolved (closed on 2014-06-12 20:06:28 +00:00) Target Version: 2.0.0 Last Update: 2014-06-12 20:06:28 +00:00 (in Redmine)
Having a distributed cluster setup it would be nice to specify a directory (of config files, e.g. commands, template services) which gets synchronized to all nodes of all zones.
Changesets
2014-06-10 14:17:01 +00:00 by (unknown) b987b355957b245c70bb3ba9ab451a4dd13a5f97
2014-06-11 14:49:30 +00:00 by (unknown) a3b2b1d7800e280ed99bc9f60c382e19dfbe06db
2014-06-11 14:49:44 +00:00 by (unknown) 2ca2f9535de9c55d5d81bda6a4b47047dcc40ca4
2014-06-11 19:28:01 +00:00 by mfriedrich 318136257fecf2b0f9652d0fcb3c6f37bb2496e3
2014-06-12 12:31:07 +00:00 by (unknown) a57ebbf953c55e16516f67899e9ee4c306065141
2014-06-12 12:33:59 +00:00 by (unknown) d9289add624184102f8a3aed30e8b745d709936b
Relations: