Skip to content

Instantly share code, notes, and snippets.

@vatsan
Created August 9, 2016 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vatsan/654e52ed205eef8b350c4dbc8e892bd4 to your computer and use it in GitHub Desktop.
Save vatsan/654e52ed205eef8b350c4dbc8e892bd4 to your computer and use it in GitHub Desktop.

Initialization of PCF CLI

Login as admin to the “pds” org, choose the default space as “dsmicro"

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf login --skip-ssl-validation  -a https://api.run.haas-23.pez.pivotal.io
API endpoint: https://api.run.haas-23.pez.pivotal.io

Email> admin

Password> 
Authenticating...
Credentials were rejected, please try again.

Password> 
Authenticating...
OK

Select an org (or press enter to skip):
1. system
2. pds

Org> 2
Targeted org pds

Select a space (or press enter to skip):
1. development
2. dsmicroservices

Space> 2
Targeted space dsmicroservices


API endpoint:   https://api.run.haas-23.pez.pivotal.io (API version: 2.43.0)   
User:           admin   
Org:            pds   
Space:          dsmicroservices   

Create new users and assign them appropriate roles in the new space

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf create-user sramanujam@pivotal.io "****"
Creating user sramanujam@pivotal.io...
OK

TIP: Assign roles with 'cf set-org-role' and 'cf set-space-role'
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf set-org-role sramanujam@pivotal.io  pds  OrgManager
Assigning role OrgManager to user sramanujam@pivotal.io in org pds as admin...
OK
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf set-space-role sramanujam@pivotal.io  pds  dsmicroservices SpaceDeveloper
Assigning role SpaceDeveloper to user sramanujam@pivotal.io in org pds / space dsmicroservices as admin...
OK
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒

cf create-user rradhakrishnan@pivotal.io "****"
cf set-org-role rradhakrishnan@pivotal.io  pds  OrgManager
cf set-space-role rradhakrishnan@pivotal.io  pds  dsmicroservices SpaceDeveloper

cf create-user jyu@pivotal.io "****"
cf set-org-role jyu@pivotal.io  pds  OrgManager
cf set-space-role jyu@pivotal.io  pds  dsmicroservices SpaceDeveloper

Checkout the marketplace, instantiate GemFire service

⇒  cf marketplace
Getting services from marketplace in org pds / space dsmicroservices as admin...
OK

service          plans                                                           description   
app-autoscaler   bronze, gold                                                    Scales bound applications in response to load   
p-gemfire        GemFireServicePlan1, GemFireServicePlan2, GemFireServicePlan3   Pivotal GemFire offers the ability to deploy a GemFire cluster as a service in Pivotal CF.   
p-rabbitmq       standard                                                        RabbitMQ is a robust and scalable high-performance multi-protocol messaging broker.   
p-redis          shared-vm, dedicated-vm                                         Redis service to provide a key-value store   

TIP:  Use 'cf marketplace -s SERVICE' to view descriptions of individual plans of a given service.
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf marketplace -s p-gemfire
Getting service plan information for service p-gemfire as admin...
OK

service plan          description               free or paid   
GemFireServicePlan1   GemFire plan 1 instance   free   
GemFireServicePlan2   GemFire plan 2 instance   free   
GemFireServicePlan3   GemFire plan 3 instance   free   
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf create-service p-gemfire GemFireServicePlan1  dsmicro_gemfire
Creating service instance dsmicro_gemfire in org pds / space dsmicroservices as admin...
OK

Create in progress. Use 'cf services' or 'cf service dsmicro_gemfire' to check operation status.
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf services
Getting services in org pds / space dsmicroservices as admin...
OK

name              service      plan                  bound apps   last operation   
dsmicro_gemfire   p-gemfire    GemFireServicePlan1                create succeeded   
dsmicro_rabbit    p-rabbitmq   standard                           create succeeded   
dsmicro_redis     p-redis      shared-vm                          create succeeded   
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|

Install GemFire CLI plugin for PCF

Download GemFire CF CLI plugin : https://docs.pivotal.io/gemfire-cf/gfe-cli.html

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  chmod +x ~/Downloads/cf-gemfire-cli-darwin-amd64-1.6
chmod: /Users/sramanujam/Downloads/cf-gemfire-cli-darwin-amd64-1.6: No such file or directory
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  chmod +x ~/Downloads/cf-gemfire-cli-darwin-amd64-1.6.0 
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf install-plugin ~/Downloads/cf-gemfire-cli-darwin-amd64-1.6.0 

**Attention: Plugins are binaries written by potentially untrusted authors. Install and use plugins at your own risk.**

Do you want to install the plugin /Users/sramanujam/Downloads/cf-gemfire-cli-darwin-amd64-1.6.0? (y or n)> y

Installing plugin /Users/sramanujam/Downloads/cf-gemfire-cli-darwin-amd64-1.6.0...
OK
Plugin GemFire v1.7.0 successfully installed.
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf plugins
Listing Installed Plugins...
OK

Plugin Name   Version   Command Name          Command Help   
GemFire       1.7.0     gemfire               GemFire plugin command's help text   
GemFire       1.7.0     show-gfsh             Show gfsh connect command   
GemFire       1.7.0     restart-gemfire       Restart GemFire cache servers (Also used for applying configuration changes)   
GemFire       1.7.0     export-gemfire        Retrieve GemFire artifacts, such as logs and stats   
GemFire       1.7.0     show-wan-config-url   Display the WAN configuration URL for the service instance   
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf gemfire
NAME:
   cf gemfire - Cloud Foundry plugin to interact with GemFire service instances

USAGE:
   cf [global options] command [command options] [arguments...]

VERSION:
   1.7.0.0


COMMANDS:
   show-gfsh        SERVICE_INSTANCE
   restart-gemfire    SERVICE_INSTANCE --cluster-config CONFIG.ZIP | -c CONFIG.ZIP
   export-gemfire    SERVICE_INSTANCE
   show-wan-config-url    SERVICE_INSTANCE
   help, h        Shows a list of commands or help for one command


GLOBAL OPTIONS:
   --help, -h        show help
   --version, -v    print the version

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒

Restart GemFire, get connection information etc.

sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf restart-gemfire dsmicro_gemfire
This command could take a while. Timeout set to: 900 seconds.
..................
Cluster successfully restarted
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒  cf show-gfsh dsmicro_gemfire
Use the following command in gfsh to connect to service instance dsmicro_gemfire
    connect --use-http --url=https://gf-plan-1-dashboard-XXXXX.run.haas-23.pez.pivotal.io/gemfire/v1
For a non HTTPS connection (not recommended -- use with caution!) use the following command:
    connect --use-http --url=http://gf-plan-1-dashboard-XXXXX.run.haas-23.pez.pivotal.io/gemfire/v1
sramanujam@srivatsan-ramanujams-macbook-pro:~/Downloads|
⇒
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment