せでぃのブログ

ブログ初心者おいどんのどうでもいい愚痴やどうでもいい愚痴やどうでもいいマメ知識などを披露するチラシの裏です。

BIND10で権威サーバとリゾルバの両立ができない件

20160513追記:b10-resolverを単体で起動してみた

#1703 (should not shutdown if a component is later added and it fails) – Kea Development
 リゾルバを追加すると権威サーバも本体も道連れにして落ちる。症状はまさにこれ。
 ガイドにはこう書いてあるから、理屈だけで言えば権威サーバとリゾルバは両立できるはず。kind needed設定のせいで道連れなのはわかるが、リゾルバのファイルが見つからんみたいなエラーがよくわからんなぁ。
 総じて、BIND10の実稼働はまだまだ早いと思う。開発完了というかサジ投げたようにしか見えない。

The main bind10 process can be configured to select to run either the authoritative or resolver or both.


 bind10のメインプロセスはいずれかの機能の実行を選ぶように設定ができる。権威サーバか、(フルサービス)リゾルバか、その両方か。

http://kea.isc.org/~jreed/bind10-guide.html#resolverserver

落ちた時のログ

 速攻で「BIND10_COMPONENT_START_EXCEPTION component b10-resolver failed to start: [Errno 2] No such file or directory: 'b10-resolver'」ファイルがないとか言われて悲しい。プライオリティは設定入れようが入れまいが、commitの直後に落ちる。
 次回は権威サーバを消して、リゾルバ単独で動くかやってみるか。

["login success"] login as root
> config show all
Logging/loggers list (default)
Cmdctl/key_file "/usr/local/etc/bind10/cmdctl-keyfile.pem" string (default)
Cmdctl/cert_file "/usr/local/etc/bind10/cmdctl-certfile.pem" string (default)
Cmdctl/accounts_file "/usr/local/etc/bind10/cmdctl-accounts.csv" string (default)
tsig_keys/keys
list (default)
Stats/poll-interval 60 integer (default)
Auth/database_file "/usr/local/var/bind10/zone.sqlite3" string (default)
Auth/datasources list (default)
Auth/listen_on[0]/address "::" string (default)
Auth/listen_on[0]/port 53 integer (default)
Auth/listen_on[1]/address "0.0.0.0" string (default)
Auth/listen_on[1]/port 53 integer (default)
Auth/tcp_recv_timeout 5000 integer (default)
data_sources/classes/IN[0]/type "sqlite3" string
data_sources/classes/IN[0]/params {"database_file": "/usr/local/var/bind10/zone.sqlite3"} any
data_sources/classes/IN[0]/cache-enable false boolean (default)
data_sources/classes/IN[0]/cache-zones
list
data_sources/classes/IN[0]/name null string
data_sources/classes/IN[0]/cache-type "local" string (default)
data_sources/classes/IN[1]/type "MasterFiles" string
data_sources/classes/IN[1]/params {"orenchi.local": "/usr/local/share/bind10/orenchi.local"} any
data_sources/classes/IN[1]/cache-enable true boolean
data_sources/classes/IN[1]/cache-zones list
data_sources/classes/IN[1]/name null string
data_sources/classes/IN[1]/cache-type "local" string (default)
Init/components/b10-auth/special "auth" string
Init/components/b10-auth/process null string
Init/components/b10-auth/kind "needed" string
Init/components/b10-auth/address null string
Init/components/b10-auth/params
list
Init/components/b10-auth/priority 10 integer
Init/components/b10-stats/special null string
Init/components/b10-stats/process null string
Init/components/b10-stats/kind "dispensable" string
Init/components/b10-stats/address "Stats" string
Init/components/b10-stats/params list
Init/components/b10-stats/priority null integer
Init/components/b10-cmdctl/special "cmdctl" string
Init/components/b10-cmdctl/process null string
Init/components/b10-cmdctl/kind "needed" string
Init/components/b10-cmdctl/address null string
Init/components/b10-cmdctl/params
list
Init/components/b10-cmdctl/priority null integer


