【问题标题】:Google Cloud Logging + google-fluentd Dropping MessagesGoogle Cloud Logging + google-fluentd 删除消息
【发布时间】:2016-02-02 23:44:23
【问题描述】:

我有一个相当小的(1-2 个节点)kubernetes 集群在 GKE 中运行,运行 ±40 个 Pod。手头的问题是它没有正确登录到 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 条这样的消息,所以我知道事情正在产生日志。但是,在计算引擎控制台中,我看到如下内容:

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

集群配置了 Logging.write 和 Monitoring.all 权限,如 GH 问题 #15727 中所建议的那样

【问题讨论】:

    标签: google-compute-engine kubernetes google-kubernetes-engine fluentd


    【解决方案1】:

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

    您可以通过开发者控制台here 执行此操作。尝试去那里,点击Enable API 按钮,看看错误是否不断出现。

    【讨论】:

    • 当我第一次加载控制台时,我看到 {{apiCtrl.api.name}} 按钮应该在哪里,但是在缓存清除刷新之后,按钮出现了。点击它就可以了,谢谢亚历克斯!