在Google Container Engine上申请创建Docker容器

所属分类: 网站运营 / 建站经验 阅读数: 100
收藏 0 赞 0 分享

(1)要申请一个Google账户。
(2)激活Google账单,即绑定支付信用卡,为使用Google的服务买单。激活过程中为了验证信用卡是否可用,需要支付1美元的费用。
激活支付地址:https://console.developers.google.com/billing?_ga=1.62759852.1080048005.1441690490
支付激活后,可以看到能够使用的一些服务,同时看到可以免费使用60天。
2016316103057021.png (1436×599)

(3)激活Google API
激活后,可以使用如下两种服务:
Google Container Engine API
Google Compute Engine and associated APIs
创建一个gerry-test-proj工程:
2016316103118524.png (931×347)

然后点击建立,会自动跳转到当前创建好的工程中:
2016316103136556.png (1439×669)

(4)安装gcloud

到Google Cloud SDK上可以下载到各个版本的客户端:https://cloud.google.com/sdk/#windows
安装方法也有说明。安装完成后,可以看下gcloud的使用方法:

复制代码
代码如下:

root@gerryyang:~# gcloud -h
Usage: gcloud [optional flags] <group | command>
group may be auth | components | compute | config | container |
deployment-manager | dns | sql | topic
command may be docker | feedback | help | info | init | version
 
The *gcloud* CLI manages authentication, local configuration, developer 
workflow, and interactions with the Google Cloud Platform APIs. 
 
optional flags: 
  --account ACCOUNT      Google Cloud Platform user account to use for 
                         invocation. 
  --format FORMAT        Format for printed output. 
  --help                 Display detailed help. 
  --log-http LOG_HTTP    Logs all HTTP server requests and responses to stderr. 
                         (true/false) 
  --project PROJECT_ID   Google Cloud Platform project ID to use for this 
                         invocation. 
  --quiet, -q            Disable all interactive prompts. 
  --trace-token TRACE_TOKEN 
                         Token used to route traces of service requests for 
                         investigation of issues. 
  --user-output-enabled USER_OUTPUT_ENABLED 
                         Control whether user intended output is printed to the 
                         console.  (true/false) 
  --verbosity VERBOSITY  Override the default verbosity for this command.  This 
                         must be a standard logging verbosity level: [debug, 
                         info, warning, error, critical, none] (Default: 
                         [warning]). 
  -h                     Print a summary help and exit. 
  -v, --version          Print version information. 
 
command groups: 
  auth                   Manage oauth2 credentials for the Google Cloud SDK. 
  components             List, install, update, or remove Google Cloud SDK 
                         components or packages. 
  compute                Read and manipulate Google Compute Engine resources. 
  config                 View and edit Google Cloud SDK properties. 
  container              Deploy and manage clusters of machines for running 
                         containers. 
  deployment-manager     Manage deployments of cloud resources. 
  dns                    Manage your Cloud DNS managed-zones and record-sets. 
  sql                    Manage Cloud SQL databases. 
  topic                  gcloud supplementary help. 
 
commands: 
  docker                 Provides the docker CLI access to the Google Container 
                         Registry. 
  feedback               Provide feedback to the Google Cloud SDK team. 
  help                   Prints detailed help messages for the specified 
                         commands. 
  info                   Display information about the current gcloud 
                         environment. 
  init                   Create and initialize a gcloud workspace in the current 
                         directory. 
  version                Print version information for Cloud SDK components. 

然后使用gcloud登陆GCP账户(即,完成认证):
2016316103225273.png (1064×287)

后记
越来越多的公司开始使用容器来构建应用,它可以方便地实现扩展、复制以及升级。这个新服务提供了一种全新的途径来管理大量容器,免除了涉及到多容器业务流操作的大量底层工作。
Google于2014年11月首次对外发布了容器引擎,不过只是预览版本。随着这次商业性的发布,Google确保该服务已经具备好应对生产环境的各种条件,并承诺99.95%的正常运行时间。
另外,定价也已经确定。少于6个节点的用户可以免费使用,若需管理多于6个节点则需为每个集群支付$0.15/小时的费用。
Google自身早已使用容器来运行Internet服务,例如搜索和邮箱服务。
通过容器,公司可以让每个组件包含一部分应用,以模块化的方式构建它们的应用,这就是广为人知的微服务架构。当应用需要更新时,一个新的容器可以轻易地实现替换,以减小对操作的影响。
容器也为DevOps形式的软件开发创造了条件。这种情况下,开发者在开发应用时快速地迭代,通过在容器中打包,每个独立的组件都可以轻松地进行测试。
通过这个服务,用户在单次操作中,完成对多容器复杂应用的部署。GCE会记录操作日志,以确保每个容器的正确运行,它也提供一条简易的途径,通过增加额外的处理器或内存,来调整集群的大小。

更多精彩内容其他人还在看

网站分析工具 通过流量特点来分析网站

使用一些网站分析工具的时候会发现一般报表会被分成三大模块:用户访问、内容浏览和流量来源。
收藏 0 赞 0 分享

提高博客阅读体验的六个方法说明

博客的阅读体验有很多方面,如果您要建立一个受欢迎的博客,那么,你可能要善待你的读者,提高阅读体验,这样会提高他们再次访问你博客的机会,让他们成为你的博客或网站的常客之一,当然你的网站如果可以注册的话,还可以成为你的注册用户之一,下面我就提供较为实用的
收藏 0 赞 0 分享

让网站上的Adsense广告匹配的更加精准的方法

大家都知道做AdSense 广告的话,网站内容与广告内容匹配程度是很关键的,而Google广告内容又是以网页本身的关键词所觉得,那么如何让网页中出现匹配度最高的Adsense 广告呢?
收藏 0 赞 0 分享

Favicon 在线生成器工具小结

favicon 就是出现在浏览器地址栏左侧的那个小图标。所谓favicon,即Favorites Icon的缩写,中文名称是网站头像,顾名思义,便是其可以让浏览器的收藏夹中除显示相应的标题外,还以图标的方式区别不同的网站。
收藏 0 赞 0 分享

网站备案注销方法 关于网站备案问题的解答

关于网站备案问题的解答 如何注销网站备案
收藏 0 赞 0 分享

一家大型行业网站的编辑的职场真实经历分享

想了很久,终于把干了8个月的网络编辑工作给辞掉了。如今静下心来,把8个月来的思绪给缕一下,也给向往这个职业的朋友们些参考。
收藏 0 赞 0 分享

转化率最高的10个网站的经验分享

之前分享过如何提升网站转化率之:谷歌9条和AIDAS模型,这篇文章直接提到了国外网站转化率最高的10个网站他们是如何有效提升转化率的
收藏 0 赞 0 分享

地方门户型网站运营与发展经验的几点总结

地方门户网站获得发展,还需要和当地的实际情况结合起来,不断的尝试和多方的合作,这样就可以在当地将网站打开知名度,同时使门户网站的营运获得很大的发展。
收藏 0 赞 0 分享

地方类网站的建立(从零起步)

只是个人见解和参考前辈的经验,希望对你有所帮助,难免有错误观点和见解,请您及时告知与我,共同成长,共同进步。最后分享一句话:“认准了,就去做;不跟风,不动摇”。
收藏 0 赞 0 分享

博客网站的运营和推广四步基本经验

网站运营经验:博客网站的运营和推广四步走.
收藏 0 赞 0 分享
查看更多