GAE vs GCE

   GAE vs GCE已关闭评论
2月 042015
 

转载: http://stackoverflow.com/questions/22697049/what-is-the-difference-between-google-app-engine-and-google-compute-engine

App Engine is a Platform-as-a-Service. It means that you simply deploy your code, and the platform does everything else for you. For example, if you app becomes very successful, App Engine will automatically create more instances to handle the increased volume.

Read more about App Engine

Compute Engine is an Infrastructure-as-a-Service. You have to create and configure your own instances. It gives you more flexibility and generally costs much less than App Engine. The drawback is that you have to manage your deployment yourself.

Read more about Compute Engine

You can mix both App Engine and Compute Engine, if necessary. They both work well with the other parts of the Google Cloud Platform.

 

To put it simply: compute engine gives you a server which you have full control/responsibility for. You have direct access to the operating system, and you install all the software that you want, which is usually a web server, database, etc…

In app engine you don’t manage the operating system of any of the underlying software. You only upload code (Java, PHP, Python, or Go) and voila – it just runs…

App engine saves tons of headache, especially for inexperienced people but it has 2 significant drawbacks: 1. more expensive (but it does have a free quota which compute engine doesn’t) 2. you have less control, thus certain things are just not possible, or only possible in one specific way (for example saving and writing files).

 

Basic difference is that Google App Engine (GAE) is a Platform as a Service (PaaS) whereas Google Compute Engine (GCE) is an Infrastructure as a Service (IaaS).

To run your application in GAE you just need to write your code and deploy it into GAE, no other headache. Since GAE is fully sclable, it will automatically acquire more instances in case the traffic goes higher and decrease the instances when traffic decreases. You will be charged for the resources you really use, I mean, the Instance-Hours, Transferred Data, Storage etc. But the restriction is, you can create your application in only Python, PHP, Java and Go

On the other hand, GCE provides you full infrastructure in the form of Virtual Machine. You can write or install any program in GAE virtual machine. Actually GAE is the way to use Google Data Centers virtually. In GAE you have to manually configure your infrastructure to handle scalability by usingLoad Balancer.

 

 Posted by at 下午 3:05

google-cloud 探索

   google-cloud 探索已关闭评论
2月 032015
 

google-cloud: https://cloud.google.com

docs: https://cloud.google.com/docs/

gcloud工具: https://cloud.google.com/sdk/gcloud/

What is the difference between Google App Engine and Google Compute Engine? http://stackoverflow.com/questions/22697049/what-is-the-difference-between-google-app-engine-and-google-compute-engine

 

GCE- faq: https://cloud.google.com/compute/docs/faq

 

开发者控制台帮助文档: https://developers.google.com/console/help/new   (先看看这个会为后续使用节省不少时间)

可能遇到的问题

  1. 无法访问: 请设置代理; 当执行: gcloud auth login 时,不设置代理可能会不行
  2. 执行完  GoogleCloudSDKInstaller.exe 后,似乎还是没有gcloud命令,需要手动执行 Google\Cloud SDK\google-cloud-sdk\install.bat

 

学习进度:

  1. 2015-02-03 : 部署了一个gitlab到 git.phpor.net
  2. 查看运行的实例:
  3. 修改默认的project,这样的话后续就不总需要使用 –project 选项了
  4. 添加ssh-key 为了方便ssh; 注意: 这里的登录名和google账户没有关系
    可以通过web页面直接添加: https://cloud.google.com/compute/docs/console#sshkeys
  5. 关于: C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goapp.bat
  6. appengine 文档中的application 其实就是 project,曾经叫 application,现在叫 project
  7. 配置app.yaml 时写的是project id,如:
  8. 上传完通过: https://appengine.google.com/ 来访问部署好的project显得更加直观和方便,新的console中一定也能方便使用,只是还不太熟悉:
  9. C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\appcfg.py 在windows上访问起来总不那么方便,于是在旁边添加了一个 appcfg.cmd , 从goapp.cmd 修改过来的,如下(注意: CLOUDSDK_ROOT_DIR 我给写死了):

     
  10. go的开发、部署和php差别有些多,需要看文档哦
  11. go开发、部署:
    goapp serve dir_of_app
    goapp deploy dir_of_app
  12. php开发、部署:
    appcfg update dir_of_app
    下载曾经部署过的代码: appcfg.py download_app -A root-micron-847 myphp    (注意: -A 后面的project id 不能写成title哦)
 Posted by at 下午 2:40