Google Cloud Logging + google-fluentd 删除消息

Google Cloud Logging + google-fluentd Dropping Messages

我在 GKE 中有一个相当小的(1-2 个节点)kubernetes 集群 运行,±40 Pods 运行。目前的问题是它没有正确登录到 GCE 控制台。我看到很多来自 fluentd 容器的消息,格式如下:

$ kubectl logs fluentd-cloud-logging-gke-xxxxxxxx-node-xxxx

2016-02-02 23:30:09 +0000 [warn]: Dropping 10 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 1 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 3 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 41 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 5 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."

...等等。我每秒看到大约 5 条这样的消息,所以我知道事情正在生成日志。但是,在计算引擎控制台中,我看到如下内容:

所以介于两者之间,我显然丢失了很多消息。奇怪的是,我并没有丢失 所有 这些消息!

按照 GH 问题 #15727

中的建议,集群配置了 Logging.write 和 Monitoring.all 权限

某些日志的显示确实令人困惑。鉴于该错误消息,我希望您的日志中的 none 会显示在查看器中,因为听起来您的项目尚未启用日志记录 API。

您可以从 Developers Console 执行此操作,here。试试去那里,点击 Enable API 按钮,看看错误是否不断出现。