http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/_location-customizers.md ---------------------------------------------------------------------- diff --git a/guide/locations/_location-customizers.md b/guide/locations/_location-customizers.md deleted file mode 100644 index 145c158..0000000 --- a/guide/locations/_location-customizers.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -section: Location Customizers -section_type: inline -section_position: 11 ---- - -### Location Customizers - -Apache Brooklyn supports a number of ways to configure and customize locations. These include -the `JcloudsLocationCustomizer`, which is for advanced customization of VM provisioning through jclouds. -There is also a `MachineLocationCustomizer`, which allows customization of machines being obtained -from any kind of location (including [Bring Your Own Nodes](index.html#byon)). - - -#### Usage Guidelines - -Clearly there is an overlap for where things can be done. This section describes the recommended -separation of responsibilities. - -These are guidelines only - users are obviously free to make alternative usage decisions based on -their particular use-cases. - -#### Responsibilities of Entity versus Location - -From an entity's perspective, it calls `location.obtain(options)` and gets back a usable -`MachineLocation` that has a standard base operating system that gives remote access -(e.g. for Linux it expects credentials for a user with `sudo` rights, and ssh access). - -However, there are special cases - for example the `location.obtain(options)` could return -a Docker container with the software pre-installed, and no remote access (see the -[Clocker project](http://clocker.io) for more information on use of Docker with Brooklyn). - -The entity is then responsible for configuring that machine according to the needs of the software -to be installed. - -For example, the entity may install software packages, upload/update configuration files, launch -processes, etc. - -The entity may also configure `iptables`. This is also possible through the `JcloudsLocation` -configuration. However, it is preferable to do this in the entity because it is part of -configuring the machine in the way required for the given software component. - -The entity may also perform custom OS setup, such as installing security patches. However, whether -this is appropriate depends on the nature of the security patch: if the security patch is specific -to the entity type, then it should be done within the entity; but if it is to harden the base OS -to make it comply with an organisation's standards (e.g. to overcome shortcomings of the base -image, or to install security patches) then a `MachineLocationCustomizer` is more appropriate. - -#### Location Configuration Options - -This refers to standard location configuration: explicit config keys, and explicit jclouds template -configuration that can be passed through. - -This kind of configuration is simplest to use. It is the favoured mechanism when it comes to VM -provisioning, and should be used wherever possible. - -Note that a jclouds `TemplateBuilder` and cloud-specific `TemplateOptions` are the generic mechanisms -within jclouds for specifying the details of the compute resource to be provisioned. - -#### Jclouds Location Customizer -A `JcloudsLocationCustomizer` has customization hooks to execute code at the various points of building -up the jclouds template and provisioning the machine. Where jclouds is being used and where the required -use of jclouds goes beyond simple configuration, this is an appropriate solution. - -For example, there is a `org.apache.brooklyn.location.jclouds.networking.JcloudsLocationSecurityGroupCustomizer` -which gives more advanced support for setting up security groups (e.g. in AWS-EC2). - -#### Machine Customizer - -The `MachineLocationCustomizer` allows customization of machines being obtained from any kind of location. -For example, this includes for jclouds and for Bring Your Own Nodes (BYON). - -It provides customization hooks for when the machine has been provisioned (before it is returned by the location) -and when the machine is about to be released by the location. - -An example use would be to register (and de-register) the machine in a CMDB. - - -### Jclouds Location Customizers - -*Warning: additional methods (i.e. customization hooks) may be added to the `JcloudsLocationCustomizer` -interface in future releases. Users are therefore strongly encouraged to sub-class -`BasicJcloudsLocationCustomizer`, rather than implementing JcloudsLocationCustomizer directly.* - -The `JcloudsLocationCustomizer` provides customization hooks at various points of the Brooklyn's -use of jclouds. These can be used to adjust the configuration, to do additional setup, to do -custom logging, etc. - -* Customize the `org.jclouds.compute.domain.TemplateBuilder`, before it is used to build the template. - This is used to influence the choice of VM image, hardware profile, etc. This hook is not normally - required as the location configuration options can be used in instead. - -* Customize the `org.jclouds.compute.domain.Template`, to be used when creating the machine. This - hook is most often used for performing custom actions - for example to create or modify a security - group or volume, and to update the template's options to use that. - -* Customize the `org.jclouds.compute.options.TemplateOptions` to be used when creating the machine. - The `TemplateOptions` could be cast to a cloud-specific sub-type (if this does not have to work - across different clouds). Where the use-case is to just set simple configuration on the - `TemplateOptions`, consider instead using the config key `templateOptions`, which takes a map - of type String to Object - the strings should match the method names in the `TemplateOptions`. - -* Customize the `org.apache.brooklyn.location.jclouds.JcloudsMachineLocation` that has been - created. For Linux-based VMs, if the config `waitForSshable` was not false, then this machine - is guaranteed to be ssh'able. Similarly for WinRM access to Windows machines, if - `waitForWinRmAvailable` was not false. - -* Pre-release of the machine. If the actions required are specific to jclouds (e.g. using jclouds - to make calls to the cloud provider) then this should be used; otherwise one should use the more - generic `MachineLocationCustomizer`. - -* Post-release of the machine (i.e. after asking jclouds to destroying the machine). - -To register a `JcloudsLocationCustomizer` in YAML, the config key `customizers` can be used to -provide a list of instances. Each instance can be defined using `$brooklyn:object` to indicate -the type and its configuration. For example: - - location: - jclouds:aws-ec2:us-east-1: - customizers: - - $brooklyn:object: - type: com.acme.brooklyn.MyJcloudsLocationCustomizer - -To register `JcloudsLocationCustomizer` instances programmatically, set the config key -`JcloudsLocationConfig.JCLOUDS_LOCATION_CUSTOMIZERS` on the location, or pass this -config option when calling `location.obtain(options)`. - - -The `SharedLocationSecurityGroupCustomizer` configures a shared security group on Jclouds locations. -It only works on AWS and Azure ARM. - -To register a `SharedLocationSecurityGroupCustomizer` in YAML, you can use the config key `customizers` -and configure it with `$brooklyn:object` and `object.fields`. For example: - - location: - jclouds:aws-ec2:us-east-1: - customizers: - - $brooklyn:object: - type: org.apache.brooklyn.location.jclouds.networking.SharedLocationSecurityGroupCustomizer - object.fields: {locationName: "myloc", tcpPortRanges: ["22", "8080", "9443"], udpPortRanges: ["2001", "4013"], cidr: "82.40.153.101/24"} - -where `cidr` can be optionally set to restrict the range that the ports that are to be opened can be accessed from. - - - -#### Machine Location Customizers - -*Warning: additional methods (i.e. customization hooks) may be added to the `MachineLocationCustomizer` -interface in future releases. Users are therefore strongly encouraged to sub-class -`BasicMachineLocationCustomizer`, rather than implementing `MachineLocationCustomizer` directly.* - -The `MachineLocationCustomizer` provides customization hooks for when a machine is obtained/released -from a `MachineProvisioningLocation`. The following hooks are supported: - -* After the machine has been provisioned/allocated, but before it has been returned. - -* When the machine is about to be released, but prior to actually destroying/unallocating the - machine. - -To register a `MachineLocationCustomizer` in YAML, the config key `machineCustomizers` can be used -to provide a list of instances. Each instance can be defined using `$brooklyn:object` to indicate -the type and its configuration. For example: - - location: - jclouds:aws-ec2:us-east-1: - machineCustomizers: - - $brooklyn:object: - type: com.acme.brooklyn.MyMachineLocationCustomizer - -To register `MachineLocationCustomizer` instances programmatically, set the config key -`CloudLocationConfig.MACHINE_LOCATION_CUSTOMIZERS` on the location, or pass this -config option when calling `location.obtain(options)`. - -#### Hostname Customizer - -[org.apache.brooklyn.entity.machine.SetHostnameCustomizer](https://github.com/apache/brooklyn-server/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java) -Sets the hostname on an ssh'able machine. Currently only CentOS and RHEL are supported. -The customizer can be configured with a hard-coded hostname, or with a freemarker template whose value (after substitutions) will be used for the hostname.
http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/_openstack.md ---------------------------------------------------------------------- diff --git a/guide/locations/_openstack.md b/guide/locations/_openstack.md deleted file mode 100644 index 942eaa5..0000000 --- a/guide/locations/_openstack.md +++ /dev/null @@ -1,269 +0,0 @@ ---- -section: OpenStack -title: OpenStack -section_type: inline -section_position: 7 ---- - -## OpenStack - -### Apache jclouds - -Support for OpenStack is provided by Apache jclouds. For more information, see their guide -[here](https://jclouds.apache.org/guides/openstack/). - - -### Connection Details - -The endpoint URI is that of keystone (normally on port 5000). - -The identity normally consists of a colon-separated tenant and username. The credential is -the password. For example: - - location: - jclouds:openstack-nova: - endpoint: http://x.x.x.x:5000/v2.0/ - identity: "your-tenant:your-username" - credential: your-password - -OpenStack Nova access information can be downloaded from the openstack web interface, for example -as an openrc.sh file. It is usually available from API Access tab in "Access & Security" section. -This file will normally contain the identity and credential. - -Users are strongly recommended to use -[externalized configuration]({{ site.path.guide }}/ops/externalized-configuration.html) for better -credential management, for example using [Vault](https://www.vaultproject.io/). - - -### Common Configuration Options - -Below are examples of configuration options that use values specific to OpenStack environments: - -* The `imageId` is the id of an image. For example, - `imageId: RegionOne/08086159-8b0b-4970-b332-a7a929ee601f`. - These ids can be found from the the CLI or the web-console, for example in IBM Blue Box London, - the URL is https://tenant-region.openstack.blueboxgrid.com/project/images/. - -* The `hardwareId` is the [flavor id](http://docs.openstack.org/admin-guide/compute-flavors.html). - For example `hardwareId: RegionOne/1`. These ids can be found from the the CLI or the web-console, - for example in IBM Blue Box, the URL is https://tenant-region.openstack.blueboxgrid.com/admin/flavors/. - -The default flavors are shown below (though the set of flavors can be -[managed by the admin](http://docs.openstack.org/admin-guide/cli_manage_flavors.html)): - - +-----+-----------+-----------+------+ - | ID | Name | Memory_MB | Disk | - +-----+-----------+-----------+------+ - | 1 | m1.tiny | 512 | 1 | - | 2 | m1.small | 2048 | 20 | - | 3 | m1.medium | 4096 | 40 | - | 4 | m1.large | 8192 | 80 | - | 5 | m1.xlarge | 16384 | 160 | - +-----+-----------+-----------+------+ - -For further configuration options, consult -[jclouds Nova template options](https://jclouds.apache.org/reference/javadoc/2.0.x/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.html). -These can be used with the **[templateOptions](#custom-template-options)** configuration option. - - -### Networks - -When multiple networks are available you should indicate which ones machines should join. -Do this by setting the desired values id as an option in the -**[templateOptions](#custom-template-options)** configuration: - - location: - jclouds:openstack-nova: - ... - templateOptions: - # Assign the node to all networks in the list. - networks: - - network-one-id - - network-two-id - - ... - - -### Floating IPs - -The `autoAssignFloatingIp` option means that a [floating ip](https://www.mirantis.com/blog/configuring-floating-ip-addresses-networking-openstack-public-private-clouds/) -will be assigned to the VM at provision-time. - -A floating IP pool name can also be specified. If not set, a floating IP from any available pool will be chosen. -This is set using the [template option](#custom-template-options). For example: - - location: - jclouds:openstack-nova: - ... - autoAssignFloatingIp: true - templateOptions: - # Pool names to use when allocating a floating IP - floatingIpPoolNames: - - "pool name" - - -### Basic Location Structure - -This is a basic inline YAML template for an OpenStack location: - - location: - jclouds:openstack-nova: - endpoint: http://x.x.x.x:5000/v2.0/ - identity: "your-tenant:your-username" - credential: your-password - - # imageId, hardwareId, and loginUser* are optional - imageId: your-region-name/your-image-id - hardwareId: your-region-name/your-flavor-id - loginUser: 'ubuntu' - loginUser.privateKeyFile: /path/to/your/privatekey - - jclouds.openstack-nova.auto-generate-keypairs: false - jclouds.openstack-nova.auto-create-floating-ips: true - - templateOptions: - networks: [ "your-network-id" ] - floatingIpPoolNames: [ "your-floatingIp-pool" ] - securityGroups: ['your-security-group'] - - # Optional if 'jclouds.openstack-nova.auto-generate-keypairs' is assigned to 'true' - keyPairName: "your-keypair" - -This is the same OpenStack location in a format that can be added to your -`brooklyn.properties` file: - - brooklyn.location.named.My\ OpenStack=jclouds:openstack-nova:http://x.x.x.x:5000/v2.0/ - brooklyn.location.named.My\ OpenStack.identity=your-tenant:your-username - brooklyn.location.named.My\ OpenStack.credential=your-password - brooklyn.location.named.My\ OpenStack.endpoint=http://x.x.x.x:5000/v2.0/ - - brooklyn.location.named.My\ OpenStack.imageId=your-region-name/your-image-id - brooklyn.location.named.My\ OpenStack.hardwareId=your-region-name/your-flavor-id - brooklyn.location.named.My\ OpenStack.loginUser=ubuntu - brooklyn.location.named.My\ OpenStack.loginUser.privateKeyFile=/path/to/your/privatekey - brooklyn.location.named.My\ OpenStack.openstack-nova.auto-generate-keypairs=false - brooklyn.location.named.My\ OpenStack.openstack-nova.auto-create-floating-ips=true - - brooklyn.location.named.My\ OpenStack.networks=your-network-id - brooklyn.location.named.My\ OpenStack.floatingIpPoolNames=your-floatingIp-pool - brooklyn.location.named.My\ OpenStack.securityGroups=your-security-group - brooklyn.location.named.My\ OpenStack.keyPair=your-keypair - - -### Troubleshooting - -#### Cloud Credentials Failing - -If the cloud API calls return `401 Unauthorized` (e.g. in a `org.jclouds.rest.AuthorizationException`), -then this could be because the credentials are incorrect. - -A good way to check this is to try the same credentials with the -[OpenStack nova command line client](http://docs.openstack.org/user-guide/common/cli_install_openstack_command_line_clients.html). - - -#### Unable to SSH: Wrong User - -If SSH authentication fails, it could be that the login user is incorrect. For most clouds, this -is inferred from the image metadata, but if no (or the wrong) login user is specified then it will -default to root. The correct login user can be specified using the configuration option `loginUser`. -For example, `loginUser: ubuntu`. - -The use of the wrong login user can also result in the obscure message, caused by -an unexpected response saying to use a different user. For more technical information, see -this [sshj github issue](https://github.com/hierynomus/sshj/issues/75). The message is: - - Received message too long 1349281121 - - -#### I Want to Use My Own KeyPair - -By default, jclouds will auto-generate a new [key pair](http://docs.openstack.org/user-guide/cli_nova_configure_access_security_for_instances.html) -for the VM. This key pair will be deleted automatically when the VM is deleted. - -Alternatively, you can use a pre-existing key pair. If so, you must also specify the corresponding -private key (pem file, or data) to be used for the initial login. The name used in the `keyPair` -configuration must match the name of a key pair that has already been added in OpenStack. -For example: - - location: - jclouds:clouds:openstack-nova: - ... - jclouds.openstack-nova.auto-generate-keypairs: false - keyPair: "my-keypair" - loginUser: ubuntu - loginUser.privateKeyFile: /path/to/my/privatekey.pem - - -#### Error "doesn't contain ... -----BEGIN" - -If using `loginUser.privateKeyFile` (or `loginUser.privateKeyData`), this is expected to be a .pem -file. If a different format is used (e.g. a .ppk file), it will give an error like that below: - - Error invoking start at EmptySoftwareProcessImpl{id=TrmhitVc}: chars - PuTTY-User-Key-File-2: ssh-rsa - ... - doesn't contain % line [-----BEGIN ] - - -#### Warning Message: "Ignoring request to set..." - -If you see a warning log message like that below: - - 2016-06-23 06:05:12,297 WARN o.a.b.l.j.JcloudsLocation [brooklyn-execmanager-XlwkWB3k-312]: - Ignoring request to set template option loginUser because this is not supported by - org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions - -It can mean that the location configuration option is in the wrong place. The configuration under -`templateOptions` must correspond to those options on the -[jclouds Nova template options](https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.html). -However, template options such as `loginUser` are top-level configuration options that should not -be inside the `templateOptions` section. - - -#### HttpResponseException Accessing Compute Endpoint - -The Keystone endpoint is first queried to get the API access endpoints for the appropriate services. - -Some private OpenStack installs are (mis)configured such that the returned addresses are not always -directly accessible. It could be that the service is behind a VPN, or that they rely on hostnames -that are only in a private DNS. - -You can find the service endpoints in OpenStack, either using the CLI or the web-console. For -example, in Blue Box the URL is https://tenant-region.openstack.blueboxgrid.com/project/access_and_security/. -You can then check if the Compute service endpoint is directly reachable. - - -#### VM Failing to Provision - -It can be useful to drop down to the OpenStack nova CLI, or to jclouds, to confirm that VM -provisioning is working and to check which options are required. - -For example, try following [these jclouds instructions](https://github.com/jclouds/jclouds-examples/tree/master/compute-basics#your-own-openstack-nova). - - -#### jclouds Namespace Issue - -A change to Nova's API (in the Mitaka release) resulted in all extensions having the same "fake" -namespace which the current version of jclouds does not yet support. - -If you are having problems deploying to OpenStack, consult your Brooklyn debug log and -look for the following: - - "namespace": "http://docs.openstack.org/compute/ext/fake_xml" - -If you already have `jclouds:openstack-mitaka-nova`, then try using this instead of the vanilla -`jclouds:openstack-nova`. For example: - - location: - jclouds:openstack-mitaka-nova: - endpoint: http://x.x.x.x:5000/v2.0/ - identity: "your-tenant:your-username" - credential: your-password - templateOptions: - networks: [ "your-network-id" ] - floatingIpPoolNames: [ "your-floatingIp-pool" ] - -Note that the following values will be set by default when omitted above: - - jclouds.keystone.credential-type=passwordCredentials - jclouds.openstack-nova.auto-generate-keypairs: true - jclouds.openstack-nova.auto-create-floating-ips: true http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/_special-locations.md ---------------------------------------------------------------------- diff --git a/guide/locations/_special-locations.md b/guide/locations/_special-locations.md deleted file mode 100644 index a06b0ae..0000000 --- a/guide/locations/_special-locations.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -section: Specialized Locations -section_position: 13 -section_type: inline ---- - -### Specialized Locations - -Some additional location types are supported for specialized situations: - -#### Single Host - -The spec `host`, taking a string argument (the address) or a map (`host`, `user`, `password`, etc.), -provides a convenient syntax when specifying a single host. -For example: - -{% highlight yaml %} -location: host:(192.168.0.1) -services: -- type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server -{% endhighlight %} - -Or, in `brooklyn.properties`, set `brooklyn.location.named.host1=host:(192.168.0.1)`. - - -#### The Multi Location - -The spec `multi` allows multiple locations, specified as `targets`, -to be combined and treated as one location. - -##### Sequential Consumption - -In its simplest form, this will use the first target location where possible, -and will then switch to the second and subsequent locations when there are no -machines available. - -In the example below, it provisions the first node to `192.168.0.1`, then it provisions into AWS -us-east-1 region (because the bring-your-own-nodes region will have run out of nodes). - -{% highlight yaml %} -location: - multi: - targets: - - byon:(hosts=192.168.0.1) - - jclouds:aws-ec2:us-east-1 -services: -- type: org.apache.brooklyn.entity.group.DynamicCluster - brooklyn.config: - cluster.initial.size: 3 - dynamiccluster.memberspec: - $brooklyn:entitySpec: - type: org.apache.brooklyn.entity.machine.MachineEntity -{% endhighlight %} - -##### Round-Robin Consumption and Availability Zones for Clustered Applications - -A `DynamicCluster` can be configured to cycle through its deployment targets round-robin when -provided with a location that supports the `AvailabilityZoneExtension` -- the `multi` location -supports this extension. - -The configuration option `dynamiccluster.zone.enable` on `DynamicCluster` tells it to query the -given location for `AvailabilityZoneExtension` support. If the location supports it, then the -cluster will query for the list of availability zones (which in this case is simply the list of -targets) and deploy to them round-robin. - -In the example below, the cluster will request VMs round-robin across three different -locations (in this case, the locations were already added to the catalog, or defined in -`brooklyn.properties`). - -{% highlight yaml %} -location: - multi: - targets: - - my-location-1 - - my-location-2 - - my-location-3 -services: -- type: org.apache.brooklyn.entity.group.DynamicCluster - brooklyn.config: - dynamiccluster.zone.enable: true - cluster.initial.size: 3 - dynamiccluster.memberspec: - $brooklyn:entitySpec: - type: org.apache.brooklyn.entity.machine.MachineEntity -{% endhighlight %} - -Of course, clusters can also be deployed round-robin to real availability zones offered by -cloud providers, as long as their locations support `AvailabilityZoneExtension`. Currently, only -AWS EC2 locations support this feature. - -In the example below, the cluster will request VMs round-robin across the availability zones -provided by AWS EC2 in the "us-east-1" region. - -{% highlight yaml %} -location: jclouds:aws-ec2:us-east-1 -services: -- type: org.apache.brooklyn.entity.group.DynamicCluster - brooklyn.config: - dynamiccluster.zone.enable: true - cluster.initial.size: 3 - dynamiccluster.memberspec: - $brooklyn:entitySpec: - type: org.apache.brooklyn.entity.machine.MachineEntity -{% endhighlight %} - -For more information about AWS EC2 availability zones, see -[this guide](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html). - -Custom alternatives to round-robin are also possible using the configuration option -`dynamiccluster.zone.placementStrategy` on `DynamicCluster`. - - -#### The Server Pool - -The {% include java_link.html class_name="ServerPool" package_path="org/apache/brooklyn/entity/machine/pool" project_subpath="software/base" %} -entity type allows defining an entity which becomes available as a location. - http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/_ssh-keys.md ---------------------------------------------------------------------- diff --git a/guide/locations/_ssh-keys.md b/guide/locations/_ssh-keys.md deleted file mode 100644 index acf30d7..0000000 --- a/guide/locations/_ssh-keys.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -section: SSH Keys -section_position: 9 -section_type: inline ---- - -### SSH Keys - -SSH keys are one of the simplest and most secure ways to access remote servers. -They consist of two parts: - -* A private key (e.g. `id_rsa`) which is known only to one party or group - -* A public key (e.g. `id_rsa.pub`) which can be given to anyone and everyone, - and which can be used to confirm that a party has a private key - (or has signed a communication with the private key) - -In this way, someone -- such as you -- can have a private key, -and can install a public key on a remote machine (in an `authorized_keys` file) -for secure automated access. -Commands such as `ssh` (and Brooklyn) can log in without -revealing the private key to the remote machine, -the remote machine can confirm it is you accessing it (if no one else has the private key), -and no one snooping on the network can decrypt of any of the traffic. - - -#### Creating an SSH Key - -If you don't have an SSH key, create one with: - -{% highlight bash %} -$ ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa -{% endhighlight %} - - -#### Localhost Setup - -If you want to deploy to `localhost`, ensure that you have a public and private key, -and that your key is authorized for ssh access: - -{% highlight bash %} -# _Appends_ id_rsa.pub to authorized_keys. Other keys are unaffected. -$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys -{% endhighlight %} - -Now verify that your setup by running the command: `ssh localhost echo hello world` - -If your setup is correct, you should see `hello world` printed back at you. - -On the first connection, you may see a message similar to this: - -<pre> -The authenticity of host 'localhost (::1)' can't be established. -RSA key fingerprint is 7b:e3:8e:c6:5b:2a:05:a1:7c:8a:cf:d1:6a:83:c2:ad. -Are you sure you want to continue connecting (yes/no)? -</pre> - -Simply answer 'yes' and then repeat the command again. - -If this isn't the case, see below. - - - - -#### Potential Problems - -* **MacOS user?** In addition to the above, enable "Remote Login" in "System Preferences > Sharing". - -* **Got a passphrase?** Set `brooklyn.location.localhost.privateKeyPassphrase` - as described [here](index.html#os-setup). - If you're not sure, or you don't know what a passphrase is, you can test this by executing `ssh-keygen -y`. - If it does *not* ask for a passphrase, then your key has no passphrase. - If your key does have a passphrase, you can remove it by running `ssh-keygen -p`. - -* Check that you have an `~/.ssh/id_rsa` file (or `id_dsa`) and a corresponding public key with a `.pub` extension; - if not, create one as described above - -* `~/.ssh/` or files in that directory may have permissions they shouldn't: - they should be visible only to the user (apart from public keys), - both on the source machine and the target machine. - You can verify this with `ls -l ~/.ssh/`: lines should start with `-rw-------` or `-r--------` (or `-rwx------` for directories). - If it does not, execute `chmod go-rwx ~/.ssh ~/.ssh/*`. - -* Sometimes machines are configured with different sets of support SSL/TLS versions and ciphers; - if command-line `ssh` and `scp` work, but Brooklyn/java does not, check the versions enabled in Java and on both servers. - -* Missing entropy: creating and using ssh keys requires randomness available on the servers, - usually in `/dev/random`; see [here]({{ site.path.guide }}/ops/troubleshooting/increase-entropy.html) for more information http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/cloud-credentials.md ---------------------------------------------------------------------- diff --git a/guide/locations/cloud-credentials.md b/guide/locations/cloud-credentials.md deleted file mode 100644 index 36041e0..0000000 --- a/guide/locations/cloud-credentials.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: More Clouds -layout: website-normal ---- - -This page has moved. See [More Clouds](index.html#more-details-on-specific-clouds) instead. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/index.md ---------------------------------------------------------------------- diff --git a/guide/locations/index.md b/guide/locations/index.md deleted file mode 100644 index 9092ada..0000000 --- a/guide/locations/index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Locations -layout: website-normal -children: -- { path: provisioned-machine-requirements.md, section_position: 8 } -check_directory_for_children: true ---- - -Locations are the environments to which Brooklyn deploys applications. Most commonly these -are cloud services such as AWS, GCE, and IBM Softlayer. Brooklyn also supports deploying -to a pre-provisioned network or to localhost (primarily useful for testing blueprints). - -See also: - -* The [Locations yaml guide]({{ site.path.guide }}/blueprints/setting-locations.html) -* Use within an entity of the configuration option - [provisioning.properties]({{ site.path.guide }}/blueprints/entity-configuration.html#entity-provisioningproperties-overriding-and-merging) -* How to add location definitions to the [Catalog]({{ site.path.guide }}/blueprints/catalog/); and -* How to use [Externalized Configuration]({{ site.path.guide }}/ops/externalized-configuration.html). - -{% child_content %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/locations/provisioned-machine-requirements.md ---------------------------------------------------------------------- diff --git a/guide/locations/provisioned-machine-requirements.md b/guide/locations/provisioned-machine-requirements.md deleted file mode 100644 index 5b5bf99..0000000 --- a/guide/locations/provisioned-machine-requirements.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: Provisioned Machine Requirements -layout: website-normal ---- - -The requirements for how a provisioned machine should behave will depend on the -entites subsequently deployed there. - -Below are a set of common assumptions, made by many entity implementations, which -could cause subsequent errors if they do not hold. These relate to the machine's -configuration, rather than additional networking or security that a given Cloud -might offer. - -Also see the [Troubleshooting]({{ site.path.guide }}/ops/troubleshooting/) docs. - - -## Remote Access - -### SSH or WinRM Access - -Many entities require ssh'ing (or using WinRM for Windows), to install and configure -the software. - -An example of disabling all ssh'ing is shown below: - - location: - aws-ec2:us-east-1: - identity: XXXXXXXX - credential: XXXXXXXX - waitForSshable: false - pollForFirstReachableAddress: false - services: - - type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess - brooklyn.config: - onbox.base.dir.skipResolution: true - sshMonitoring.enabled: false - - -### Parsing SSH stdout: No Extra Lines - -For entities that execute ssh commands, these sometimes parse the resulting stdout. - -It is strongly recommended that VMs are configured so that no additional stdout is written when executing -remote ssh (or WinRM) commands. Such stdout risks interfering with the response parsing in some blueprints. - -For example, if configuring the VM to write out "Last login" information, this should be done for only -"interactive" shells (see [Stackoverflow](http://stackoverflow.com/a/415444/1393883) for more details). - - -### Passwordless Sudo - -Does passwordless sudo work? - -Try executing: - - sudo whoami - -See [Passwordless Sudo]({{ site.path.guide }}/locations/index.html#passwordless-sudo). - - -## Advertised Addresses - -### Hostname Resolves Locally - -Does the hostname known at the box resolve at the box? - -Try executing: - - ping $(hostname) - -if not, consider setting `generate.hostname: true` in the location config, for jclouds-based locations. - - -### IP Resolves Locally - -For the IP address advertised in Brooklyn using the sensor `host.addresses.private` (or `host.subnet.address`), -can the machine reach that IP? - -Get the sensor value, and then try executing: - - ping ${PRIVATE_IP} - -Is there a public IP (advertised using the sensor `host.addresses.public`, or `host.address`), and can the -machine reach it? - -Get the sensor value, and then try executing: - - ping ${PUBLIC_IP} - - -## Networking - -### Public Internet Access - -Can the machine reach the public internet, and does DNS resolve? - -Try executing: - - ping www.example.org - - -### Machine's Hostname in DNS - -Is the machine hostname well-known? If ones does a DNS lookup, e.g. from the Brooklyn server, does it resolve and -does it return the expected IP (e.g. the same IP as the `host.addresses.public` sensor)? Try using the hostname -that the machine reports when you execute `hostname`. - -Many blueprints do not require this, instead using IP addresses directly. Some blueprints may include registration -with an appropriate DNS server. Some clouds do this automatically. - - -### Reachability - -When provisioning two machines, can these two machines reach each other on the expected IP(s) and hostname(s)? - -Try using `ping` from one machine to another using the public or subnet ip or hostname. -However, note that `ping` requires access over ICMP, which may be disabled. Alternatively, -try connecting to a specific TCP port using `telnet <address> <port>`. - - -### Firewalls - -What firewall(s) are running on the machine, and are the required ports open? -On linux, check things like `iptables`, `firewalld`, `ufw` or other commercial -firewalls. On Windows, check the settings of the -[Windows Firewall](https://en.wikipedia.org/wiki/Windows_Firewall). - -Consider using `openIptables: true`, or even `stopIptables: true`. - - -## Sufficient Entropy for /dev/random - -Is there sufficient entropy on the machine, for `/dev/random` to respond quickly? - -Try executing: - - { cat /dev/random > /tmp/x & } ; sleep 10 ; kill %1 ; { cat /dev/random > /tmp/x & } ; sleep 1 ; kill %1 ; wc /tmp/x | awk '{print $3}' - -The result should be more than 1M. - -If not, consider setting `installDevUrandom: true` for jclouds-based locations. - -See instructions to [Increase Entropy]({{ site.path.guide }}/ops/troubleshooting/increase-entropy.html). - - -## File System - -### Permissions of /tmp - -Is `/tmp` writable? - -Try executing: - - touch /tmp/amp-test-file ; rm /tmp/amp-test-file - -Are files in `/tmp` executable (e.g. some places it has been mounted NO_EXECUTE)? - -Try executing: - - echo date > /tmp/brooklyn-test.sh && chmod +x /tmp/brooklyn-test.sh && /tmp/brooklyn-test.sh && rm /tmp/brooklyn-test.sh - http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/misc/download.md ---------------------------------------------------------------------- diff --git a/guide/misc/download.md b/guide/misc/download.md deleted file mode 100644 index 73d500b..0000000 --- a/guide/misc/download.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -layout: website-normal -title: Downloads ---- -{% include fields.md %} - -{% if site.brooklyn.is_snapshot %} -**The downloads on this page have not been voted on and should be used at your own risk. -The latest stable release can be accessed on the [main download page]({{ site.path.website }}/download/).** -{% endif %} - - -## Download Version {{ site.brooklyn-version }} - -<table class="table"> - <tr> - <th style='text-align:left'>Download</th> - <th style='text-align:left'>File/Format</th> - <th>checksums <small><a href="{{ site.path.website }}/download/verify.html" title='Instructions on verifying the integrity of your downloads.{% if site.brooklyn.is_snapshot %} May not be available for SNAPSHOT artifacts.{% endif %}'>(?)</a></small></th> - </tr> - <tr> - <td style='text-align:left;vertical-align:top' rowspan='2'>Binary distribution<br />Server & client</td> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-bin.tar.gz' title='Download TGZ archive'>apache-brooklyn-{{ site.brooklyn-version }}-bin.tar.gz</a></td> - <td ><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-bin.tar.gz.asc'>PGP</a>, {% endif %} - <a href='{{ site.hash_brooklyn.download_prefix }}-bin.tar.gz.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-bin.zip' title='Download ZIP archive'>apache-brooklyn-{{ site.brooklyn-version }}-bin.zip</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-bin.zip.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-bin.zip.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left;vertical-align:top'>RPM package<br />CentOS7, RHEL7, etc.</td> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-1.noarch.rpm' title='Download RPM package'>apache-brooklyn-{{ site.brooklyn-version }}-1.noarch.rpm</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-1.noarch.rpm.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-1.noarch.rpm.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left;vertical-align:top'>DEB package<br />Ubuntu, Debian, etc.</td> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}.deb' title='Download DEB package'>apache-brooklyn-{{ site.brooklyn-version }}.deb</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}.deb.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}.deb.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left;vertical-align:top' rowspan='6'>Client CLI only</td> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-linux.tar.gz' title='Download client CLI linux TGZ archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-linux.tar.gz</a></td> - <td ><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-linux.tar.gz.asc'>PGP</a>, {% endif %} - <a href='{{ site.hash_brooklyn.download_prefix }}-client-cli-linux.tar.gz.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-linux.zip' title='Download client CLI linux ZIP archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-linux.zip</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-linux.zip.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-linux.zip.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-macosx.tar.gz' title='Download client CLI macosx TGZ archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-macosx.tar.gz</a></td> - <td ><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-macosx.tar.gz.asc'>PGP</a>, {% endif %} - <a href='{{ site.hash_brooklyn.download_prefix }}-client-cli-macosx.tar.gz.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-macosx.zip' title='Download client CLI macosx ZIP archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-macosx.zip</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-macosx.zip.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-macosx.zip.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-windows.tar.gz' title='Download client CLI windows TGZ archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-windows.tar.gz</a></td> - <td ><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-windows.tar.gz.asc'>PGP</a>, {% endif %} - <a href='{{ site.hash_brooklyn.download_prefix }}-client-cli-windows.tar.gz.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-client-cli-windows.zip' title='Download client CLI windows ZIP archive'>apache-brooklyn-{{ site.brooklyn-version }}-client-cli-windows.zip</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-windows.zip.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-client-cli-windows.zip.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left;vertical-align:top' rowspan='2'>Source code</td> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-src.tar.gz' title='Download source TGZ archive'>apache-brooklyn-{{ site.brooklyn-version }}-src.tar.gz</a></td> - <td ><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-src.tar.gz.asc'>PGP</a>, {% endif %} - <a href='{{ site.hash_brooklyn.download_prefix }}-src.tar.gz.sha1'>SHA1</a></small></td> - </tr> - <tr> - <td style='text-align:left'><a href='{{ site.brooklyn.download_prefix }}-src.zip' title='Download source ZIP archive'>apache-brooklyn-{{ site.brooklyn-version }}-src.zip</a></td> - <td><small> - {% if site.brooklyn.is_release %}<a href='{{ site.brooklyn.hash_download_prefix }}-src.zip.asc'>PGP</a>, {% endif %} - <a href='{{ site.brooklyn.hash_download_prefix }}-src.zip.sha1'>SHA1</a></small></td> - </tr> -</table> - - -## Release Notes - -Release notes can be found [here]({{ site.path.guide }}/misc/release-notes.html). - -{% comment %} -TODO -<a name="examples"></a> - -## Examples - -Examples can be found in the main Brooklyn codebase, in the `/examples` directory. - -A good example to start with is the [Elastic Web Cluster]({{site.path.guide}}/use/examples/webcluster.html). - -{% endcomment %} - -<a name="maven"></a> - -## Maven - -If you use Maven, you can add Brooklyn with the following in your pom: - -<!-- the comment is included due to a jekyll/highlight bug which - removes indentation on the first line in a highlight block; - we want the actual XML indented so you can cut and paste into a pom.xml sensibly --> -{% highlight xml %} -<!-- include all Brooklyn items in our project --> - <dependencies> - <dependency> - <groupId>org.apache.brooklyn</groupId> - <artifactId>brooklyn-all</artifactId> - <version>{{ site.brooklyn-version }}</version> - </dependency> - </dependencies> -{% endhighlight %} - -`brooklyn-all` brings in all dependencies, including jclouds. -If you prefer a smaller repo you might want just ``brooklyn-core``, ``brooklyn-policies``, -and some of ``brooklyn-software-webapp``, ``brooklyn-software-database``, ``brooklyn-software-messaging``, or others -(browse the full list [here]({{ this_anything_url_search }})). - -If you wish to use the Apache snapshot repo, you can add this to you `pom.xml`: - -{% highlight xml %} -<!-- include repos for snapshot items and other dependencies --> - <repositories> - <repository> - <id>apache-nexus-snapshots</id> - <name>Apache Nexus Snapshots</name> - <url>https://repository.apache.org/content/repositories/snapshots</url> - <releases> <enabled>false</enabled> </releases> - <snapshots> <enabled>true</enabled> </snapshots> - </repository> - </repositories> -{% endhighlight %} - -{% if SNAPSHOT %} -**Please note**: to add a snapshot version of Brooklyn as a dependency to your project, -you must either have Brooklyn built locally or one of these snapshot repositories in your POM. -{% endif %} - - -<a name="source"></a> - -## Source Code - -Source code is hosted at [github.com/apache/brooklyn](http://github.com/apache/brooklyn), -with this version in branch [{{ site.brooklyn.git_branch }}]({{ site.brooklyn.url.git }}). -These locations have a `README.md` in the root which explains how to get the code including -submodules. - -Useful information on working with the source is [here]({{ site.path.guide }}/dev/code). http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/misc/index.md ---------------------------------------------------------------------- diff --git a/guide/misc/index.md b/guide/misc/index.md deleted file mode 100644 index a1f8827..0000000 --- a/guide/misc/index.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Other Resources -layout: website-normal -started-pdf-exclude: true -children: -- { title: Javadoc, path: javadoc/ } -- download.md -- release-notes.md -- known-issues.md -- { path: ../dev/, title_in_menu: "Developer Guide" } -- { path: /website/documentation/, title_in_menu: "All Documentation", menu_customization: { force_inactive: true } } ---- - -Further documentation specific to this version of Brooklyn includes: - -{% for item in page.menu %} -* [{{ item.title_in_menu }}]({{ item.url }}) -{% endfor %} - -Also see the [other versions]({{ site.path.website }}/meta/versions.html) or [general documentation]({{ site.path.website }}/documentation/). http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/misc/javadoc/index.md ---------------------------------------------------------------------- diff --git a/guide/misc/javadoc/index.md b/guide/misc/javadoc/index.md deleted file mode 100644 index 6841283..0000000 --- a/guide/misc/javadoc/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: website-normal -title: API Reference -toc: ../../toc.json ---- - -*Javadoc is not available as part of this build.* - -Please see the [source code](https://github.com/apache/brooklyn) to view javadoc. - -<!-- This page is normally overwritten by generated javadoc. --> http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/misc/known-issues.md ---------------------------------------------------------------------- diff --git a/guide/misc/known-issues.md b/guide/misc/known-issues.md deleted file mode 100644 index db54a06..0000000 --- a/guide/misc/known-issues.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: website-normal -title: Known Issues ---- - -## Unable to Provision certain types of Debian VMs - -*Symptom*: Brooklyn fails to provision Debian VMs (e.g. in aws-ec2). - -*Cause*: `sudo` is not available on path, causing Brooklyn to fail to confirm that the VM is ssh'able. - -*Workaround*: Choose an image that does have sudo (see [wiki.debian.org/Cloud/AmazonEC2Image](http://wiki.debian.org/Cloud/AmazonEC2Image)). - -*Fix*: is [Pull #600](https://github.com/brooklyncentral/brooklyn/pull/600); you may also want to run with `brooklyn.location.jclouds.aws-ec2.user=root` if subsequent commands give permission errors. - -*Versions Affected*: 0.5.0-M2 - - -### Unable to Provision Ubuntu 8 VMs - -*Symptom: Brooklyn fails to provision Ubuntu 8 VMs (e.g. in aws-ec2) with the following error 'Cannot insert the iptables rule for port 22. Error: sudo: illegal option `-n''. - -*Cause: Ubuntu 8 is too old; the sudo command doesn't support the -n setting. - -*Workaround: Choose Ubuntu 10 or higher. - -*Versions Affected*: 0.5.0-M2 http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/misc/release-notes.md ---------------------------------------------------------------------- diff --git a/guide/misc/release-notes.md b/guide/misc/release-notes.md deleted file mode 100644 index 970b86f..0000000 --- a/guide/misc/release-notes.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: website-normal -title: Release Notes ---- - -## Version {{ site.brooklyn-version }} - -{% if SNAPSHOT %} -**You are viewing a SNAPSHOT release (master branch), so this list is in progress!** -{% endif %} - -Thanks go to our community for their improvements, feedback and guidance, and -to Brooklyn's commercial users for funding much of this development. - -### New Features - - -### Backwards Compatibility - -Changes since 0.12.0: - - -For changes in prior versions, please refer to the release notes for -[0.12.0]({{ site.path.v }}/0.12.0/misc/release-notes.html). http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/ops/cli/cli-ref-guide.md ---------------------------------------------------------------------- diff --git a/guide/ops/cli/cli-ref-guide.md b/guide/ops/cli/cli-ref-guide.md deleted file mode 100644 index 09ea9b3..0000000 --- a/guide/ops/cli/cli-ref-guide.md +++ /dev/null @@ -1,322 +0,0 @@ ---- -title: CLI Reference Guide -layout: website-normal -menu_parent: index.md -children: -- { section: List of Commands } -- { section: Scopes } -- { section: Abbreviations} -- { section: Command Reference } -- { section: Login} -- { section: Applications} -- { section: Entities} -- { section: Sensors} -- { section: Effectors} -- { section: Policies} -- { section: Activities} -- { section: Miscellaneous} ---- - -## Usage -{% highlight text %} -NAME: - br - A Brooklyn command line client application - -USAGE: - br [global options] command [command options] [arguments...] -{% endhighlight %} - -## List of Commands -Commands whose description begins with a `*` character are particularly experimental -and likely to change in upcoming releases. - -{% highlight text %} -COMMANDS: - - Commands whose description begins with a "*" character are particularly experimental and likely to change in upcoming - releases. If not otherwise specified, "SCOPE" below means application or entity scope. If an entity scope is not - specified, the application entity is used as a default. - - access Show access control - activity Show the activity for an application / entity - add-catalog (deprecated, use catalog add) Add a new catalog item from the supplied YAML (a file or http URL) - add-children * Add a child or children to this entity from the supplied YAML - application Show the status and location of running applications - catalog Catalog operations - config Show the config for an application or entity - delete * Delete (expunge) a brooklyn application - deploy Deploy a new application from the given YAML (read from file or URL, or stdin) - destroy-policy Destroy a policy - effector Show the effectors for an application or entity - entity Show the entities of an application or entity - env Show the ENV stream for a given activity - invoke Invoke an effector of an application and entity - locations * List the available locations - login Login to brooklyn - policy Show the policies for an application or entity - rename Rename an application or entity - restart Invoke restart effector on an application and entity - sensor Show values of all sensors or named sensor for an application or entity - set Set config for an entity - spec Get the YAML spec used to create the entity, if available - start Invoke start effector on an application and entity - start-policy Start or resume a policy - stderr Show the STDERR stream for a given activity - stdin Show the STDIN stream for a given activity - stdout Show the STDOUT stream for a given activity - stop Invoke stop effector on an application and entity - stop-policy Suspends a policy - tree * Show the tree of all applications - version Display the version of the connected Brooklyn - help - -GLOBAL OPTIONS: - --skipSslChecks Skip verification of server's certificate chain and hostname (for use with self-signed certs) - --help, -h show help - --version, -v print the version -{% endhighlight %} - - -## Scopes -Many commands require a "scope" expression to indicate the target on which they operate. -Where this -is required the usage statements below will use the shorthand nomenclature of `<X-scope>`. -The various scopes should be replaced on the command line as: - -- `<app-scope>` - `application <Name|AppID>` - -- `<entity-scope>` - `application <Name|AppID> entity <Name|EntityID>` - -- `<effector-scope>` - `application <Name|AppID> effector <Name>` - `application <Name|AppID> entity <Name|EntityID> effector <Name>` - -- `<config-scope>` - `application <Name|AppID> entity <Name|EntityID> config <ConfigID>` - -- `<activity-scope>` - `activity <ActivityID>` - `application <Name|AppID> entity <Name|EntityID> activity <ActivityID>` - -## Abbreviations -Many of the commands and scopes have shortened aliases: - -{% highlight text %} -activity act -application app -entity ent -policy pol -{% endhighlight %} - -## Command Reference - -### Login - -- `br login <URL> [username [password]]` - Login to Brooklyn. The CLI will prompt for a password if it is not provided. If the Brooklyn server is running on - localhost with no security enabled, the username and password may be omitted. - On successful login, the version of the connected Brooklyn server is shown. - -- `br version` - Show the version of the connected Brooklyn server. - -### Applications - -- `br deploy ( <FILE|URL> | - )` - Deploy an application based on the supplied YAML file or URL, or read from STDIN when `-` is given instead of a file name. - -- `br application` - List the running applications. - -- `br application <Name|AppID>` - Show the detail for an application. - -- `br <app-scope> config` - Show the configuration details for an application. - -- `br <app-scope> config <ConfigID>` - Show the value for a configuration item. - -- `br <app-scope> spec` - Show the YAML specification used to create the application. - -- `br <app-scope> rename <Name>` - Rename the application to <Name>. - -- `br <app-scope> stop` - Stop an application. See below for further information on the `stop` effector. - -- `br <app-scope> start` - Start an application. See below for further information on the `start` effector. - -- `br <app-scope> restart` - Restart an application. See below for further information on the `restart` effector. - -- `br <app-scope> delete` - Delete an application from Brooklyn. - **NOTE:** Use this command with care. Even if the application / entities are still running, Brooklyn will drop all - knowledge of them and they will be left running in an 'orphaned' state. - -### Entities - -- `br <app-scope> entity` - List the child entities for an application. - -- `br <entity-scope> entity` - List the child entities for an entity. - -- `br <app-scope> entity <Name|EntityID>` - Show the detail of an entity. - -- `br <app-scope> entity -c <Name|EntityID>` - List the child entities for an entity. - -- `br <entity-scope> config` - Show the configuration details for an entity. - -- `br <entity-scope> config <ConfigID>` - Show the value for a configuration item. - -- `br <config-scope> set <ConfigValue>` - Set the value of a configuration item. - -- `br <entity-scope> spec` - Show the YAML specification used to create the entity. - -- `br <entity-scope> rename <Name>` - Rename the entity to <Name>. - -- `br <entity-scope> stop` - Stop an entity. See below for further information on the `stop` effector. - -- `br <entity-scope> start` - Start an entity. See below for further information on the `start` effector. - -- `br <entity-scope> restart` - Restart an entity. See below for further information on the `restart` effector. - -### Sensors - -- `br <app-scope> sensor` - List the sensors and values for an application. - -- `br <app-scope> sensor <SensorID>` - Show the value for a sensor. - -- `br <entity-scope> sensor` - List the sensors and values for an entity. - -- `br <entity-scope> sensor <SensorID>` - Show the value for a sensor. - -### Effectors - -- `br <app-scope> effector` - List the effectors for an application. - -- `br <app-scope> effector <EffectorID>` - Show the detail for an application effector. - -- `br <app-scope> effector <EffectorID> invoke` - Invoke the effector without any parameters. - -- `br <app-scope> effector <EffectorID> invoke [-P <param>=<value> ...]` - Invoke the effector with one of more parameters. - -- `br <entity-scope> effector` - List the effectors for an entity. - -- `br <entity-scope> effector <EffectorID>` - Show the detail for an entity effector. - -- `br <entity-scope> effector <EffectorID> invoke` - Invoke the effector without any parameters. - -- `br <entity-scope> effector <EffectorID> invoke [-P <param>=<value> ...]` - Invoke the effector with one of more parameters. - If the parameter value is - complex or multi-lined it may be provided in a file and referenced as: - `<param>=@<FILE>` - -**NOTE** Shortcut commands have been provided for the standard start, restart and stop effectors. For example: - -- `br <app-scope> stop` -- `br <entity-scope> restart restartChildren=true` - -### Policies - -- `br <entity-scope> policy` - List the policies for an entity. - -- `br <entity-scope> policy <PolicyID>` - Show the detail for an entity policy. - -- `br <entity-scope> start-policy <PolicyID>` - Start an entity policy. - -- `br <entity-scope> stop-policy <PolicyID>` - Stop an entity policy. - -- `br <entity-scope> destroy-policy <PolicyID>` - Destroy an entity policy. - -### Activities - -- `br <app-scope> activity` - List the activities for an application. - -- `br <entity-scope> activity` - List the activities for an entity. - -- `br <activity-scope> activity` - List the activities for an activity (ie its children). - -- `br activity <ActivityID>` - Show the detail for an activity. - -- `br activity -c <ActivityID>` - List the child activities of an activity. - -- `br <activity-scope> stdin` - Show the `<STDIN>` stream for an activity. - -- `br <activity-scope> stdout` - Show the `<STDOUT>` stream for an activity. - -- `br <activity-scope> stderr` - Show the `<STDERR>` stream for an activity. - -- `br <activity-scope> env` - Show the Environment for an activity. - -### Miscellaneous - - -#### Applications - -- `br tree` - List all of the applications and entities in a tree representation. - -#### Entities - -- `br <entity-scope> add-children <FILE|URL>` - Add a child or children to the entity from local YAML file or a URL. - -#### Catalog - -- `br catalog list <TYPE>` - List the application catalog, where `TYPE` is one of "application", "entity", "location", or "policy" - -- `br catalog delete <TYPE> <ITEM_ID:VERSION>` - Delete an item from the catalog, where `TYPE` is as above, and supplying the item's id and version - -- `br catalog add <FILE|URL>` - Add catalog entries from a local YAML file or a URL. The id and version of added entries are displayed. - -- `br locations` - List the location catalog. (Includes all locations including those defined in `brooklyn.cfg`) - -- `br access` - Show if you have access to provision locations. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/ops/cli/cli-usage-guide.md ---------------------------------------------------------------------- diff --git a/guide/ops/cli/cli-usage-guide.md b/guide/ops/cli/cli-usage-guide.md deleted file mode 100644 index 7e335b9..0000000 --- a/guide/ops/cli/cli-usage-guide.md +++ /dev/null @@ -1,486 +0,0 @@ ---- -title: CLI Usage Guide -layout: website-normal -menu_parent: index.md -children: -- { section: Login } -- { section: Applications } -- { section: Entities } -- { section: Sensors } -- { section: Effectors } -- { section: Policies } -- { section: Activities } -- { section: YAML Blueprint } ---- - -This document provides a brief overview of using the most common Brooklyn CLI commands, -by using the CLI to deploy an application then examine various aspects of it. - -The YAML blueprint for the application that will be deployed is shown at the end of this document. - -**NOTE:** In the sample output, some additional line-wrapping has been used to aid readabilty. Additionally, the -vertical bar character is omitted from table output for readability. For scripting purposes it can be useful in -conjunction with a shell pipeline like `some_command | cut -f 1 -d '|' | xargs -L1 some_other_command`. - -## Login -First, login to the running Brooklyn server. This example assumes that the Brooklyn server -is running on `localhost`; change the URL and credentials as necessary. - -{% highlight text %} -$ br login http://localhost:8081 admin -Enter Password: * -Connected to Brooklyn version 0.9.0-SNAPSHOT at http://localhost:8081 -{% endhighlight %} - -The version of the connected Brooklyn server may be viewed with the `version` command: - -{% highlight text %} -$ br version -0.9.0-SNAPSHOT -{% endhighlight %} - -## Applications -Deploy the application; on success the Id of the new application is displayed: - -{% highlight text %} -$ br deploy webapp-policy.yaml -Id: lmOcZbsT -Name: WebCluster -Status: In progress -{% endhighlight %} - -The `application` command can be used to list a summary of all the running applications. -After all of the entities have been started, the application status changes to `RUNNING`: - -{% highlight text %} -$ br application -Id Name Status Location -YeEQHwgW AppCluster RUNNING CNTBOtjI -lmOcZbsT WebCluster RUNNING CNTBOtjI -{% endhighlight %} - -Further details of an application can be seen by using the ApplicationID or Name as a -parameter for the `application` command: - -{% highlight text %} -$ br application WebCluster -Id: lmOcZbsT -Name: WebCluster -Status: RUNNING -ServiceUp: true -Type: org.apache.brooklyn.entity.stock.BasicApplication -CatalogItemId: null -LocationId: CNTBOtjI -LocationName: FixedListMachineProvisioningLocation:CNTB -LocationSpec: byon -LocationType: org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation -{% endhighlight %} - -The configuration details of an application can be seen with the `config` command: - -{% highlight text %} -$ br application WebCluster config -Key Value -camp.template.id TYWVroRz -brooklyn.wrapper_app true -{% endhighlight %} - - -## Entities -The entities of an application can be viewed with the `entity` command: - -{% highlight text %} -$ br app WebCluster entity -Id Name Type -xOcMooka WebApp org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster -thHnLFkP WebDB org.apache.brooklyn.entity.database.mysql.MySqlNode -{% endhighlight %} - -It is common for an entity to have child entities; these can be listed by providing an -entity-scope for the `entity` command: - -{% highlight text %} -$ br app WebCluster entity WebApp entity -Id Name Type -e5pWAiHf Cluster of TomcatServer org.apache.brooklyn.entity.webapp.DynamicWebAppCluster -CZ8QUVgX NginxController:CZ8Q org.apache.brooklyn.entity.proxy.nginx.NginxController -{% endhighlight %} - -or by using `-c` (or `--children`) flag with the `entity` command: - -{% highlight text %} -$ br app WebCluster entity -c e5pWAiHf -Id Name Type -x0P2LRxZ quarantine org.apache.brooklyn.entity.group.QuarantineGroup -QK6QjmrW TomcatServer:QK6Q org.apache.brooklyn.entity.webapp.tomcat.TomcatServer -{% endhighlight %} - -As for applications, the configuration details of an entity can be seen with the `config` -command: - -{% highlight text %} -$ br app WebCluster entity thHnLFkP config -Key Value -install.unique_label MySqlNode_5.6.26 -brooklyn.wrapper_app true -datastore.creation.script.url https://bit.ly/brooklyn-visitors-creation-script -camp.template.id dnw3GqN0 -camp.plan.id db -onbox.base.dir /home/vagrant/brooklyn-managed-processes -onbox.base.dir.resolved true - -{% endhighlight %} - -The value of a single configuration item can be displayed by using the configuration key -as a parameter for the `config` command: - -{% highlight text %} -$ br app WebCluster entity thHnLFkP config datastore.creation.script.url -https://bit.ly/brooklyn-visitors-creation-script -{% endhighlight %} - -The value of a configuration item can be changed by using the `set` command: - -{% highlight text %} -$ br app WebCluster entity thHnLFkP config datastore.creation.script.url set \"https://bit.ly/new-script\" -{% endhighlight %} - -## Sensors -The sensors associated with an application or entity can be listed with the `sensor` command: - -{% highlight text %} -$ br app WebCluster entity CZ8QUVgX sensor -Name Value -download.addon.urls: {"stickymodule":"https://bitbucket.org/nginx-goodies/n - ginx-sticky-module-ng/get/${addonversion}.tar.gz","pcr - e":"ftp://ftp.csx.cam.ac.uk/pub/software/programming/p - cre/pcre-${addonversion}.tar.gz"} -download.url: http://nginx.org/download/nginx-${version}.tar.gz -expandedinstall.dir: /home/vagrant/brooklyn-managed-processes/installs/Ngi - nxController_1.8.0/nginx-1.8.0 -host.address: 192.168.52.102 -host.name: 192.168.52.102 -host.sshAddress: vagrant@192.168.52.102:22 -host.subnet.address: 192.168.52.102 -host.subnet.hostname: 192.168.52.102 -http.port: 8000 -install.dir: /home/vagrant/brooklyn-managed-processes/installs/Ngin - xController_1.8.0 -log.location: /home/vagrant/brooklyn-managed-processes/apps/FoEXXwJ2 - /entities/NginxController_CZ8QUVgX/console -main.uri: http://192.168.52.102:8000/ -member.sensor.hostandport: -member.sensor.hostname: {"typeToken":null,"type":"java.lang.String","name":"ho - st.subnet.hostname","description":"Host name as known - internally in the subnet where it is running (if diffe - rent to host.name)","persistence":"REQUIRED"} -member.sensor.portNumber: {"typeToken":null,"type":"java.lang.Integer","name":"h - ttp.port","description":"HTTP port","persistence":"RE - QUIRED","configKey":{"name":"http.port","typeToken":nu - ll,"type":"org.apache.brooklyn.api.location.PortRange" - ,"description":"HTTP port","defaultValue":{"ranges":[{ - "port":8080},{"start":18080,"end":65535,"delta":1}]}," - reconfigurable":false,"inheritance":null,"constraint": - "ALWAYS_TRUE"}} -nginx.log.access: /home/vagrant/brooklyn-managed-processes/apps/FoEXXwJ2 - /entities/NginxController_CZ8QUVgX/logs/access.log -nginx.log.error: /home/vagrant/brooklyn-managed-processes/apps/FoEXXwJ2 - /entities/NginxController_CZ8QUVgX/logs/error.log -nginx.pid.file: /home/vagrant/brooklyn-managed-processes/apps/FoEXXwJ2 - /entities/NginxController_CZ8QUVgX/pid.txt -nginx.url.answers.nicely: true -proxy.domainName: -proxy.http.port: 8000 -proxy.https.port: 8443 -proxy.protocol: http -proxy.serverpool.targets: {"TomcatServerImpl{id=QK6QjmrW}":"192.168.52.103:8080"} -run.dir: /home/vagrant/brooklyn-managed-processes/apps/FoEXXwJ2 - /entities/NginxController_CZ8QUVgX -service.isUp: true -service.notUp.diagnostics: {} -service.notUp.indicators: {} -service.problems: {} -service.process.isRunning: true -service.state: RUNNING -service.state.expected: running @ 1449314377781 / Sat Dec 05 11:19:37 GMT 2015 -softwareprocess.pid.file: -softwareservice.provisioningLocation: {"type":"org.apache.brooklyn.api.location.Location","i - d":"zhYBc6xt"} -webapp.url: http://192.168.52.102:8000/ -{% endhighlight %} - -Details for an individual sensor can be shown by providing the Sensor Name as a -parameter to the `sensor` command: - -{% highlight text %} -$ br app WebCluster entity CZ8QUVgX sensor service.state.expected -running @ 1449314377781 / Sat Dec 05 11:19:37 GMT 2015 -{% endhighlight %} - -## Effectors -The effectors for an application or entity can be listed with the `effector` command: - -{% highlight text %} -$ br app WebCluster effector -Name Description Parameters -restart Restart the process/service represented by an entity -start Start the process/service represented by an entity locations -stop Stop the process/service represented by an entity -{% endhighlight %} - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q effector -Name Description Parameters -deploy Deploys an archive ... -getCurrentConfiguration Gets the current ... -populateServiceNotUpDiagnostics Populates the attribute ... -reload Forces reload of ... -restart Restart the process/service ... restartChildren,restartMachine -start Start the process/service ... locations -stop Stop the process/service ... stopProcessMode,stopMachineMode -update Updates the entities ... -{% endhighlight %} - -Details of an individual effector can be viewed by using the name as a parameter for -the `effector` command: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q effector update -Name: update -Description: Updates the entities configuration, and then forces reload of that configuration -Parameters: -{% endhighlight %} - -An effector can be invoked by using the `invoke` command with an effector-scope: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q effector update invoke -{% endhighlight %} - -Parameters can also be passed to the effector: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q effector restart invoke -P restartChildren=true -{% endhighlight %} - -If a parameter value is complex or spans multiple lines, it may be provided in a file and used like this: - -{% highlight text %} -$ br app WebCluster effector start invoke -P locations=@data.txt -{% endhighlight %} - -Shortcut commands are available for the 3 standard effectors of `start`, `restart` and `stop`. -These commands can be used directly with an app-scope or entity-scope: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q restart -$ br app WebCluster stop -{% endhighlight %} - -## Policies -The policies associated with an application or entity can be listed with the `policy` command: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q policy -Id Name State -VcZ0cfeO Controller targets tracker RUNNING -{% endhighlight %} - -Details of an individual policy may be viewed by using the PolicyID as a parameter to -the `policy` command: - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q policy VcZ0cfeO -Name Value Description -group DynamicWebAppClusterImpl{id=TpbkaK4D} group -notifyOnDuplicates false Whether to notify listeners when - a sensor is published with the - same value as last time -sensorsToTrack [Sensor: host.subnet.hostname Sensors of members to be monitored - (java.lang.String), Sensor: http.port (implicitly adds service-up - (java.lang.Integer)] to this list, but that - behaviour may be deleted in a - subsequent release!) -{% endhighlight %} - -## Activities -The activities for an application or entity may be listed with the `activity` command: - -{% highlight text %} -$ br app WebCluster activity -Id Task Submitted Status Streams -Wb6GV5rt start Sat Dec 19 11:08:01 GMT 2015 Completed -q2MbyyTo invoking start[locations] on 2 nodes Sat Dec 19 11:08:01 GMT 2015 Completed -{% endhighlight %} - -{% highlight text %} -$ br app WebCluster entity NginxController:CZ8Q activity -Id Task Submitted Status Streams -GVh0pyKG start Sun Dec 20 19:18:06 GMT 2015 Completed -WJm908rA provisioning (FixedListMachineProvisi... Sun Dec 20 19:18:06 GMT 2015 Completed -L0cKFBrW pre-start Sun Dec 20 19:18:06 GMT 2015 Completed -D0Ab2esP ssh: initializing on-box base dir ./b... Sun Dec 20 19:18:06 GMT 2015 Completed env,stderr,stdin,stdout -tumLAdo4 start (processes) Sun Dec 20 19:18:06 GMT 2015 Completed -YbF2czKM copy-pre-install-resources Sun Dec 20 19:18:06 GMT 2015 Completed -o3YdqxsQ pre-install Sun Dec 20 19:18:06 GMT 2015 Completed -TtGw4qMZ pre-install-command Sun Dec 20 19:18:06 GMT 2015 Completed -duPvOSDB setup Sun Dec 20 19:18:06 GMT 2015 Completed -WLtkbhgW copy-install-resources Sun Dec 20 19:18:06 GMT 2015 Completed -ZQtrImnl install Sun Dec 20 19:18:06 GMT 2015 Completed -hzi49YD6 ssh: setting up sudo Sun Dec 20 19:18:06 GMT 2015 Completed env,stderr,stdin,stdout -eEUHcpfi ssh: Getting machine details for: Ssh... Sun Dec 20 19:18:07 GMT 2015 Completed env,stderr,stdin,stdout -juTe2qLG ssh: installing NginxControllerImpl{i... Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -hXqwEZJl post-install-command Sun Dec 20 19:18:08 GMT 2015 Completed -vZliYwBI customize Sun Dec 20 19:18:08 GMT 2015 Completed -O4Wwb0bP ssh: customizing NginxControllerImpl{... Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -sDwMSkE2 copy-runtime-resources Sun Dec 20 19:18:08 GMT 2015 Completed -yDYkdkS8 ssh: create run directory Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -W7dI8r1c pre-launch-command Sun Dec 20 19:18:08 GMT 2015 Completed -OeZKwM5z launch Sun Dec 20 19:18:08 GMT 2015 Completed -y50Gne5E scheduled:nginx.url.answers.nicely @ ... Sun Dec 20 19:18:08 GMT 2015 Scheduler, -ARTninGE scheduled:service.process.isRunning @... Sun Dec 20 19:18:08 GMT 2015 Scheduler, -tvZoNUTN ssh: launching NginxControllerImpl{id... Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -YASrjA4w post-launch-command Sun Dec 20 19:18:09 GMT 2015 Completed -jgLYv8pE post-launch Sun Dec 20 19:18:09 GMT 2015 Completed -UN9OcWLS post-start Sun Dec 20 19:18:09 GMT 2015 Completed -nmiv97He reload Sun Dec 20 19:18:09 GMT 2015 Completed -FJfPbNtp ssh: restarting NginxControllerImpl{i... Sun Dec 20 19:18:10 GMT 2015 Completed env,stderr,stdin,stdout -Xm1tjvKf update Sun Dec 20 19:18:40 GMT 2015 Completed -Row67vfa reload Sun Dec 20 19:18:40 GMT 2015 Completed -r8QZXlxJ ssh: restarting NginxControllerImpl{i... Sun Dec 20 19:18:40 GMT 2015 Completed env,stderr,stdin,stdout -{% endhighlight %} - -The detail for an individual activity can be viewed by providing the ActivityID as a -parameter to the `activity` command (an app-scope or entity-scope is not not needed for viewing -the details of an activity): - -{% highlight text %} -$ br activity tvZoNUTN -Id: tvZoNUTN -DisplayName: ssh: launching NginxControllerImpl{id=OxPUBk1p} -Description: -EntityId: OxPUBk1p -EntityDisplayName: NginxController:OxPU -Submitted: Sun Dec 20 19:18:08 GMT 2015 -Started: Sun Dec 20 19:18:08 GMT 2015 -Ended: Sun Dec 20 19:18:09 GMT 2015 -CurrentStatus: Completed -IsError: false -IsCancelled: false -SubmittedByTask: OeZKwM5z -Streams: stdin: 1133, stdout: 162, stderr: 0, env 0 -DetailedStatus: "Completed after 1.05s - -Result: 0" -{% endhighlight %} - -The activity command output shows whether any streams were associated with it. The streams -and environment for an activity can be viewed with the commands `stdin`, `stdout`, -`stderr` and `env`: - -{% highlight text %} -$ br activity tvZoNUTN stdin -export RUN_DIR="/home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p" -mkdir -p $RUN_DIR -cd $RUN_DIR -cd /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p -{ which "./sbin/nginx" || { EXIT_CODE=$? && ( echo "The required executable \"./sbin/nginx\" does not exist" | tee /dev/stderr ) && exit $EXIT_CODE ; } ; } -nohup ./sbin/nginx -p /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p/ -c conf/server.conf > /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p/console 2>&1 & -for i in {1..10} -do - test -f /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p/logs/nginx.pid && ps -p `cat /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p/logs/nginx.pid` && exit - sleep 1 -done -echo "No explicit error launching nginx but couldn't find process by pid; continuing but may subsequently fail" -cat /home/vagrant/brooklyn-managed-processes/apps/V5GQCpIT/entities/NginxController_OxPUBk1p/console | tee /dev/stderr -{% endhighlight %} - -{% highlight text %} -$ br activity tvZoNUTN stdout -./sbin/nginx - PID TTY TIME CMD - 6178 ? 00:00:00 nginx -Executed /tmp/brooklyn-20151220-191808796-CaiI-launching_NginxControllerImpl_.sh, result 0 -{% endhighlight %} - -The child activities of an activity may be listed by providing an activity-scope for the -`activity` command: - -{% highlight text %} -$ br activity OeZKwM5z -Id: OeZKwM5z -DisplayName: launch -Description: -EntityId: OxPUBk1p -EntityDisplayName: NginxController:OxPU -Submitted: Sun Dec 20 19:18:08 GMT 2015 -Started: Sun Dec 20 19:18:08 GMT 2015 -Ended: Sun Dec 20 19:18:09 GMT 2015 -CurrentStatus: Completed -IsError: false -IsCancelled: false -SubmittedByTask: tumLAdo4 -Streams: -DetailedStatus: "Completed after 1.06s - -No return value (null)" - -$ br activity OeZKwM5z activity -Id Task Submitted Status Streams -tvZoNUTN ssh: launching NginxControllerImpl{id... Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -{% endhighlight %} - -or by using the `-c` (or `--children`) flag with the `activity` command: - -{% highlight text %} -$ br activity -c OeZKwM5z -Id Task Submitted Status Streams -tvZoNUTN ssh: launching NginxControllerImpl{id... Sun Dec 20 19:18:08 GMT 2015 Completed env,stderr,stdin,stdout -{% endhighlight %} - -## YAML Blueprint -This is the YAML blueprint used for this document, based on the [web cluster](../../blueprints/clusters-and-policies.html) examples. - -{% highlight text %} -name: WebCluster - -location: - byon: - user: vagrant - password: vagrant - hosts: - - 192.168.52.101 - - 192.168.52.102 - - 192.168.52.103 - - 192.168.52.104 - - 192.168.52.105 - -services: - -- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster - name: WebApp - brooklyn.config: - wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war - java.sysprops: - brooklyn.example.db.url: > - $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s", - component("db").attributeWhenReady("datastore.url"), - "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")) - brooklyn.policies: - - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy - brooklyn.config: - metric: webapp.reqs.perSec.windowed.perNode - metricLowerBound: 2 - metricUpperBound: 10 - minPoolSize: 1 - maxPoolSize: 2 - resizeUpStabilizationDelay: 1m - resizeDownStabilizationDelay: 5m - -- type: org.apache.brooklyn.entity.database.mysql.MySqlNode - id: db - name: WebDB - brooklyn.config: - creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password") - creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script -{% endhighlight %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/58bb3aa0/guide/ops/cli/index.md ---------------------------------------------------------------------- diff --git a/guide/ops/cli/index.md b/guide/ops/cli/index.md deleted file mode 100644 index 1c79ce9..0000000 --- a/guide/ops/cli/index.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -layout: website-normal -title: Client CLI Reference -children: -- cli-ref-guide.md -- cli-usage-guide.md ---- - - -**NOTE:** These documents are for using the Brooklyn Client CLI tool to access a running Brooklyn Server. For -information on starting on a Brooklyn Server, refer to [Server CLI Reference](../server-cli-reference.html). - -## Obtaining the CLI tool - -A selection of distributions of the CLI tool, `br`, are available to download from the download site {% if site.brooklyn-version contains 'SNAPSHOT' %} -[here](https://repository.apache.org/service/local/artifact/maven/redirect?r=snapshots&g=org.apache.brooklyn&a=brooklyn-client-cli&v={{site.brooklyn-version}}&c=bin&e=zip). -{% else %} here: - -* [Windows](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}-client-cli-windows.zip) -* [Linux](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}-client-cli-linux.tar.gz) -* [OSX](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}-client-cli-macosx.tar.gz) -{% endif %} - -Alternatively the CLI tool is available as an executable binary for many more platforms in the Apache Brooklyn - distribution, under `bin/brooklyn-client-cli/`, with each build in its own subdirectory: - -* Mac: `darwin.amd64/` -* Windows 32-bit: `windows.386/` -* Windows 64-bit: `windows.amd64/` -* Linux 32-bit: `linux.386/` -* Linux 64-bit: `linux.amd64/` - -The binary is completely self-contained so you can either copy it to your `bin/` directory -or add the appropriate directory above to your path: - - PATH=$PATH:$HOME/apache-brooklyn/bin/brooklyn-client-cli/linux.amd64/ - - -## Documentation - -{% include list-children.html %}