How to setup the Jet Brains IntelliJ IDEA and Jet Brains CLION IDE to code and debug StarRocks #25196
Closed
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So you want to code and debug StarRocks, here's what you need to do.
Prerequisites
For this tutorial you need to:
Running StarRocks Front End in debug mode on your workstation
Personally I also install
jenv
andpyenv
so I can switch versions. I also runjenv enable-plugin export
so that my $JAVA_HOME is set correctly.Running StarRocks Front End and/or Back End in debug mode on a remote VM
Using Ubuntu 22.04 LTS. This is similar to the tutorial on compiling StarRocks; it just has additional packages.
Local StarRocks Front End Debugging
Since the frond end is a java application, just use debug it the same way as you would in any other java application.
Remote StarRocks Front End Debugging
On the Ubuntu VM, run
./start_fe.sh --debug
, then use IDEA remote debug to connect it. The default port is 5005, you can change it instart_fe.sh
scripts.Debug java parameter: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
Remote StarRocks Back End Debugging
It is recommended to run
mvn install -DskipTests
first infe
folder to ensure that thrift and protobuf in thegensrc
directory are compiled correctly.Then you need to enter
gensrc
folder, runmake clean
andmake
commands respectively, otherwise Clion can't detect thrift's output files.Use Clion to open
be
folder.Enter
Settings
, addToolchains
. Add a remote server first, then setup Build Tool, C and C++ Compiler separately.In
Settings
/Deployment
. Change foldermappings
.In
Settings
/Cmake
. Change Toolchain to be the remote toolchain just added. Add the following environment variables:Warning: Be careful not to check Include system environment variables.
Setup is now complete. Just wait for Clion and the remote server are synchronized and the code jump will work.
To star debugging the back end, ou have to use gdb. Modify the
start_backend.sh
fromto
Then just run
./bin/start_be.sh
without any flag.If you face the error report when debugging for lakehouse, just add
handle SIGSEGV nostop noprint pass
in ~/.gdbinit.Beta Was this translation helpful? Give feedback.
All reactions