Skip to content

Commit 9f3087e

Browse files
authored
Update Readme (#22)
* Update README * Add SSH access to Prerequisites
1 parent a2b0fe7 commit 9f3087e

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ On Windows, the plugin will refuse to install unless the binary has the `.exe` f
4343
## Usage
4444

4545
### Prerequisites
46+
47+
#### JDK Tools
4648
This plugin internally uses `jmap` for OpenJDK-like Java virtual machines. When using the [Cloud Foundry Java Buildpack](https://github.com/cloudfoundry/java-buildpack), `jmap` is no longer shipped by default in order to meet the legal obligations of the Cloud Foundry Foundation.
4749
To ensure that `jmap` is available in the container of your application, you have to explicitly request a full JDK in your application manifest via the `JBP_CONFIG_OPEN_JDK_JRE` environment variable. This could be done like this:
4850

@@ -60,10 +62,23 @@ Please note that this requires the use of an online buildpack (configured in the
6062
Please also note that this is not to be considered a recommendation to use a full JDK. It's just one option to get the tools required for the use of this plugin when you need it, e.g., for troubleshooting.
6163
The `version` property is optional and can be used to request a specific Java version.
6264

65+
#### SSH Access
66+
As it is built directly on `cf ssh`, the `cf java` plugin can work only with Cloud Foundry applications that have `cf ssh` enabled.
67+
To check if your app fulfills the requirements, you can find out by running the `cf ssh-enabled [app-name]` command.
68+
If not enabled yet, run `cf enable-ssh [app-name]`.
69+
70+
**Note:** You must restart your app after enabling SSH access.
71+
72+
In case a proxy server is used, ensure that `cf ssh` is configured accordingly.
73+
Refer to the [official documentation](https://docs.cloudfoundry.org/cf-cli/http-proxy.html#v3-ssh-socks5) of the Cloud Foundry Command Line for more information.
74+
If `cf java` is having issues connecting to your app, chances are the problem is in the networking issues encountered by `cf ssh`.
75+
To verify, run your `cf java` command in "dry-run" mode by adding the `-n` flag and try to execute the command line that `cf java` gives you back.
76+
If it fails, the issue is not in `cf java`, but in whatever makes `cf ssh` fail.
77+
6378
### Commands
6479
<pre>
6580
NAME:
66-
java - Obtain a heap dump or thread dump from a running, Diego-enabled, SSH-enabled Java application
81+
java - Obtain a heap dump or thread dump from a running, SSH-enabled Java application
6782

6883
USAGE:
6984
cf java [heap-dump|thread-dump] APP_NAME
@@ -86,14 +101,6 @@ The `-k` flag is invalid when invoking `cf java thread-dump`.
86101

87102
## Limitations
88103

89-
As it is built directly on `cf ssh`, the `cf java` plugin can work only with Diego applications that have `cf ssh` enabled.
90-
To check if your app fulfills the requirements, you can find out by running the `cf ssh-enabled [app-name]` command.
91-
92-
Also, `cf ssh` is *very* picky with proxies.
93-
If `cf java` is having issues connecting to your app, chances are the problem is in the networking issues encountered by `cf ssh`.
94-
To verify, run your `cf java` command in "dry-run" mode by adding the `-n` flag and try to execute the command line that `cf java` gives you back.
95-
If it fails, the issue is not in `cf java`, but in whatever makes `cf ssh` fail.
96-
97104
The capability of creating heap dumps is also limited by the filesystem available to the container.
98105
The `cf java heap-dump` command triggers the heap dump to file system, read the content of the file over the SSH connection, and then remove the heap dump file from the container's file system (unless you have the `-k` flag set).
99106
The amount of filesystem space available to a container is set for the entire Cloud Foundry landscape with a global configuration.

0 commit comments

Comments
 (0)