You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,8 @@ On Windows, the plugin will refuse to install unless the binary has the `.exe` f
43
43
## Usage
44
44
45
45
### Prerequisites
46
+
47
+
#### JDK Tools
46
48
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.
47
49
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:
48
50
@@ -60,10 +62,23 @@ Please note that this requires the use of an online buildpack (configured in the
60
62
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.
61
63
The `version` property is optional and can be used to request a specific Java version.
62
64
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
+
63
78
### Commands
64
79
<pre>
65
80
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
67
82
68
83
USAGE:
69
84
cf java [heap-dump|thread-dump] APP_NAME
@@ -86,14 +101,6 @@ The `-k` flag is invalid when invoking `cf java thread-dump`.
86
101
87
102
## Limitations
88
103
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
-
97
104
The capability of creating heap dumps is also limited by the filesystem available to the container.
98
105
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).
99
106
The amount of filesystem space available to a container is set for the entire Cloud Foundry landscape with a global configuration.
0 commit comments