> config add Init/components b10-resolver
> config set Init/components/b10-resolver/special resolver
> config set Init/components/b10-resolver/kind needed
> config set Init/components/b10-resolver/priority 9
> config commit
2016-04-26 15:21:52.838 INFO [b10-init.init/2023] BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components
2016-04-26 15:21:52.842 INFO [b10-init.init/2023] BIND10_COMPONENT_START component b10-resolver is starting
2016-04-26 15:21:52.844 INFO [b10-init.init/2023] BIND10_STARTING_PROCESS starting process b10-resolver
2016-04-26 15:21:52.853 ERROR [b10-init.init/2023] BIND10_COMPONENT_START_EXCEPTION component b10-resolver failed to start: [Errno 2] No such file or directory: 'b10-resolver'
2016-04-26 15:21:52.857 ERROR [b10-init.init/2023] BIND10_COMPONENT_FAILED component b10-resolver (pid None) failed: unknown condition
2016-04-26 15:21:52.858 FATAL [b10-init.init/2023] BIND10_COMPONENT_UNSATISFIED component b10-resolver is required to run and failed
2016-04-26 15:21:52.860 ERROR [b10-init.init/2023] BIND10_CONFIGURATOR_PLAN_INTERRUPTED configurator plan interrupted, only 0 of 1 done
2016-04-26 15:21:52.861 ERROR [b10-init.init/2023] BIND10_RECONFIGURE_ERROR Error applying new config: [Errno 2] No such file or directory: 'b10-resolver'
2016-04-26 15:21:52.867 ERROR [b10-cmdctl.cmdctl/2032] CMDCTL_COMMAND_ERROR error in command set_config to module ConfigManager: [Errno 2] No such file or directory: 'b10-resolver'
Error: [Errno 2] No such file or directory: 'b10-resolver'
Configuration not committed
> 2016-04-26 15:21:52.874 INFO [b10-init.init/2023] BIND10_SHUTDOWN stopping the server
2016-04-26 15:21:52.882 INFO [b10-init.init/2023] BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down
2016-04-26 15:21:52.884 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component cfgmgr is being stopped
2016-04-26 15:21:52.886 INFO [b10-init.init/2023] BIND10_STOP_PROCESS asking cfgmgr to shut down
2016-04-26 15:21:52.890 INFO [b10-cfgmgr.cfgmgr/2027] CFGMGR_STOPPED_BY_COMMAND received shutdown command, shutting down
2016-04-26 15:21:52.894 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component b10-stats is being stopped
2016-04-26 15:21:52.898 INFO [b10-init.init/2023] BIND10_STOP_PROCESS asking b10-stats to shut down
2016-04-26 15:21:52.901 INFO [b10-stats.stats/2031] STATS_RECEIVED_SHUTDOWN_COMMAND shutdown command received
2016-04-26 15:21:52.902 INFO [b10-stats.stats/2031] STATS_EXITING exiting
2016-04-26 15:21:52.906 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component msgq is being stopped
2016-04-26 15:21:52.907 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component b10-cmdctl is being stopped
2016-04-26 15:21:52.911 INFO [b10-init.init/2023] BIND10_STOP_PROCESS asking b10-cmdctl to shut down
2016-04-26 15:21:52.914 INFO [b10-cmdctl.cmdctl/2032] CMDCTL_EXITING exiting
2016-04-26 15:21:52.921 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component b10-auth is being stopped
2016-04-26 15:21:52.924 INFO [b10-init.init/2023] BIND10_STOP_PROCESS asking b10-auth to shut down
2016-04-26 15:21:52.927 INFO [b10-auth.auth/2030] AUTH_SERVER_EXITING exiting
2016-04-26 15:21:52.929 INFO [b10-auth.auth/2030] AUTH_DATASRC_CLIENTS_BUILDER_STOPPED data source builder thread stopped
2016-04-26 15:21:52.934 INFO [b10-init.init/2023] BIND10_COMPONENT_STOP component Socket creator is being stopped
2016-04-26 15:21:52.938 INFO [b10-init.init/2023] BIND10_SOCKCREATOR_TERMINATE terminating socket creator
2016-04-26 15:21:53.940 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2024 of Socket creator ended with status 0
2016-04-26 15:21:53.941 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2027 of cfgmgr ended with status 0
2016-04-26 15:21:53.941 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2030 of b10-auth ended with status 0
2016-04-26 15:21:53.942 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2031 of b10-stats ended with status 0
2016-04-26 15:21:53.943 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2032 of b10-cmdctl ended with status 0
2016-04-26 15:21:53.947 INFO [b10-init.init/2023] BIND10_SEND_SIGTERM sending SIGTERM to msgq (PID 2025)
2016-04-26 15:21:54.053 INFO [b10-init.init/2023] BIND10_PROCESS_ENDED process 2025 of msgq ended with status 0
2016-04-26 15:21:54.054 INFO [b10-init.init/2023] BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete

Failed to send request, the connection is closed

special,kind,priorityパラメータの意味

The special one is for components that need some kind of special care during startup or shutdown. Unless specified, the component is started in usual way. This is the list of components that need to be started in a special way, with the value of special used for them:


 specialのパラメータは、スタートアップとシャットダウンの間、コンポーネントが必要とするある種の特別な扱いを受けるためのもの。これが明示されないと、コンポーネントは普通の方法で開始される。コンポーネントが特別な方法で開始されるのに必要なリストがこれ。特別な使用に必要な値もまとめて。


Table 3.1.

Component Special Description
b10-auth auth Authoritative server
b10-resolver resolver The resolver
b10-cmdctl cmdctl The command control (remote control interface)




The kind specifies how a failure of the component should be handled. If it is set to “dispensable” (the default unless you set something else), it will get started again if it fails. If it is set to “needed” and it fails at startup, the whole bind10 shuts down and exits with error exit code. But if it fails some time later, it is just started again. If you set it to “core”, you indicate that the system is not usable without the component and if such component fails, the system shuts down no matter when the failure happened. This is the behaviour of the core components (the ones you can't turn off), but you can declare any other components as core as well if you wish (but you can turn these off, they just can't fail).


 kindのパラメータはコンポーネントの失敗がどのように制御されるかを決めている。"dispensable"(何も設定しなければデフォルト値)に設定されると、コンポーネントが失敗すると再開される。"needed"に設定して、スタートアップに失敗すると、bind10は丸ごとシャットダウンし、エラーのexit codeと共にexitする。しかし、コンポーネントがしばらくしてから失敗すると、それだけで再開される。"core"に設定するとそのコンポーネントなしではそのシステムが使用できないことを示し、そのようなコンポーネントが失敗すると、失敗が起きた時点でそれがどんな時でもそのシステムはシャットダウンする。これがコアコンポーネント(オフにはできない)の振る舞いだが、希望すれば(しかし、これらをオフにでき、それらは失敗できない)他のコンポーネントをコアとして宣言することができる。



The priority defines order in which the components should start. The ones with higher number are started sooner than the ones with lower ones. If you don't set it, 0 (zero) is used as the priority. Usually, leaving it at the default is enough.


 priorityのパラメータは、コンポーネントが始まる順番を定義している。パラメータの数字が大きいほど早く、小さいほど遅い。何も設定しないと0に設定される。普通は、デフォルトのままで十分。



There are other parameters we didn't use in our example. One of them is “address”. It is the address used by the component on the b10-msgq message bus. The special components already know their address, but the usual ones don't. The address is by convention the thing after b10-, with the first letter capital (eg. b10-stats would have “Stats” as its address).


 例で使わない他のパラメータがある。それらの1つはaddress。それはb10-msgqメッセージバスのコンポーネントで使われるアドレス。特別なコンポーネントは既にそれらのアドレスを知っているが、普通のコンポーネントはそうではない。慣例により、アドレスはb10-の後の文字とされ、一文字目は大文字になる。(例えば、b10-statsは「Stats」がそのアドレスになる)



The last one is process. It is the name of the process to be started. It defaults to the name of the component if not set, but you can use this to override it.


 最後はprocess。それは開始されるプロセスの名前。設定されなければ、コンポーネントの名前がデフォルトになるが、このパラメータを使うことで上書きできる。

http://kea.isc.org/~jreed/bind10-guide.html#bind10.config

b10-resolverは単体でも動かない

 ダメだこりゃ。

# bindctl
WARNING: The Python readline module isn't available, so some command line
         editing features (including command history management) will not
         work.  See the BIND 10 guide for more details.

["login success"] login as root
> config remove Init/components b10-auth
> config commit
2016-05-13 00:02:41.566 INFO  [b10-init.init/1447] BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components
2016-05-13 00:02:41.568 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component b10-auth is being stopped
2016-05-13 00:02:41.570 INFO  [b10-init.init/1447] BIND10_STOP_PROCESS asking b10-auth to shut down
2016-05-13 00:02:41.574 INFO  [b10-auth.auth/1453] AUTH_SERVER_EXITING exiting
2016-05-13 00:02:41.575 INFO  [b10-auth.auth/1453] AUTH_DATASRC_CLIENTS_BUILDER_STOPPED data source builder thread stopped
2016-05-13 00:02:41.584 INFO  [b10-init.init/1447] BIND10_LOST_SOCKET_CONSUMER consumer 19 of sockets disconnected, considering all its sockets closed
2016-05-13 00:02:41.594 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1453 of b10-auth ended with status 0



