シッパー(Beats)のインストールに失敗した場合や、ハートビートが異常な場合は、本トピックの手順に従って問題を特定・解決してください。
操作手順
-
Beats サービス用の ECS インスタンスが Alibaba Cloud Linux (Alinux)、Red Hat Enterprise Linux (RHEL)、または CentOS を実行していることを確認します。
-
Beats サービス用の ECS インスタンスが、ご利用の Elasticsearch または Logstash インスタンスと同じ VPC 内にあることを確認します。
-
ECS インスタンスにクラウドアシスタントおよび Docker がインストールされていることを確認します。
ECS インスタンスに接続し、以下のコマンドを実行してインストール状況を確認します。
-
クラウドアシスタントサービスのステータスを確認
systemctl status aliyun.serviceサービスが正常に実行されている場合、次のような出力が表示されます。
[root@VM01 ~]# systemctl status aliyun.service ● aliyun.service - aliyun-assist Loaded: loaded (/etc/systemd/system/aliyun.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2020-08-15 15:38:25 CST; 4 days ago Main PID: 20311 (aliyun-service) CGroup: /system.slice/aliyun.service └─20311 /usr/sbin/aliyun-service Aug 15 15:38:25 VM01 systemd[1]: Stopped aliyun-assist. Aug 15 15:38:25 VM01 systemd[1]: Started aliyun-assist.クラウドアシスタントがインストールされていない場合は、「クラウドアシスタントクライアントのインストール」をご参照ください。
-
Docker のステータスを確認
systemctl status dockerDocker が正常に実行されている場合、次のような出力が表示されます。
[root@VM01 ~]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2020-08-19 16:45:21 CST; 1min 39s ago Docs: http://docs.docker.com Main PID: 14625 (dockerd-current) CGroup: /system.slice/docker.service ├─14625 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runti... └─14632 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metric... Aug 19 16:45:20 VM01 dockerd-current[14625]: time="2020-08-19T16:45:20.973350772+08:00" level=warning msg="Docker could...yste... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.005411644+08:00" level=info msg="Graph migration...cond... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.006055965+08:00" level=info msg="Loading contain...tar... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.136526271+08:00" level=info msg="Firewalld runni...fals... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.239151591+08:00" level=info msg="Default bridge ...dres... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.280253025+08:00" level=info msg="Loading contain...done... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.442183479+08:00" level=info msg="Daemon has comp...atio... Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.442217221+08:00" level=info msg="Docker daemon" ...1.13... Aug 19 16:45:21 VM01 systemd[1]: Started Docker Application Container Engine. Aug 19 16:45:21 VM01 dockerd-current[14625]: time="2020-08-19T16:45:21.450179119+08:00" level=info msg="API listen on /...soc... Hint: Some lines were ellipsized, use -l to show in full.Docker がインストールされていない場合は、「Docker のデプロイと使用方法(Alibaba Cloud Linux 2)」をご参照ください。
-
-
シッパーの YML 構成ファイルを確認し、以下のパラメーターが正しく設定されていることを検証します。
- type: log # Change to true to enable this input configuration. enabled: true # Paths that should be crawled and fetched. Glob based paths. paths: - /var/log/*.logパラメーター
説明
enabled
デフォルト値は
falseです。このパラメーターをtrueに設定する必要があります。paths
ログファイルのパスです。ワイルドカード(例:*.log)を使用できます。
重要-
paths パラメーターは、構成ページで指定する Filebeat ファイルディレクトリとは異なります。Filebeat ファイルディレクトリは Docker によってマップされるディレクトリです。paths で指定されたファイルは、このディレクトリが収集対象ディレクトリにマップされている場合にのみ収集可能です。両方を一致させることを推奨します。
-
構成ページで 出力 を指定した場合は、YML 構成ファイル内で再度指定しないでください。そうでない場合、インストールエラーが発生します。
-
シッパーの YML 構成ファイル内でデフォルトでコメントアウト(
#)されているパラメーター(X-Pack 関連など)を変更する際は注意が必要です。誤った変更により、インストールが失敗する可能性があります。
-
-
ECS インスタンスに接続し、/opt/aliyunbeats/ ディレクトリを確認します。Beats インスタンスに対応するディレクトリが存在し、その中に
conf、data、およびlogsサブディレクトリが含まれていることを検証します。[root@PVM1 ~]# cd /opt/aliyumbeats [root@PVM1 aliyumbeats]# ls ct-cn-77uqof2s7rgxxx [root@PVM1 aliyumbeats]# cd ct-cn-77uqof2s7rgxxx [root@PVM1 ct-cn-77uqof2s7rgxxx]# ls filebeat [root@PVM1 ct-cn-77uqof2s7rgxxx]# cd filebeat [root@PVM1 filebeat]# ls conf data logsまた、
logsディレクトリ内の Beats ログを確認して、問題を特定します。[root@VM01 logs]# tail -n 2 filebeat 2020-08-19T09:25:52.871Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": "metrics": {"beat":{"cpu":{"system":{"ticks":130,"time":{"ms":1}},"total":{"ticks":390,"time":{"ms":5},"value":390},"user":{"ti cks":260,"time":{"ms":4}}},"handles":{"limit":{"hard":1048576,"soft":1048576},"open":6},"info":{"ephemeral_id":"f960431f-2849- e-9dc9-f17xxx","uptime":{"ms":15900027}},"memstats":{"gc_next":4285312,"memory_alloc":2157688,"memory_total":367547441}, libbeat":{"harvester":{"open_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0}},"pipeline":{"clients":1,"even t":{"active":0}}},"registrar":{"states":{"current":1}},"system":{"load":{"1":0.17,"15":0.11,"5":0.09,"norm":{"1":0.17,"15":0.11 ":0.09}}}}}} 2020-08-19T09:26:22.872Z INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": "metrics": {"beat":{"cpu":{"system":{"ticks":130,"time":{"ms":3}},"total":{"ticks":390,"time":{"ms":4},"value":390},"user":{"ti cks":260,"time":{"ms":1}}},"handles":{"limit":{"hard":1048576,"soft":1048576},"open":6},"info":{"ephemeral_id":"f960431f-2849- e-9dc9-f17xxx","uptime":{"ms":16200027}},"memstats":{"gc_next":4285312,"memory_alloc":2449992,"memory_total":370470483}, libbeat":{"harvester":{"open_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0}},"pipeline":{"clients":1,"even t":{"active":0}}},"registrar":{"states":{"current":1}},"system":{"load":{"1":0.11,"15":0.11,"5":0.08,"norm":{"1":0.11,"15":0.11 ":0.08}}}}}} -
Beats コンテナのステータスを確認し、そのログを分析して問題を特定します。
-
Docker コンテナのステータスを確認します。
docker ps -a | grep filebeat[root@VM01 logs]# docker ps -a | grep filebeat 922d7f8xxx registry-vpc.cn-hangzhou.aliyuncs.com/elasticsearch/aliyun-elasticsearch-beats:filebeat-6.8.5 "/usr/local/bin/do..." 33 minutes ago Up 33 minutes ct-cn-77uqof2s7rg ___FILEBEAT -
コンテナのステータスが
exitedの場合は、コンテナの出力ログを確認します。docker logs -f <container_id>
-