侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 466 篇文章
  • 累计创建 185 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Docker Java 开启Debug模式

WinJay
2022-11-18 / 0 评论 / 0 点赞 / 100 阅读 / 3823 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

Java 开启Debug模式

image-20221118171214936

启动镜像-Pvt

docker run -itd \
--entrypoint  /bin/sh  \
--volume /mnt/000.Docker/003.Lit_Information:/logs   \
--add-host pvt-mysql.litsoft.com.cn:172.17.112.126 \
--restart always   \
--memory 2g   \
--user root   \
--name Lit_manHour   \
--hostname Lit_manHour   \
-p 5005:5005   \
-p 10071:8080   \
hub.xxxx.com/project-name/manhour-test:v1.99


# 5005:Debug所需端口
# 10071:8080 服务端口

进入容器

docker exec -it Lit_manHour /bin/sh

开启Debug

java  -jar /Lit_manHour.jar

#示例
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16  -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_manHour.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=pvt NACOS-ADDR=172.17.112.126:8849 SENTINEL-ADDR=172.17.112.126:8858


#示例
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16  -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_Reimburse.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=pvt NACOS-ADDR=172.17.112.126:8849
docker run -itd \
--entrypoint  /bin/sh \
--volume /mnt/000.Docker/003.Lit_Information:/logs \
--add-host www.lit.redis.com:10.17.0.21 \
--add-host www.lit.nacos.com:10.17.0.21 \
--add-host www.lit.mysql.com:10.17.0.21 \
--restart always   --memory 2g   --user root  \
--name Lit_GateWay   --hostname Lit_GateWay  \
-p 5005:5005   -p 10000:8080  \
hub.xxxx.com/project-name/gateway-prod:v1.24

java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -jar /Lit_Gateway.jar --server.port=8080 --spring.profiles.active=dev -NACOS-ADDR=10.17.0.21:8848

启动镜像-UAT

docker run -itd \
--entrypoint  /bin/sh  \
--volume /mnt/000.Docker/003.Lit_Information:/logs \
--add-host www.lit.redis.com:10.17.0.21 \
--add-host www.lit.nacos.com:10.17.0.21 \
--add-host www.lit.mysql.com:10.17.0.21 \
--add-host Lit_GateWay:10.17.0.21 \
--net=host \
--user root \
--memory 2g \
--restart always \
--name Lit_GateWay \
--hostname Lit_GateWay \
-p 5005:5005   \
-p 10000:8080   \
hub.xxxx.com/project-name/gateway-prod:v1.24

进入容器

docker exec -it Lit_GateWay /bin/sh

开启Debug

java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16  -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_manHour.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=uat NACOS-ADDR=10.17.0.21:8848
nohup java -jar Lit_Gateway.jar  > ./logs/Lit_Gateway.log &
0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区