Layer7 API Management

Expand all | Collapse all

Config JVM arguments

  • 1.  Config JVM arguments

    Posted Feb 09, 2016 05:47 PM

    Hi

     

    We are doing a PoC on New Relic (APM tool) integration with CA API Gateway (Layer 7) server. As part of it, we need to modify the JVM arguments to include the New Relic agent jar file.

     

    The following changes are done:

     

    appliancedefs.sh file:

    #NODE_OPTS="$NODE_OPTS -javaagent:/home/newrelic/newrelic/newrelic.jar"

     

    Server reboot failed with below error messages:

    2016-02-10T11:58:22.000-0600 WARNING 1 com.l7tech.server.processcontroller.p: default exited with status 0

    2016-02-10T11:58:22.003-0600 WARNING 1 com.l7tech.server.processcontroller.ProcessController: default crashed on startup with exit code 0

    2016-02-10T11:58:22.004-0600 WARNING 1 com.l7tech.server.processcontroller.ProcessController: default crashed on startup; copying its output:

    2016-02-10T11:58:30.346-0600 INFO    17 com.l7tech.server.processcontroller.monitoring.sampling.l: Node state temporarily unavailable (returning last known state, WONT_START)

    2016-02-10T11:58:40.347-0600 INFO    14 com.l7tech.server.processcontroller.monitoring.sampling.l: Node state temporarily unavailable (returning last known state, WONT_START)

    2016-02-10T11:58:40.418-0600 INFO    15 com.l7tech.server.processcontroller.ProcessController: Getting API port from /opt/SecureSpan/Gateway/node/default/var/processControllerPort

    2016-02-10T11:58:50.348-0600 INFO    14 com.l7tech.server.processcontroller.monitoring.sampling.l: Node state temporarily unavailable (returning last known state, WONT_START)

    2016-02-10T11:59:00.349-0600 INFO    19 com.l7tech.server.processcontroller.monitoring.sampling.l: Node state temporarily unavailable (returning last known state, WONT_START)

    2016-02-10T11:59:10.350-0600 INFO    17 com.l7tech.server.processcontroller.monitoring.sampling.l: Node state temporarily unavailable (returning last known state, WONT_START)

    2016-02-10T11:59:10.443-0600 INFO    16 com.l7tech.server.processcontroller.ProcessController: Getting API port from /opt/SecureSpan/Gateway/node/default/var/processControllerPort

    ###########################################################################################

     

    Can you please help me to configure the JVM arguments?

     

    Thanks.



  • 2.  Re: Config JVM arguments

    Posted Feb 11, 2016 06:24 PM

    Hi Senthil,

      I had to do a similar thing for AppDynamics with API Gateway. I had made the changes to node.properties and added

    node.java.opts = -javaagent:/opt/tools/AppDynamics/javaagent.jar

    as the first line and restarted the Gateway and its picked up.

    Permissions must be available to the server process to read the jar. I have created my AppDynamics with the same user as that of the server process. I have had no issues.

     

    Let me know how you get along.

     

    Regards,

    Trinath



  • 3.  Re: Config JVM arguments

    Posted Feb 11, 2016 09:10 PM

    Great. It worked and see the app in newrelic dashboard. But there is no data available and the dashboard is empty. CA API gateway (Layer 7) is mocked with SOAP webservices. When I run the SOAP services, i dont see any data flowing into newrelic dashboard. Is anything else missing?

     

    Thanks.



  • 4.  Re: Config JVM arguments

    Posted Feb 12, 2016 01:48 AM

    Hi Senthil,

       At least in my case it takes few mins to an hour for the data to get reflected on the AppDynamics dashboard. I see New Relic to be similar to AppDynamics hence it may take time to show up data. If it still does not show up the data even after couple of hours, it may help to see if there are logs being written at all, in some cases, there may be issue writing the logs to a particular folder by the agent (due to lack of permissions) which may prevent the agent to perform effectively.

    Regards,

    Trinath



  • 5.  Re: Config JVM arguments

    Posted Feb 12, 2016 01:34 PM

    Hi Trinath

     

    Thanks for your reply. Still i did not see the data in newrelic dashboard. For the very first time, the log directory and agent log file was created. Later, i deleted the log file as it was very huge. But after that the log file did not get created at all. Finally, i deleted the log directory itself to see whether it creates new log directory. But nothing happened. I am surprised on how the logs got created for the first time. No permission changes happened after the first time log creation. Basically the set up now is - the user and group of node directory/node.properties is exactly equal to new relic directory and all its sub-directories/files. Is this fine or anything is missing. Do we need to make any changes to the JDK directory? I am trying capture / monitor the data streams / transactions collected in CA API Gateway (Layer 7) and there is no war/jar deployed in this server. Please let me know your thoughts.

     

    Thanks.



  • 6.  Re: Config JVM arguments

    Posted Feb 12, 2016 07:49 PM

    Hello Trinath

     

    The log files got generated after setting permissions to few files and also synchronizing the security at server and agent levels. Now the data is monitored successfully by NewRelic.

     

    Thanks so much for your input and time.

     

    Regards

    Senthil.



  • 7.  Re: Config JVM arguments

    Posted Feb 13, 2016 01:59 AM

    Senthil,

      Good to know this! Would you mind marking the original question as answered (currently its set to Not Answered)?

     

    Regards,

    Trinath



  • 8.  Re: Config JVM arguments

    Posted Feb 15, 2016 03:22 PM

    Hi Trinath

     

    The question is now updated as answered.

     

    Thanks so much.

    Senthil.



  • 9.  Re: Config JVM arguments

    Posted May 29, 2017 01:45 AM

    Hi Trinath,

     

    Can you pleas help in setting up App Dynamics with CA API Gateway. I dont have any idea how to start from scratch.

     

    Thanks

    Praty



  • 10.  Re: Config JVM arguments

    Posted Jan 11, 2018 07:55 AM

    Hello Folks !

     

    Here is the steps I did to Dynatrace agent

     

    Install Dynatrace agent on opt/dynatracexxx/ (*** is your dynatrace agent version)

     

    change the owner of your folder to gateway user 

     

    chown -R gateway:gateway opt/dynatracexxx/

     

    Go to /opt/SecureSpan/Gateway/runtime/etc/profile.d/

     

    and edit ssgruntimedefs.sh

     

    Add the line of Dynatrace as the sample bellow 

     

    # LAYER 7 TECHNOLOGIES
    # Defines JAVA_HOME, etc

    default_java_opts="-server "

    if [ ! -f "/etc/sysconfig/network" -o "$(grep "^NETWORKING_IPV6=yes" /etc/sysconfig/network 2>/dev/null)" ]
    then
    default_java_opts="$default_java_opts -Djava.net.preferIPv4Stack=false "
    else
    default_java_opts="$default_java_opts -Djava.net.preferIPv4Stack=true "
    fi
    default_java_opts="$default_java_opts -agentpath:/opt/dynatrace/agent/lib64/libdtagent.so=name=CAP_DES,server=yourDynatraceColectorServer :YourDynatraceColectorPort"
    default_java_opts="$default_java_opts -Djava.security.policy=${SSG_HOME}/runtime/etc/ssg.policy"
    default_java_opts="$default_java_opts -Djava.security.egd=file:/dev/./urandom"
    default_java_opts="$default_java_opts -Dfile.encoding=UTF-8 -Dsun.net.inetaddr.ttl=30 "
    default_java_opts="$default_java_opts -Djava.awt.headless=true -XX:CompileThreshold=1500 "
    default_java_opts="$default_java_opts -Dcom.l7tech.server.defaultClusterHostname=$(hostname)"
    default_java_opts="$default_java_opts -Djava.util.Arrays.useLegacyMergeSort=true"

    SSG_JAVA_OPTS="$SSG_JAVA_OPTS $default_java_opts";

    unset default_java_opts

    export SSG_JAVA_OPTS

    if ! echo $LD_LIBRARY_PATH | /bin/egrep -s "(^|:)$SSG_HOME/runtime/lib($|:)" >/dev/null ; then
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SSG_HOME/runtime/lib
    fi

    export LD_LIBRARY_PATH

     

    Save the file

     

    Back to Gateway menu and select option 2 and 7 press Enter after show the status like this sample bellow 

     

    ----------------------------------------------------------------------
    CA API Gateway Status
    ----------------------------------------------------------------------

    Configuration:
    Node Status = RUNNING
    Node Status Timestamp = 2018-01-11 10:46:09
    Node Status Since = 2018-01-10 20:33:13

    Press [Enter] to continue.

     

    and then select option 2 to restart the Gateway Service 

     

     

    CA API Gateway status options:

    1) Stop the CA API Gateway
    2) Restart the CA API Gateway
    X) Exit menu

    Please make a selection:

     

    I hope this steps help 

     

    Best Regards 



  • 11.  RE: Re: Config JVM arguments

    Posted Apr 01, 2020 07:43 AM
    Hello,

    I followed your specified steps to configure glowroot agent(APM agent) with Layer7.
    I first had a permission issue, I created a user.home/.java.policy file with following content to solve it:
    grant {
    permission java.util.PropertyPermission "glowroot.transaction.throwable.frame.limit", "read";
    permission java.lang.RuntimePermission "getClassLoader";
    permission java.util.PropertyPermission "glowroot.transaction.aux.thread.context.limit", "read";
    permission java.lang.management.ManagementPermission "monitor";
    };

    Now it's running but gives continous warning logs, both in Layer 7 and glowroot logs, any idea what's the cause of this and how to solve it?:
    2020-03-31 13:41:48.497 WARN o.g.agent.plugin.api.util.Reflection - error calling javax.servlet.http.HttpServletResponse.getStatus()
    java.lang.reflect.InvocationTargetException: null
    at sun.reflect.GeneratedMethodAccessor676.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glowroot.agent.plugin.api.util.Reflection.invokeWithDefault(Reflection.java:94)
    at org.glowroot.agent.plugin.servlet..ResponseInvoker.getStatus(ResponseInvoker.java:64)
    at org.glowroot.agent.plugin.servlet.ServletAspect$ServiceAdvice
    .onReturn(ServletAspect.java:88)
    at org.glowroot.agent.plugin.servlet.ServletAspect$DoFilterAdvice_.onReturn(ServletAspect.java:227)
    at com.l7tech.gateway.common.transport.http.FeatureFilter.doFilter(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:234)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:181)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at com.l7tech.server.tomcat.ResponseKillerValve.invoke(Unknown Source)
    at com.l7tech.server.tomcat.ConnectionIdValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:295)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:610)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:410)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.AbstractMethodError: org.apache.catalina.connector.ResponseFacade.getStatus()I
    ... 24 common frames omitted

    Kind regards,
    Bakkali Hicham