How to Remote Manage » History » Version 3
Henning Blohm, 16.02.2020 22:21
1 | 1 | Henning Blohm | h1. How to Remote Manage |
---|---|---|---|
2 | 2 | Henning Blohm | |
3 | A significant amount of internal state and operations of a z2 system can be accessed via JMX using tools such as jconsole. In order to access z2 via JMX some JMX related configuration should be applied. |
||
4 | |||
5 | 3 | Henning Blohm | h2. Configuring JMX access in Z2 |
6 | |||
7 | h2. Accessing a Java VM remotely via JMX |
||
8 | |||
9 | It should not be necessary, but unfortunately, as JMX in based on RMI, accessing to a Java VM via JMX remotely can be non-trivial. |
||
10 | |||
11 | Here are two practical approaches: |
||
12 | |||
13 | h3. Accessing a Remote JVM via JMX directly |
||
14 | |||
15 | TBC |
||
16 | |||
17 | h3. Accessing a Remote JVM via JMX via an SSH tunnel |
||
18 | |||
19 | protected, localhost only, no user name required |
||
20 | |||
21 | TBC |
||
22 | |||
23 | 2 | Henning Blohm | |
24 | h2. Remote Synchronization and Log Streaming |
||
25 | |||
26 | Starting with version 2.8, Z2 offers a built-in command line utility to synchronize (with log output) and provide streaming access to the z2 home log. When in Z2_HOME/bin run: |
||
27 | |||
28 | <pre><code class="bash"> |
||
29 | java -cp z.jar com.zfabrik.launch.Manage -? |
||
30 | </code></pre> |
||
31 | |||
32 | for the usage: |
||
33 | |||
34 | <pre><code class="bash"> |
||
35 | SYNOPSIS |
||
36 | |||
37 | java -cp z.jar Manage <command> <options> |
||
38 | |||
39 | COMMANDS |
||
40 | |||
41 | sync The sync performs a synchronization of a running (remote) z2 Home. |
||
42 | |||
43 | showlog Continuously stream the z2 Home log of a running z2 Home to the current stderr. |
||
44 | |||
45 | OPTIONS |
||
46 | |||
47 | -url <url> |
||
48 | JMX URL identifying the target z2 Home. Defaults to service:jmx:rmi:///jndi/rmi://localhost:7777/jmxrmi |
||
49 | The URL may be shortened to <host>:<port> (e.g. localhost:7777) |
||
50 | |||
51 | |||
52 | -user <username> |
||
53 | |||
54 | Username used for JMX authentication. Optional. |
||
55 | |||
56 | -pass <password> |
||
57 | |||
58 | Password used for JMX authentication. Optional. Mandatory when a username has been set |
||
59 | |||
60 | -b <n> |
||
61 | |||
62 | Number of lines to read before current (if available) when running showlog. |
||
63 | |||
64 | EXAMPLE |
||
65 | |||
66 | java -cp z.jar com.zfabrik.launch.Manage showlog -url host:7777 -user admin -pass admin |
||
67 | </code></pre> |