Linux下部署goAgent

准备工作

下载Google Appengine SDK For Pyahont与goAgent

1.Google App Engine SDK for Python
https://developers.google.com/appengine/downloads?hl=zh-CN#Google_App_Engine_SDK_for_Python

2.goagent
https://code.google.com/p/goagent/

下载后解压,将goagent文件夹放到google_appengine目录下,目录结构如下:

~/google_appengine/goagent-goagent-d488f2

准备好Google Application_ID与两步验证密码,如何申请问Google

配置goagent

编辑~/google_appengine/goagent-goagent-d488f2/local/proxy.ini

填写正确的appid,在此建议将profile由默认的google_cn改为google_hk

参考以下步骤执行:

aquan@edge ~/google_appengine $ python appcfg.py update goagent-goagent-d4488f2/server/python/
07:03 PM Host: appengine.google.com
07:03 PM Application: wrchiublog; version: 1
07:03 PM 
Starting update of app: wrchiublog, version: 1
07:03 PM Getting current resource limits.
Email: wrchiu@126.com  //在此填写googleid
Password for wrchiu@126.com:    //此处填写两步验证密码,而不是帐号密码
07:04 PM Scanning files on local disk.
07:04 PM Cloning 1 static file.
07:04 PM Cloning 6 application files.
07:04 PM Uploading 1 files and blobs.
07:04 PM Uploaded 1 files and blobs
07:04 PM Compilation starting.
07:04 PM Compilation completed.
07:04 PM Starting deployment.
07:04 PM Checking if deployment succeeded.
07:04 PM Deployment successful.
07:04 PM Checking if updated app version is serving.
07:04 PM Completed update of app: wrchiublog, version: 1

完成后,在~/google_appengine/goagent-goagent-d488f2/local/目录下运行goAgent

$ python proxy.py&

注意:在更新app时出现如下错误

aquan@edge ~/google_appengine $ python appcfg.py update goagent-goagent-d4488f2/server/python/
07:00 PM Host: appengine.google.com
Error parsing yaml file:
Unable to assign value 'your_appid' to attribute 'application':
Value 'your_appid' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
  in "goagent-goagent-d4488f2/server/python/app.yaml", line 1, column 14

按照提示修改goagent-goagent-d4488f2/server/python/app.yaml中的application为正确的appid

至此Linux下goAgent部署完成!

在此提供包含goagent的压缩包http://pan.baidu.com/share/link?shareid=472887&uk=1493434283(goagent 3.0.1)