You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by aashish choudhary <aa...@gmail.com> on 2019/08/14 17:15:18 UTC

Debugging geode functions

Hi All,

Is there any easy way to debug geode functions?

With best regards,
Ashish

Re: Debugging geode functions

Posted by Charlie Black <cb...@pivotal.io>.
With a debugger, the key is to not suspend all threads in the debugger or
the other members in the cluster will start suspecting and kick the
debugged member out.

Intellij docs on how to do that:
https://www.jetbrains.com/help/idea/using-breakpoints.html#method_breakpoint

If you need to have all the threads stopped.   Then launch Geode in a
single JVM - then there isn't another process saying your debugged process
has issues and kicks it out of the system.

Charlie

On Wed, Aug 14, 2019 at 10:15 AM aashish choudhary <
aashish.choudhary1@gmail.com> wrote:

> Hi All,
>
> Is there any easy way to debug geode functions?
>
> With best regards,
> Ashish
>


-- 
Charlie Black | cblack@pivotal.io

Re: Debugging geode functions

Posted by Gregory Green <gg...@pivotal.io>.
Also, you probably already know this, but if you have multiple data nodes
on a single server, they each must have a unique remote debugging port.
*----*
*Gregory Green | Data Solution Architecture | DataTx*
*--*
*Articles/Videos*
Monoliths to Microservices? Don’t Forget to Transform the Data Layer
<https://content.pivotal.io/engineers/moving-from-monoliths-to-microservices-don-t-forget-to-transform-the-data-layer-here-s-how>
How to Build Modern Data Pipelines with GemFire and SCDF
<https://content.pivotal.io/blog/how-to-build-modern-data-pipelines-with-pivotal-gemfire-and-spring-cloud-data-flow>
GemFire AWS Quickstart <https://youtu.be/QqWKzZ2MeOY>





On Wed, Aug 14, 2019 at 4:08 PM Gregory Green <gg...@pivotal.io> wrote:

> Hello Aashish ,
>
> Just to add to the great information that has already been provided:
>
> You can enable remote debugging on the cluster server-side by adding JMV
> parameters the following when starting the Apache Geode Cache
> Server/DataNode
>
> -Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT
>
>
> When starting the Data Node with remote debugging thru gfsh, these
> parameters would look something like this:
>
> *gfsh -e  "start server --name=locator  --locators=localhost[10334]
>  --J=-Xdebug
> --J=-Xrunjdwp:server=y,suspend=n,transport=dt_socket,address=14000" *
>
>
>
> In IntelliJi, in the project that has the Apache Geode function source
> code you can perform the following;
>
> Run -> Edit Configurations  -> Remote ->  Click + -> Enter host/port
> Then click Run -> debug "name of process"
>
>
> example screenshot
>
> [image: image.png]
>
> Hope this helps
> *----*
> *Gregory Green | Data Solution Architecture | DataTx*
> *--*
> *Articles/Videos*
> Monoliths to Microservices? Don’t Forget to Transform the Data Layer
> <https://content.pivotal.io/engineers/moving-from-monoliths-to-microservices-don-t-forget-to-transform-the-data-layer-here-s-how>
> How to Build Modern Data Pipelines with GemFire and SCDF
> <https://content.pivotal.io/blog/how-to-build-modern-data-pipelines-with-pivotal-gemfire-and-spring-cloud-data-flow>
> GemFire AWS Quickstart <https://youtu.be/QqWKzZ2MeOY>
>
>
>
>
>
> On Wed, Aug 14, 2019 at 2:24 PM Mark Secrist <ms...@pivotal.io> wrote:
>
>> I find copious use of logging extremely useful when debugging any
>> server-side component. It's pretty easy to get set up with the following:
>> Logger logger = LogService.getLogger()
>>
>> Logger is an org.apache.logging.log4j.Logger
>>
>> This logs to your server log files and can fairly easily be parsed and
>> searched.
>>
>> On Wed, Aug 14, 2019 at 12:15 PM Anilkumar Gingade <ag...@pivotal.io>
>> wrote:
>>
>>> Are you looking to debug in test environment or production?
>>> Couple of options are debug/info level logging; or attaching to the
>>> process with IDE.
>>> You can deploy a test function with additional logs; after debugging,
>>> deploy production ready function (without logs).
>>>
>>> -Anil
>>>
>>>
>>> On Wed, Aug 14, 2019 at 10:15 AM aashish choudhary <
>>> aashish.choudhary1@gmail.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Is there any easy way to debug geode functions?
>>>>
>>>> With best regards,
>>>> Ashish
>>>>
>>>
>>
>> --
>>
>> *Mark Secrist | Director, **Global Education Delivery*
>>
>> msecrist@pivotal.io
>>
>> 970.214.4567 Mobile
>>
>>
>>   *pivotal.io <http://www.pivotal.io/>*
>>
>> Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn
>> <http://www.linkedin.com/company/pivotalsoftware> | Facebook
>> <http://www.facebook.com/pivotalsoftware> | YouTube
>> <http://www.youtube.com/gopivotal> | Google+
>> <https://plus.google.com/105320112436428794490>
>>
>

