Last active
December 17, 2020 08:29
-
-
Save pgilad/64ae6dba94201d64f4635b4a6af4c55f to your computer and use it in GitHub Desktop.
Supporting files for my blog post on remote jmx Spring Boot debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import reactor.core.publisher.Mono; | |
@RestController | |
public class DemoController { | |
@GetMapping("/ping") | |
public Mono<String> ping() { | |
return Mono.just("pong"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monitorRole readonly | |
controlRole readwrite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monitorRole 123456 | |
controlRole 123456789 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
RMI_HOST=$(wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname) | |
java -Dcom.sun.management.jmxremote \ | |
-Djava.net.preferIPv4Stack=true \ | |
-Djava.rmi.server.hostname=${RMI_HOST} \ | |
-Dcom.sun.management.jmxremote.local.only=false \ | |
-Dcom.sun.management.jmxremote.port=9010 \ | |
-Dcom.sun.management.jmxremote.rmi.port=9010 \ | |
-Dcom.sun.management.jmxremote.authenticate=true \ | |
-Dcom.sun.management.jmxremote.password.file=jmxremote.password \ | |
-Dcom.sun.management.jmxremote.access.file=jmxremote.access \ | |
-Dcom.sun.management.jmxremote.ssl=false \ | |
-jar demo-0.0.1-SNAPSHOT.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
java -Dcom.sun.management.jmxremote \ | |
-Djava.net.preferIPv4Stack=true \ | |
-Djava.rmi.server.hostname=localhost \ | |
-Dcom.sun.management.jmxremote.local.only=true \ | |
-Dcom.sun.management.jmxremote.port=9010 \ | |
-Dcom.sun.management.jmxremote.rmi.port=9010 \ | |
-Dcom.sun.management.jmxremote.authenticate=true \ | |
-Dcom.sun.management.jmxremote.password.file=jmxremote.password \ | |
-Dcom.sun.management.jmxremote.access.file=jmxremote.access \ | |
-Dcom.sun.management.jmxremote.ssl=false \ | |
-jar demo-0.0.1-SNAPSHOT.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host server | |
HostName ec2-11-11-111-111.eu-west-1.compute.amazonaws.com | |
User ubuntu | |
IdentityFile ~/.ssh/key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment