Skip to content

Instantly share code, notes, and snippets.

@jklingsporn
Created December 8, 2017 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jklingsporn/50e80ece40bd9dab46a57d964443450e to your computer and use it in GitHub Desktop.
Save jklingsporn/50e80ece40bd9dab46a57d964443450e to your computer and use it in GitHub Desktop.
Expose public IP to JMX on EC2 instance
JMX_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
exec java $JAVA_OPTS -Djava.rmi.server.hostname=$JMX_IP -jar app.jar $JAVA_ARGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment