Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request help: remote debug model #300

Open
trayliang opened this issue Jan 23, 2024 · 1 comment
Open

request help: remote debug model #300

trayliang opened this issue Jan 23, 2024 · 1 comment

Comments

@trayliang
Copy link

Issue description

 I will java pragram deploymenet to cvm, I think local  debug.

Environment

start jvm params setting:
1、 java -jar -Xmx4g -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 /usr/local/apisix_plugin/demo-0.0.1-SNAPSHOT.jar

local developer pass idea jvm debug remote model

  • your apisix-java-plugin-runner version
    0.4.0
@Jazzylol
Copy link

我这几天测下来是可以的,macos本地开发是困难的,但是可以本地remote debug。你这个需要打一个自定义的apisix镜像然后expose 8000端口,同时你的pod或者cvm或者 container还需要 暴露8000端口,这样你就可以远程debug了...

Dockerfile

FROM apache/apisix:3.9.0-debian
USER root
RUN apt-get update
RUN apt -y install openjdk-17-jdk
RUN apt -y install less procps
RUN echo "alias ll='ls -alF'" >> /etc/bash.bashrc

EXPOSE 5005 --> 我的debug端口

我的docker-compose文件
services:
apisix:
image: apache/apisix:self_debug --> 自己打的debug镜像
container_name: apisix
environment:
- APISIX_DEPLOYMENT_ETCD_HOST=["http://etcd:2379"]
user: root
ports:
- "9080:9080"
- "9180:9180"
- "9443:9443"
- "9443:9443/udp"
- "9090:9092"
- "9100:9100"
- "9091:9091"
- "9999:9999"
- "5005:5005" --> 暴露下debug端口
volumes:
- ./config.yaml:/usr/local/apisix/conf/config.yaml
- ./ext-plugin:/usr/local/apisix/ext-plugin
- /tmp:/tmp
networks:
- all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants