简体   繁体   English

Google云端平台:GCP VM实例上的Stackdriver Agent安装和配置错误

[英]Google Cloud Platform : Stackdriver Agent installation and Condiguration error on GCP VM instance

I dont have hands on experience on stackdriver monitoring configuration for google cloud platform VM instances monitoring. 我没有关于Google云端平台VM实例监控的Stackdriver Monitor配置方面的经验。 our basic monitoring for our project works fine but while trying to install stackdriver agent in Ubuntu 14.04 OS it gives us error and stack driver with agent does not works for us. 我们对项目的基本监视工作正常,但是尝试在Ubuntu 14.04 OS中安装stackdriver agent时,它给我们带来了错误,并且具有agent的堆栈驱动程序不适用于我们。 below is the error for your reference. 以下是错误,供您参考。

Jan 3 10:43:42 ubuntu-uat01 collectd[2283]: write_gcm: Unsuccessful HTTP request 403: {#012 "error": {#012 "code": 403,#012 1月3日10:43:42 ubuntu-uat01 collectd [2283]:write_gcm:HTTP请求失败403:{#012“错误”:{#012“代码”:403,#012
"message": "User is not authorized to access the project monitoring records.",#012 "status": "PERMISSION_DENIED"#012 }#012} Jan 3 10:43:42 ubuntu-uat01 collectd[2283]: write_gcm: Error -2 from wg_curl_get_or_post Jan 3 10:43:42 ubuntu-uat01 collectd[2283]: write_gcm: wg_transmit_unique_segment failed. “消息”:“用户无权访问项目监视记录。”,#012“状态”:“ PERMISSION_DENIED”#012}#012} 1月3日10:43:42 ubuntu-uat01 collectd [2283]:write_gcm:来自wg_curl_get_or_post 1月3日的错误-2收集了ubuntu-uat01 [2283]:write_gcm:wg_transmit_unique_segment失败。

Can someone help me in setting up stackdriver monitoring with Agent installed on server or provide me some documentation link if any available. 有人可以帮助我在服务器上安装代理程序的情况下设置堆栈驱动程序监视,或者为我提供一些文档链接(如果有)。

I got this precise error on my instances until I added the permission 'Monitoring Metric Writer' to the service account. 在将实例“ Monitoring Metric Writer”添加到服务帐户之前,我在实例上遇到了这个精确错误。

You could also, as Igor suggested, add the monitoring api scope to the instance See the StackDriver Monitoring docs 您还可以按照Igor的建议,将监视api范围添加到实例中。请参阅StackDriver监视文档。

Most likely you either don't have the Stackdriver Monitoring API enabled in your project, or your VM does not have the correct scopes. 您很可能没有在项目中启用Stackdriver Monitoring API ,或者您的VM没有正确的作用域。 There are extensive instructions on the Google Cloud site for installing the agent, including the troubleshooting page. 有广泛的指示安装代理,包括在谷歌云网站故障排除页。

If you are installing StackDriver monitoring and logging agent on your instance, you need to make sure attached service-account to your instance has proper rights to edit/write data to StackDriver. 如果要在实例上安装StackDriver监视和日志记录代理,则需要确保实例上附加的服务帐户具有将数据编辑/写入StackDriver的适当权限。 Simply run following commands to assign proper roles: 只需运行以下命令即可分配适当的角色:

gcloud projects add-iam-policy-binding PROJECT_NAME --member="serviceAccount:SERVICE_ACCOUNT_EMAIL" --role="roles/logging.logWriter"

gcloud projects add-iam-policy-binding PROJECT_NAME --member="serviceAccount:SERVICE_ACCOUNT_EMAIL" --role="roles/monitoring.metricWriter"

replace PROJECT_NAME and SERVICE_ACCOUNT_EMAIL with proper values from your environment. 用您环境中的适当值替换PROJECT_NAME和SERVICE_ACCOUNT_EMAIL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Cloud Platform:“更新Google Stackdriver监控代理” - Google Cloud Platform: “Update Google Stackdriver monitoring agent” stackdriver 日志代理未显示从 Google 云平台上的 stackdriver 日志查看器中的自定义日志文件读取的日志 - stackdriver logging agent not showing logs read from a custom log file in stackdriver logging viewer on Google cloud platform Google Cloud Stackdriver Profiler GKE安装 - Google Cloud Stackdriver Profiler GKE installation 使用带有 bunyan 的堆栈驱动程序日志记录时,即使在 gcp 的 vm 实例中也会出现 PERMISSION_DENIED 错误 - Getting PERMISSION_DENIED error even inside gcp's vm instance when using stackdriver logging with bunyan 如何在 Google Container VM 镜像中安装 Stackdriver 监控代理? - How to install Stackdriver monitoring agent in Google Container VM images? 如何在Google Cloud Platform中清除Stackdriver日志? - How to clear Stackdriver logs in Google Cloud Platform? Google Cloud Platform Stackdriver记录档案 - Google cloud platform stackdriver log a file Google Cloud外部的服务器的agentPath上的Stackdriver GCP多个代理 - Stackdriver GCP multiple agents on agentPath for server outside Google Cloud Stackdriver 代理安装失败 - Stackdriver agent installation failed 在 Google VM 上安装 ops 代理时出错 - Error while installing ops agent on Google VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM