一 连接docker中jmx
注意:ports中如果不一样,连接不上;com.sun.management.jmxremote.rmi.port =com.sun.management.jmxremote.port
goodsapi:
image: java
volumes:
- ./goods-api.jar:/goods-api.jar
ports:
- 19090:19090
- 18080:8080
command: java -Dcom.sun.management.jmxremote.rmi.port=19090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=19090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=192.168.56.101 -Djava.security.egd=file:/dev/./urandom -jar ./goods-api.jar
extra_hosts:
- postgres-server:10.0.10.42