> config add Init/components b10-resolver
> config set Init/components/b10-resolver/special resolver
> config set Init/components/b10-resolver/kind needed
> config set Init/components/b10-resolver/priority 10
> config commit
2016-05-13 00:04:09.490 INFO  [b10-init.init/1447] BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components
2016-05-13 00:04:09.493 INFO  [b10-init.init/1447] BIND10_COMPONENT_START component b10-resolver is starting
2016-05-13 00:04:09.496 INFO  [b10-init.init/1447] BIND10_STARTING_PROCESS starting process b10-resolver
2016-05-13 00:04:09.507 ERROR [b10-init.init/1447] BIND10_COMPONENT_START_EXCEPTION component b10-resolver failed to start: [Errno 13] Permission denied
2016-05-13 00:04:09.507 ERROR [b10-init.init/1447] BIND10_COMPONENT_FAILED component b10-resolver (pid None) failed: unknown condition
2016-05-13 00:04:09.507 FATAL [b10-init.init/1447] BIND10_COMPONENT_UNSATISFIED component b10-resolver is required to run and failed
2016-05-13 00:04:09.508 ERROR [b10-init.init/1447] BIND10_CONFIGURATOR_PLAN_INTERRUPTED configurator plan interrupted, only 0 of 1 done
2016-05-13 00:04:09.508 ERROR [b10-init.init/1447] BIND10_RECONFIGURE_ERROR Error applying new config: [Errno 13] Permission denied
2016-05-13 00:04:09.513 ERROR [b10-cmdctl.cmdctl/1454] CMDCTL_COMMAND_ERROR error in command set_config to module ConfigManager: [Errno 13] Permission denied
Error: [Errno 13] Permission denied
Configuration not committed
> 2016-05-13 00:04:09.519 INFO  [b10-init.init/1447] BIND10_SHUTDOWN stopping the server
2016-05-13 00:04:09.529 INFO  [b10-init.init/1447] BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down
2016-05-13 00:04:09.532 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component cfgmgr is being stopped
2016-05-13 00:04:09.533 INFO  [b10-init.init/1447] BIND10_STOP_PROCESS asking cfgmgr to shut down
2016-05-13 00:04:09.536 INFO  [b10-cfgmgr.cfgmgr/1451] CFGMGR_STOPPED_BY_COMMAND received shutdown command, shutting down
2016-05-13 00:04:09.541 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component msgq is being stopped
2016-05-13 00:04:09.542 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component b10-cmdctl is being stopped
2016-05-13 00:04:09.547 INFO  [b10-init.init/1447] BIND10_STOP_PROCESS asking b10-cmdctl to shut down
2016-05-13 00:04:09.550 INFO  [b10-cmdctl.cmdctl/1454] CMDCTL_EXITING exiting
2016-05-13 00:04:09.555 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component b10-stats is being stopped
2016-05-13 00:04:09.557 INFO  [b10-init.init/1447] BIND10_STOP_PROCESS asking b10-stats to shut down
2016-05-13 00:04:09.560 INFO  [b10-stats.stats/1455] STATS_RECEIVED_SHUTDOWN_COMMAND shutdown command received
2016-05-13 00:04:09.562 INFO  [b10-stats.stats/1455] STATS_EXITING exiting
2016-05-13 00:04:09.567 INFO  [b10-init.init/1447] BIND10_COMPONENT_STOP component Socket creator is being stopped
2016-05-13 00:04:09.571 INFO  [b10-init.init/1447] BIND10_SOCKCREATOR_TERMINATE terminating socket creator
2016-05-13 00:04:10.578 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1448 of Socket creator ended with status 0
2016-05-13 00:04:10.579 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1451 of cfgmgr ended with status 0
2016-05-13 00:04:10.579 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1454 of b10-cmdctl ended with status 0
2016-05-13 00:04:10.580 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1455 of b10-stats ended with status 0
2016-05-13 00:04:10.581 INFO  [b10-init.init/1447] BIND10_SEND_SIGTERM sending SIGTERM to msgq (PID 1449)
2016-05-13 00:04:10.685 INFO  [b10-init.init/1447] BIND10_PROCESS_ENDED process 1449 of msgq ended with status 0
2016-05-13 00:04:10.685 INFO  [b10-init.init/1447] BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete

Failed to send request, the connection is closed
[1]+  終了 1