Pivotal Cloud Foundry学习笔记(1)
PCF是一个PAAS平台
注册PCF账号
https://account.run.pivotal.io/sign-up
安装cf CLI
访问 https://console.run.pivotal.io/tools 或 https://github.com/cloudfoundry/cli 下载cf CLI
安装下载好的rpm包
# rpm -Uvh cf-cli-installer_6..0_x86-.rpm
查看cf CLI帮助
# cf -h
NAME:
cf - A command line tool to interact with Cloud Foundry USAGE:
cf [global options] command [arguments...] [command options] VERSION:
6.17.+5d0be0a--- GETTING STARTED:
help Show help
version Print the version
login Log user in
logout Log user out
passwd Change user password
target Set or view the targeted org or space api Set or view target api url
auth Authenticate user non-interactively APPS:
apps List all apps in the target space
app Display health and status for app push Push a new app or sync changes to an existing app
scale Change or view the instance count, disk space limit, and memory limit for an app
delete Delete an app
rename Rename an app start Start an app
stop Stop an app
restart Restart an app
restage Restage an app
restart-app-instance Terminate the running application Instance at the given index and instantiate a new instance of the application with the same index events Show recent app events
files Print out a list of files in a directory or the contents of a specific file of an app running on the DEA backend
logs Tail or show recent logs for an app env Show all env variables for an app
set-env Set an env variable for an app
unset-env Remove an env variable stacks List all stacks (a stack is a pre-built file system, including an operating system, that can run apps)
stack Show information for a stack (a stack is a pre-built file system, including an operating system, that can run apps) copy-source Make a copy of app source code from one application to another. Unless overridden, the copy-source command will restart the application. create-app-manifest Create an app manifest for an app that has been pushed successfully get-health-check Get the health_check_type value of an app
set-health-check Set health_check_type flag to either 'port' or 'none'
enable-ssh Enable ssh for the application
disable-ssh Disable ssh for the application
ssh-enabled Reports whether SSH is enabled on an application container instance
ssh SSH to an application container instance SERVICES:
marketplace List available offerings in the marketplace
services List all service instances in the target space
service Show service instance info create-service Create a service instance
update-service Update a service instance
delete-service Delete a service instance
rename-service Rename a service instance create-service-key Create key for a service instance
service-keys List keys for a service instance
service-key Show service key info
delete-service-key Delete a service key bind-service Bind a service instance to an app
unbind-service Unbind a service instance from an app bind-route-service Bind a service instance to an HTTP route
unbind-route-service Unbind a service instance from an HTTP route create-user-provided-service Make a user-provided service instance available to CF apps
update-user-provided-service Update user-provided service instance ORGS:
orgs List all orgs
org Show org info create-org Create an org
delete-org Delete an org
rename-org Rename an org SPACES:
spaces List all spaces in an org
space Show space info create-space Create a space
delete-space Delete a space
rename-space Rename a space allow-space-ssh Allow SSH access for the space
disallow-space-ssh Disallow SSH access for the space
space-ssh-allowed Reports whether SSH is allowed in a space DOMAINS:
domains List domains in the target org
create-domain Create a domain in an org for later use
delete-domain Delete a domain
create-shared-domain Create a domain that can be used by all orgs (admin-only)
delete-shared-domain Delete a shared domain router-groups List router groups ROUTES:
routes List all routes in the current space or the current organization
create-route Create a url route in a space for later use
check-route Perform a simple check to determine whether a route currently exists or not
map-route Add a url route to an app
unmap-route Remove a url route from an app
delete-route Delete a route
delete-orphaned-routes Delete all orphaned routes (i.e. those that are not mapped to an app) BUILDPACKS:
buildpacks List all buildpacks
create-buildpack Create a buildpack
update-buildpack Update a buildpack
rename-buildpack Rename a buildpack
delete-buildpack Delete a buildpack USER ADMIN:
create-user Create a new user
delete-user Delete a user org-users Show org users by role
set-org-role Assign an org role to a user
unset-org-role Remove an org role from a user space-users Show space users by role
set-space-role Assign a space role to a user
unset-space-role Remove a space role from a user ORG ADMIN:
quotas List available usage quotas
quota Show quota info
set-quota Assign a quota to an org create-quota Define a new resource quota
delete-quota Delete a quota
update-quota Update an existing resource quota share-private-domain Share a private domain with an org
unshare-private-domain Unshare a private domain with an org SPACE ADMIN:
space-quotas List available space resource quotas
space-quota Show space quota info
create-space-quota Define a new space resource quota
update-space-quota Update an existing space quota
delete-space-quota Delete a space quota definition and unassign the space quota from all spaces
set-space-quota Assign a space quota definition to a space
unset-space-quota Unassign a quota from a space SERVICE ADMIN:
service-auth-tokens List service auth tokens
create-service-auth-token Create a service auth token
update-service-auth-token Update a service auth token
delete-service-auth-token Delete a service auth token service-brokers List service brokers
create-service-broker Create a service broker
update-service-broker Update a service broker
delete-service-broker Delete a service broker
rename-service-broker Rename a service broker migrate-service-instances Migrate service instances from one service plan to another
purge-service-offering Recursively remove a service and child objects from Cloud Foundry database without making requests to a service broker
purge-service-instance Recursively remove a service instance and child objects from Cloud Foundry database without making requests to a service broker service-access List service access settings
enable-service-access Enable access to a service or service plan for one or all orgs
disable-service-access Disable access to a service or service plan for one or all orgs SECURITY GROUP:
security-group Show a single security group
security-groups List all security groups
create-security-group Create a security group
update-security-group Update a security group
delete-security-group Deletes a security group
bind-security-group Bind a security group to a space
unbind-security-group Unbind a security group from a space bind-staging-security-group Bind a security group to the list of security groups to be used for staging applications
staging-security-groups List security groups in the staging set for applications
unbind-staging-security-group Unbind a security group from the set of security groups for staging applications bind-running-security-group Bind a security group to the list of security groups to be used for running applications
running-security-groups List security groups in the set of security groups for running applications
unbind-running-security-group Unbind a security group from the set of security groups for running applications ENVIRONMENT VARIABLE GROUPS:
running-environment-variable-group Retrieve the contents of the running environment variable group
staging-environment-variable-group Retrieve the contents of the staging environment variable group
set-staging-environment-variable-group Pass parameters as JSON to create a staging environment variable group
set-running-environment-variable-group Pass parameters as JSON to create a running environment variable group FEATURE FLAGS:
feature-flags Retrieve list of feature flags with status of each flag-able feature
feature-flag Retrieve an individual feature flag with status
enable-feature-flag Enable the use of a feature so that users have access to and can use the feature
disable-feature-flag Disable the use of a feature so that users have access to and can use the feature ADVANCED:
curl Executes a request to the targeted API endpoint
config Write default values to the config
oauth-token Retrieve and display the OAuth token for the current session
ssh-code Get a one time password for ssh clients ADD/REMOVE PLUGIN REPOSITORY:
add-plugin-repo Add a new plugin repository
remove-plugin-repo Remove a plugin repository
list-plugin-repos List all the added plugin repositories
repo-plugins List all available plugins in specified repository or in all added repositories ADD/REMOVE PLUGIN:
plugins List all available plugin commands
install-plugin Install CLI plugin
uninstall-plugin Uninstall the plugin defined in command argument INSTALLED PLUGIN COMMANDS: ENVIRONMENT VARIABLES:
CF_COLOR=false Do not colorize output
CF_HOME=path/to/dir/ Override path to default config directory
CF_PLUGIN_HOME=path/to/dir/ Override path to default plugin config directory
CF_STAGING_TIMEOUT= Max wait time for buildpack staging, in minutes
CF_STARTUP_TIMEOUT= Max wait time for app instance startup, in minutes
CF_TRACE=true Print API request diagnostics to stdout
CF_TRACE=path/to/trace.log Append API request diagnostics to a log file
https_proxy=proxy.example.com: Enable HTTP proxying for API requests GLOBAL OPTIONS:
--help, -h Show help
-v Print API request diagnostics to stdout
登陆PCF
# cf login -a https://api.run.pivotal.io
上传并运行APP
在程序根目录下运行这个命令后,cf就会把当前目录包括源代码的所有文件,打包并上传到CF上面,之后CF就会自动分析出APP的语言,根据源代码下载所需的依赖,编译程序并将其重新打包成一个“露珠”(dropplet,可以反复运行并延展的独立程序包)。这一切都是后台自动完成的,无需任何设置。这时候在你设置网段的任何人便可以去浏览我们的APP了。
开发员可以定义APP的名称(name),运行实例的数量(number of instances),内存(Memory Limit),子域名(subdomain),域名(domain),还有可选择绑定的服务(services,会在另一篇文章深入介绍),等等。
# cf push APP
监控和调试APP
显示已经上传的APP以及它们的运行状态。
# cf apps
显示我们上传APP的log,包括env.log, staging_task.log, stderr.log, 和stdout.log。我们的log一般会在stderr或stdout找到,另外两个为系统log。
如果去掉'--recent',cf则会对log进行'tail -f'的功能。
# cf logs APP --recent
显示我们上传APP的根目录文件夹结构,一般会反应我们在本地上传的目录结构。我们还可以运用这个命令查看已上传文件的内容。
# cf files APP
Pivotal Cloud Foundry学习笔记(1)的更多相关文章
- spring cloud(学习笔记)高可用注册中心(Eureka)的实现(二)
绪论 前几天我用一种方式实现了spring cloud的高可用,达到两个注册中心,详情见spring cloud(学习笔记)高可用注册中心(Eureka)的实现(一),今天我意外发现,注册中心可以无限 ...
- Pivotal Cloud Foundry安全原理解析
云计算相关的技术差点儿都对传统网络架构和安全规则产生一定的冲击.Pivotal Cloud Foundry(PCF)也不例外,去年8月为了说服专业安全组织允许PaaS部署方案,特意为他们深入讲了下PC ...
- Spring Cloud Alibaba学习笔记(1) - 整合Spring Cloud Alibaba
Spring Cloud Alibaba从孵化器版本毕业:https://github.com/alibaba/spring-cloud-alibaba,记录一下自己学习Spring Cloud Al ...
- 在pivotal cloud foundry上申请账号和部署应用
Created by Wang, Jerry, last modified on Jul 04, 2016 URL: http://run.pivotal.io/ maintain your mobi ...
- 【Cloud Foundry】Cloud Foundry学习(四)——Service
在阅读的过程中有不论什么问题,欢迎一起交流 邮箱:1494713801@qq.com QQ:1494713801 Services:Cloud Foundry的Service模块从源码控制上看就 ...
- spring cloud(学习笔记)高可用注册中心(Eureka)的实现(一)
最近在学习的时候,发现微服务架构中,假如只有一个注册中心,那这个注册中心挂了可怎么办,这样的系统,既不安全,稳定性也不好,网上和书上找了一会,发现这个spring cloud早就想到了,并帮我们解决了 ...
- Spring Cloud Alibaba学习笔记(15) - 整合Spring Cloud Gateway
Spring Cloud Gateway 概述 Spring Cloud Gateway 是 Spring Cloud 的一个全新项目,该项目是基于Netty.Reactor以及WEbFlux构建,它 ...
- spring cloud(学习笔记) Enreka服务治理
服务治理是微服务架构最为核心和基础的模块,主要用来实现各个微服务实例的自动化注册和发现. 记录一下服务注册中心的搭建以及高可用注册中心的实现 1.首先创建两个基础 的spring boot工程,spr ...
- spring cloud(学习笔记)微服务启动错误(1)
今天下午在启动spring cloud微服务的时候,报了这个错误: Error starting ApplicationContext. To display the auto-configurati ...
随机推荐
- 【BZOJ 2333 】[SCOI2011]棘手的操作(离线+线段树)
2333: [SCOI2011]棘手的操作 Description 有N个节点,标号从1到N,这N个节点一开始相互不连通.第i个节点的初始权值为a[i],接下来有如下一些操作: U x y: 加一条边 ...
- Eclipse怎样导入github上的项目
国外有些比较好的源代码网站,经常需要从这些网站上导入项目到eclipse中,我最近就发现github.com这个网站上有很多开源项目.这里就以从github网站上导入项目到eclipse中为例来详细的 ...
- eclipse导入已有源码
http://blog.csdn.net/scruffybear/article/details/1917301 如有转载,请注明出处,并保持文章的完整性,谢谢! 最近工作之余在研究国外经典书籍< ...
- How to convert an IPv4 address into a integer in C#?
仅仅针对于IPv4的处理方法 从string转换为int 以及从int转换为string // IPv4 int intAddress = BitConverter.ToInt32(IPAddress ...
- Eclipse中添加android sdk javadoc和source
在 javadoc location path中添加file:/D:/Android_SDK/sdk/docs/reference/ 在 source attachment中添加为 Externa ...
- js数组如何去掉逗号
技术水平比较差,有错误的地方或者大神们有好的方法在介绍下,可以指点出来我加以改正! 1.join去掉逗号',' var a = ['1', '2', '3', '4', '5']; var c = a ...
- ARM学习笔记2——分支跳转指令
一.Arm指令条件码和条件助记符 二.跳转指令B 1.作用 跳转指令B使程序跳转到指定的地址执行程序(跳转范围是PC-32MB到PC+32MB) 2.指令格式(注:B后面如果有条件,条件就是紧跟在B后 ...
- bayer图像格式
Bayer数据,其一般格式为:奇数扫描行输出 RGRG……偶数扫描行输出 GBGB…… 根据人眼对彩色的响应带宽不高的大面积着色特点,每个像素没有必要同时输出3种颜色.因此,数据采样时, 奇数扫描行的 ...
- ReadingNotes@02-12-2013
ReadingNotes@02-12-2013 */--> pre { background-color: #2f4f4f;line-height: 1.6; FONT: 10.5pt Cons ...
- 【问题】Win7 系统下 Firefox hostadmin插件无法修改Host
今天遇到一个奇葩问题:win 7系统,firefox hostAdmin插件无法修改Host了,提示“ write hosts file failed check permissions”,肯定是哪里 ...