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

邮差的信 提交于 2020-01-04 13:47:35

问题


I dont have hands on experience on stackdriver monitoring configuration for google cloud platform VM instances monitoring. 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. 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
"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.

Can someone help me in setting up stackdriver monitoring with Agent installed on server or provide me some documentation link if any available.


回答1:


I got this precise error on my instances until I added the permission 'Monitoring Metric Writer' to the service account.

You could also, as Igor suggested, add the monitoring api scope to the instance See the StackDriver Monitoring docs




回答2:


Most likely you either don't have the Stackdriver Monitoring API enabled in your project, or your VM does not have the correct scopes. There are extensive instructions on the Google Cloud site for installing the agent, including the troubleshooting page.




回答3:


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. 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.



来源:https://stackoverflow.com/questions/41441617/google-cloud-platform-stackdriver-agent-installation-and-condiguration-error-o

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!