Re: Debugging geode functions

Posted by Gregory Green <gg...@pivotal.io>.
Hello Aashish ,

Just to add to the great information that has already been provided:

You can enable remote debugging on the cluster server-side by adding JMV
parameters the following when starting the Apache Geode Cache
Server/DataNode

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT


When starting the Data Node with remote debugging thru gfsh, these
parameters would look something like this:

*gfsh -e  "start server --name=locator  --locators=localhost[10334]
 --J=-Xdebug
--J=-Xrunjdwp:server=y,suspend=n,transport=dt_socket,address=14000" *



In IntelliJi, in the project that has the Apache Geode function source code
you can perform the following;

Run -> Edit Configurations  -> Remote ->  Click + -> Enter host/port
Then click Run -> debug "name of process"


example screenshot

[image: image.png]

Hope this helps
*----*
*Gregory Green | Data Solution Architecture | DataTx*
*--*
*Articles/Videos*
Monoliths to Microservices? Don’t Forget to Transform the Data Layer
<https://content.pivotal.io/engineers/moving-from-monoliths-to-microservices-don-t-forget-to-transform-the-data-layer-here-s-how>
How to Build Modern Data Pipelines with GemFire and SCDF
<https://content.pivotal.io/blog/how-to-build-modern-data-pipelines-with-pivotal-gemfire-and-spring-cloud-data-flow>
GemFire AWS Quickstart <https://youtu.be/QqWKzZ2MeOY>





On Wed, Aug 14, 2019 at 2:24 PM Mark Secrist <ms...@pivotal.io> wrote:

> I find copious use of logging extremely useful when debugging any
> server-side component. It's pretty easy to get set up with the following:
> Logger logger = LogService.getLogger()
>
> Logger is an org.apache.logging.log4j.Logger
>
> This logs to your server log files and can fairly easily be parsed and
> searched.
>
> On Wed, Aug 14, 2019 at 12:15 PM Anilkumar Gingade <ag...@pivotal.io>
> wrote:
>
>> Are you looking to debug in test environment or production?
>> Couple of options are debug/info level logging; or attaching to the
>> process with IDE.
>> You can deploy a test function with additional logs; after debugging,
>> deploy production ready function (without logs).
>>
>> -Anil
>>
>>
>> On Wed, Aug 14, 2019 at 10:15 AM aashish choudhary <
>> aashish.choudhary1@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> Is there any easy way to debug geode functions?
>>>
>>> With best regards,
>>> Ashish
>>>
>>
>
> --
>
> *Mark Secrist | Director, **Global Education Delivery*
>
> msecrist@pivotal.io
>
> 970.214.4567 Mobile
>
>
>   *pivotal.io <http://www.pivotal.io/>*
>
> Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn
> <http://www.linkedin.com/company/pivotalsoftware> | Facebook
> <http://www.facebook.com/pivotalsoftware> | YouTube
> <http://www.youtube.com/gopivotal> | Google+
> <https://plus.google.com/105320112436428794490>
>

Re: Debugging geode functions

Posted by Mark Secrist <ms...@pivotal.io>.
I find copious use of logging extremely useful when debugging any
server-side component. It's pretty easy to get set up with the following:
Logger logger = LogService.getLogger()

Logger is an org.apache.logging.log4j.Logger

This logs to your server log files and can fairly easily be parsed and
searched.

On Wed, Aug 14, 2019 at 12:15 PM Anilkumar Gingade <ag...@pivotal.io>
wrote:

> Are you looking to debug in test environment or production?
> Couple of options are debug/info level logging; or attaching to the
> process with IDE.
> You can deploy a test function with additional logs; after debugging,
> deploy production ready function (without logs).
>
> -Anil
>
>
> On Wed, Aug 14, 2019 at 10:15 AM aashish choudhary <
> aashish.choudhary1@gmail.com> wrote:
>
>> Hi All,
>>
>> Is there any easy way to debug geode functions?
>>
>> With best regards,
>> Ashish
>>
>

-- 

*Mark Secrist | Director, **Global Education Delivery*

msecrist@pivotal.io

970.214.4567 Mobile


  *pivotal.io <http://www.pivotal.io/>*

Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn
<http://www.linkedin.com/company/pivotalsoftware> | Facebook
<http://www.facebook.com/pivotalsoftware> | YouTube
<http://www.youtube.com/gopivotal> | Google+
<https://plus.google.com/105320112436428794490>

Re: Debugging geode functions

Posted by Anilkumar Gingade <ag...@pivotal.io>.
Are you looking to debug in test environment or production?
Couple of options are debug/info level logging; or attaching to the process
with IDE.
You can deploy a test function with additional logs; after debugging,
deploy production ready function (without logs).

-Anil


On Wed, Aug 14, 2019 at 10:15 AM aashish choudhary <
aashish.choudhary1@gmail.com> wrote:

> Hi All,
>
> Is there any easy way to debug geode functions?
>
> With best regards,
> Ashish
>