распределенные зависания kafka-connect (?), если запущены с systemd - PullRequest
0 голосов
/ 18 марта 2020

После того, как я запускаю распределенный kafka connect, он начинает писать логи, но затем обрывается. Процесс подключения Kafka продолжает работать, судя по ps aux, но не продолжает прослушивать порт api rest, как положено. Если я запускаю ту же команду в той же системе в терминале, kafka connect запускается, как и ожидалось.

Журналы Kafka connect из systemd:

Mar 18 00:51:37 puppet-server systemd[1]: Started kafkaconnect.service.
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,057] INFO Loading plugin from: /usr/local/share/kafka/plugins/debezium-connector-postgres (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:176)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,496] INFO Registered loader: PluginClassLoader{pluginLocation=file:/usr/local/share/kafka/plugins/debezium-connector-postgres/} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:199)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,496] INFO Added plugin 'io.debezium.connector.postgresql.PostgresConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,497] INFO Added plugin 'io.debezium.transforms.ExtractNewRecordState' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,497] INFO Added plugin 'io.debezium.transforms.ByLogicalTableRouter' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,497] INFO Added plugin 'io.debezium.transforms.outbox.EventRouter' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
Mar 18 00:51:38 puppet-server connect-distributed.sh[28698]: [2020-03-18 00:51:38,497] INFO Added plugin 'io.debezium.transforms.UnwrapFromEnvelope' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)

Журналы Kafka connect, если они запускаются вручную (не полностью) :

[2020-03-18 00:54:44,119] INFO Loading plugin from: /usr/local/share/kafka/plugins/debezium-connector-postgres (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:176)
[2020-03-18 00:54:44,612] INFO Registered loader: PluginClassLoader{pluginLocation=file:/usr/local/share/kafka/plugins/debezium-connector-postgres/} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:199)
[2020-03-18 00:54:44,613] INFO Added plugin 'io.debezium.connector.postgresql.PostgresConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:44,614] INFO Added plugin 'io.debezium.transforms.ExtractNewRecordState' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:44,614] INFO Added plugin 'io.debezium.transforms.ByLogicalTableRouter' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:44,614] INFO Added plugin 'io.debezium.transforms.outbox.EventRouter' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:44,614] INFO Added plugin 'io.debezium.transforms.UnwrapFromEnvelope' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,569] INFO Registered loader: sun.misc.Launcher$AppClassLoader@764c12b6 (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:199)
[2020-03-18 00:54:46,570] INFO Added plugin 'org.apache.kafka.connect.tools.SchemaSourceConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,570] INFO Added plugin 'org.apache.kafka.connect.tools.MockSinkConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,570] INFO Added plugin 'org.apache.kafka.connect.tools.MockSourceConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,570] INFO Added plugin 'org.apache.kafka.connect.file.FileStreamSinkConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,571] INFO Added plugin 'org.apache.kafka.connect.tools.MockConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
[2020-03-18 00:54:46,571] INFO Added plugin 'org.apache.kafka.connect.tools.VerifiableSinkConnector' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:132)
...

Я использую следующую конфигурацию systemctl для запуска kafka connect на debian:

[Unit]
Description=
Documentation=
After=network.target

[Service]
Restart=on-failure
User=root
EnvironmentFile=-/etc/environment
ExecStart=/opt/kafka_2.11-0.11.0.1/bin/connect-distributed.sh /opt/kafka_2.11-0.11.0.1/config/connect-distributed.properties
ExecReload=/bin/kill -HUP $MAINPID
RestartSec=20s
KillMode=process
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
...