Log issue adding a java agent to SOLR_OPTS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Log issue adding a java agent to SOLR_OPTS

Jesús Roca
Hello,

I am trying to add a javaagent to monitor solr using a jmxtans agent. I am
using Solr version 7.7 and Java 8.

Basically I have added the following line at the end of my solr.in.sh:

SOLR_OPTS="$SOLR_OPTS
-javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"

After add that line Solr startup correctly, I can see with a ps command
that "-javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"
is added to the java process, and it send jmx metrics to my time series
database (InfluxDB), but it stop to write in solr.log log file and it start
to writes all the ouput in solr-<port>-console.log.

Any idea about this behaviour?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Log issue adding a java agent to SOLR_OPTS

Jesús Roca
Hello again!

It looks like due to the java agent, Solr don't mute logging to console:

[main] WARN org.apache.solr.util.StartupLoggingUtils - Could not mute
logging to console. Dynamic log manipulation currently only supported for
Log4j. Please consult your logging framework of choice on how to configure
the appropriate logging.

This is the startup log of an instance with Solr 7.6

2020-01-09 10:28:09.441 INFO [main] org.jmxtrans.agent.JmxTransAgent -
Starting 'JMX metrics exporter agent: 1.2.11-SNAPSHOT' with configuration
'/path/jmxtrans-agent-config.xml'...
2020-01-09 10:28:09.456 INFO [main] org.jmxtrans.agent.JmxTransAgent -
PropertiesLoader: Empty Properties Loader
[main] INFO org.apache.kafka.clients.producer.ProducerConfig -
ProducerConfig values:
        acks = 1
        batch.size = 16384
        block.on.buffer.full = false
        bootstrap.servers = [server1:XXXX, server2:XXXX, server3:XXXX]
        buffer.memory = 33554432
        client.id =
        compression.type = none
        connections.max.idle.ms = 540000
        interceptor.classes = null
        key.serializer = class
org.apache.kafka.common.serialization.StringSerializer
        linger.ms = 0
        max.block.ms = 60000
        max.in.flight.requests.per.connection = 5
        max.request.size = 1048576
        metadata.fetch.timeout.ms = 60000
        metadata.max.age.ms = 300000
        metric.reporters = []
        metrics.num.samples = 2
        metrics.sample.window.ms = 30000
        partitioner.class = class
org.apache.kafka.clients.producer.internals.DefaultPartitioner
        receive.buffer.bytes = 32768
        reconnect.backoff.ms = 50
        request.timeout.ms = 30000
        retries = 0
        retry.backoff.ms = 100
        sasl.jaas.config = null
        sasl.kerberos.kinit.cmd = /usr/bin/kinit
        sasl.kerberos.min.time.before.relogin = 60000
        sasl.kerberos.service.name = null
        sasl.kerberos.ticket.renew.jitter = 0.05
        sasl.kerberos.ticket.renew.window.factor = 0.8
        sasl.mechanism = GSSAPI
        security.protocol = PLAINTEXT
        send.buffer.bytes = 131072
        ssl.cipher.suites = null
        ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
        ssl.endpoint.identification.algorithm = null
        ssl.key.password = null
        ssl.keymanager.algorithm = SunX509
        ssl.keystore.location = null
        ssl.keystore.password = null
        ssl.keystore.type = JKS
        ssl.protocol = TLS
        ssl.provider = null
        ssl.secure.random.implementation = null
        ssl.trustmanager.algorithm = PKIX
        ssl.truststore.location = null
        ssl.truststore.password = null
        ssl.truststore.type = JKS
        timeout.ms = 30000
        value.serializer = class
org.apache.kafka.common.serialization.StringSerializer

