systemd-resolvedが頻繁に再起動されるのはなぜですか?

systemd-resolvedが頻繁に再起動されるのはなぜですか?

EC2インスタンスをUbuntu 18.04にアップグレードした後、PHPスクリプトでデータベースサーバーのDNSを確認すると、次のエラーが時々発生し始めました。

Uncaught Exception: PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

これは、syslog の systemd-resolved 再起動に関連しています。デバッグログをオンにしたが、サービスが1日に数回再起動される理由はまだ理解されていません。再起動に関連するsyslogエントリは次のとおりです。

Dec 6 11:31:20 ip-172-31-X-X systemd-resolved[15188]: Processing incoming packet on transaction 51967. (rcode=SUCCESS)
Dec 6 11:31:20 ip-172-31-X-X systemd-resolved[15188]: Processing query...
Dec 6 11:31:20 ip-172-31-X-X systemd-resolved[15188]: Cache miss for sqs.us-west-2.amazonaws.com IN A, Cache miss for sqs.us-west-2.amazonaws.com IN A @version:1 @timestamp:December 6th 2018, 05:31:20.000
Dec 6 11:31:20 ip-172-31-X-X systemd-resolved[15188]: Removing cache entry for gmail-imap.l.google.com IN AAAA (expired 19s ago)
Dec 6 11:31:22 ip-172-31-X-X systemd-resolved[15188]: Removing scope on link *, protocol dns, family *
Dec 6 11:31:22 ip-172-31-X-X dhclient[768]: DHCPREQUEST of 172.31.X.X on eth0 to 172.31.32.X port 67 (xid=0x66c614b9)
Dec 6 11:31:22 ip-172-31-X-X dhclient[768]: DHCPACK of 172.31.X.X from 172.31.32.X
Dec 6 11:31:22 ip-172-31-X-X systemd-resolved[15188]: Bus n/a: changing state RUNNING → CLOSED
Dec 6 11:31:22 ip-172-31-X-X systemd[1]: Stopping Network Name Resolution...
Dec 6 11:31:23 ip-172-31-X-X dhclient[768]: bound to 172.31.X.X -- renewal in 1565 seconds.
Dec 6 11:31:23 ip-172-31-X-X systemd-resolved[15465]: Got message type=signal sender=org.freedesktop.DBus destination=:1.2496 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Dec 6 11:31:23 ip-172-31-X-X systemd-resolved[15465]: Found new link 2/eth0
Dec 6 11:31:23 ip-172-31-X-X systemd-resolved[15465]: New scope on link *, protocol dns, family *

私は/etc/resolv.conf基本的なAWSのように見え、次のものを/run/systemd/resolve/resolv.conf含むシンボリックリンクです。

nameserver 172.31.0.X
search us-west-2.compute.internal

ランダムに再起動しているように見える理由と問題を解決するために何ができるかを知っている人はいますか?

ベストアンサー1

私の考えでは、根本的な原因はログからsystemd-resolved再開されたことですdhclient。皆さんも同じでしょう。

このバグレポートを見てくださいhttps://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1805183

パッチを適用した後https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1805183/comments/8php-fpm(とgetaddrinfo)は再び文句を言わなかった。

おすすめ記事