[main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version :
0.10.2.1
[main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId :
e89bffd6b2eff799
2020-01-09 10:28:10.0 INFO [main] org.jmxtrans.agent.JmxTransExporter -
Configuration reload interval: 15secs
2020-01-09 10:28:10.001 INFO [main] org.jmxtrans.agent.JmxTransAgent -
JmxTransAgent started with configuration '/path/jmxtrans-agent-config.xml'
[main] INFO org.eclipse.jetty.util.log - Logging initialized @1126ms to
org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.apache.solr.util.configuration.SSLCredentialProviderFactory
- Processing SSL Credential Provider chain: env;sysprop
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.11.v20180605;
built: 2018-06-05T18:24:03.829Z; git:
d5fc0523cfa96bfebfbda19606cad384d772f04c; jvm 1.8.0_222-b10
[main] INFO org.eclipse.jetty.deploy.providers.ScanningAppProvider -
Deployment monitor [file:///path/solr/server/contexts/] at interval 0
[main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP
Support for /solr, did not find org.apache.jasper.servlet.JspServlet
[main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager
workerName=node0
[main] INFO org.eclipse.jetty.server.session - No SessionScavenger set,
using defaults
[main] INFO org.eclipse.jetty.server.session - node0 Scavenging every
600000ms
[main] INFO org.apache.solr.util.configuration.SSLCredentialProviderFactory
- Processing SSL Credential Provider chain: env;sysprop
[main] INFO org.apache.solr.util.configuration.SSLConfigurations - Setting
javax.net.ssl.keyStorePassword
[main] INFO org.apache.solr.util.configuration.SSLConfigurations - Setting
javax.net.ssl.trustStorePassword
[main] INFO org.apache.solr.servlet.SolrDispatchFilter - Using logger
factory org.slf4j.impl.SimpleLoggerFactory
[main] INFO org.apache.solr.servlet.SolrDispatchFilter -  ___      _
Welcome to Apache Solr™ version 7.6.0
[main] INFO org.apache.solr.servlet.SolrDispatchFilter - / __| ___| |_ _
Starting in cloud mode on port 8983
[main] INFO org.apache.solr.servlet.SolrDispatchFilter - \__ \/ _ \ | '_|
 Install dir: /path/solr
[main] INFO org.apache.solr.servlet.SolrDispatchFilter - |___/\___/_|_|
 Start time: 2020-01-09T10:28:11.500Z
[main] WARN org.apache.solr.util.StartupLoggingUtils - Could not mute
logging to console. Dynamic log manipulation currently only supported for
Log4j. Please consult your logging framework of choice on how to configure
the appropriate logging.
[main] INFO org.apache.solr.core.SolrResourceLoader - Using system property
solr.solr.home:

Do you know how could I fix this?

Thanks and BR.


El mié., 8 ene. 2020 a las 0:02, Jesús Roca (<[hidden email]>) escribió:

> Hello,
>
> I am trying to add a javaagent to monitor solr using a jmxtans agent. I am
> using Solr version 7.7 and Java 8.
>
> Basically I have added the following line at the end of my solr.in.sh:
>
> SOLR_OPTS="$SOLR_OPTS
> -javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"
>
> After add that line Solr startup correctly, I can see with a ps command
> that "-javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"
> is added to the java process, and it send jmx metrics to my time series
> database (InfluxDB), but it stop to write in solr.log log file and it start
> to writes all the ouput in solr-<port>-console.log.
>
> Any idea about this behaviour?
>
> Thanks in advance.
>
Reply | Threaded
Open this post in threaded view
|

Re: Log issue adding a java agent to SOLR_OPTS

Jan Høydahl / Cominvent
So probably you need to tweak your log4j2.xml configuration to explicitly log to file?

Jan

> 9. jan. 2020 kl. 11:58 skrev Jesús Roca <[hidden email]>:
>
> Hello again!
>
> It looks like due to the java agent, Solr don't mute logging to console:
>
> [main] WARN org.apache.solr.util.StartupLoggingUtils - Could not mute
> logging to console. Dynamic log manipulation currently only supported for
> Log4j. Please consult your logging framework of choice on how to configure
> the appropriate logging.
>
> This is the startup log of an instance with Solr 7.6
>
> 2020-01-09 10:28:09.441 INFO [main] org.jmxtrans.agent.JmxTransAgent -
> Starting 'JMX metrics exporter agent: 1.2.11-SNAPSHOT' with configuration
> '/path/jmxtrans-agent-config.xml'...
> 2020-01-09 10:28:09.456 INFO [main] org.jmxtrans.agent.JmxTransAgent -
> PropertiesLoader: Empty Properties Loader
> [main] INFO org.apache.kafka.clients.producer.ProducerConfig -
> ProducerConfig values:
>        acks = 1
>        batch.size = 16384
>        block.on.buffer.full = false
>        bootstrap.servers = [server1:XXXX, server2:XXXX, server3:XXXX]
>        buffer.memory = 33554432
>        client.id =
>        compression.type = none
>        connections.max.idle.ms = 540000
>        interceptor.classes = null
>        key.serializer = class
> org.apache.kafka.common.serialization.StringSerializer
>        linger.ms = 0
>        max.block.ms = 60000
>        max.in.flight.requests.per.connection = 5
>        max.request.size = 1048576
>        metadata.fetch.timeout.ms = 60000
>        metadata.max.age.ms = 300000
>        metric.reporters = []
>        metrics.num.samples = 2
>        metrics.sample.window.ms = 30000
>        partitioner.class = class
> org.apache.kafka.clients.producer.internals.DefaultPartitioner
>        receive.buffer.bytes = 32768
>        reconnect.backoff.ms = 50
>        request.timeout.ms = 30000
>        retries = 0
>        retry.backoff.ms = 100
>        sasl.jaas.config = null
>        sasl.kerberos.kinit.cmd = /usr/bin/kinit
>        sasl.kerberos.min.time.before.relogin = 60000
>        sasl.kerberos.service.name = null
>        sasl.kerberos.ticket.renew.jitter = 0.05
>        sasl.kerberos.ticket.renew.window.factor = 0.8
>        sasl.mechanism = GSSAPI
>        security.protocol = PLAINTEXT
>        send.buffer.bytes = 131072
>        ssl.cipher.suites = null
>        ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
>        ssl.endpoint.identification.algorithm = null
>        ssl.key.password = null
>        ssl.keymanager.algorithm = SunX509
>        ssl.keystore.location = null
>        ssl.keystore.password = null
>        ssl.keystore.type = JKS
>        ssl.protocol = TLS
>        ssl.provider = null
>        ssl.secure.random.implementation = null
>        ssl.trustmanager.algorithm = PKIX
>        ssl.truststore.location = null
>        ssl.truststore.password = null
>        ssl.truststore.type = JKS
>        timeout.ms = 30000
>        value.serializer = class
> org.apache.kafka.common.serialization.StringSerializer
>
> [main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version :
> 0.10.2.1
> [main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId :
> e89bffd6b2eff799
> 2020-01-09 10:28:10.0 INFO [main] org.jmxtrans.agent.JmxTransExporter -
> Configuration reload interval: 15secs
> 2020-01-09 10:28:10.001 INFO [main] org.jmxtrans.agent.JmxTransAgent -
> JmxTransAgent started with configuration '/path/jmxtrans-agent-config.xml'
> [main] INFO org.eclipse.jetty.util.log - Logging initialized @1126ms to
> org.eclipse.jetty.util.log.Slf4jLog
> [main] INFO org.apache.solr.util.configuration.SSLCredentialProviderFactory
> - Processing SSL Credential Provider chain: env;sysprop
> [main] INFO org.eclipse.jetty.server.Server - jetty-9.4.11.v20180605;
> built: 2018-06-05T18:24:03.829Z; git:
> d5fc0523cfa96bfebfbda19606cad384d772f04c; jvm 1.8.0_222-b10
> [main] INFO org.eclipse.jetty.deploy.providers.ScanningAppProvider -
> Deployment monitor [file:///path/solr/server/contexts/] at interval 0
> [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP
> Support for /solr, did not find org.apache.jasper.servlet.JspServlet
> [main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager
> workerName=node0
> [main] INFO org.eclipse.jetty.server.session - No SessionScavenger set,
> using defaults
> [main] INFO org.eclipse.jetty.server.session - node0 Scavenging every
> 600000ms
> [main] INFO org.apache.solr.util.configuration.SSLCredentialProviderFactory
> - Processing SSL Credential Provider chain: env;sysprop
> [main] INFO org.apache.solr.util.configuration.SSLConfigurations - Setting
> javax.net.ssl.keyStorePassword
> [main] INFO org.apache.solr.util.configuration.SSLConfigurations - Setting
> javax.net.ssl.trustStorePassword
> [main] INFO org.apache.solr.servlet.SolrDispatchFilter - Using logger
> factory org.slf4j.impl.SimpleLoggerFactory
> [main] INFO org.apache.solr.servlet.SolrDispatchFilter -  ___      _
> Welcome to Apache Solr™ version 7.6.0
> [main] INFO org.apache.solr.servlet.SolrDispatchFilter - / __| ___| |_ _
> Starting in cloud mode on port 8983
> [main] INFO org.apache.solr.servlet.SolrDispatchFilter - \__ \/ _ \ | '_|
> Install dir: /path/solr
> [main] INFO org.apache.solr.servlet.SolrDispatchFilter - |___/\___/_|_|
> Start time: 2020-01-09T10:28:11.500Z
> [main] WARN org.apache.solr.util.StartupLoggingUtils - Could not mute
> logging to console. Dynamic log manipulation currently only supported for
> Log4j. Please consult your logging framework of choice on how to configure
> the appropriate logging.
> [main] INFO org.apache.solr.core.SolrResourceLoader - Using system property
> solr.solr.home:
>
> Do you know how could I fix this?
>
> Thanks and BR.
>
>
> El mié., 8 ene. 2020 a las 0:02, Jesús Roca (<[hidden email]>) escribió:
>
>> Hello,
>>
>> I am trying to add a javaagent to monitor solr using a jmxtans agent. I am
>> using Solr version 7.7 and Java 8.
>>
>> Basically I have added the following line at the end of my solr.in.sh:
>>
>> SOLR_OPTS="$SOLR_OPTS
>> -javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"
>>
>> After add that line Solr startup correctly, I can see with a ps command
>> that "-javaagent:/path/jmxtrans-agent.jar=/path/jmxtrans-agent-config.xml"
>> is added to the java process, and it send jmx metrics to my time series
>> database (InfluxDB), but it stop to write in solr.log log file and it start
>> to writes all the ouput in solr-<port>-console.log.
>>
>> Any idea about this behaviour?
>>
>> Thanks in advance.
>>