You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kay <go...@gmail.com> on 2020/06/05 09:05:17 UTC

Ignite node log file setup

Hello, I set up log4j2.xml and I found a create log file with sys:nodeId.

I configured grid name like 

cache-node-01, cache-node-02 using xml confiuration(property
name="igniteInstanceName" value="cache-node-01")

Is there any way to setup log file with grid name.

for example) ignite-cache-node-01.log

Thank you so much





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by kay <go...@gmail.com>.
Thank you so much!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

"""
In Spring syntax it will be #{systemProperties['gridName']}:

<property name="igniteInstanceName"
value="#{systemProperties['gridName']}"/>
"""

Regards,
-- 
Ilya Kasnacheev


ср, 1 июл. 2020 г. в 12:01, kay <go...@gmail.com>:

> Hello, I'm waiting for reply :)
>
> How can I set system property to use in ignite config file??
> I set and got a error so , attacted log file before..
>
> Thank you so much
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite node log file setup

Posted by kay <go...@gmail.com>.
Hello, I'm waiting for reply :)

How can I set system property to use in ignite config file??
I set and got a error so , attacted log file before..

Thank you so much



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by kay <go...@gmail.com>.
Hello, 

I excute

 sh ./ignite.sh -J-DgridName=testCache1-1 -v ./config/testCache1-1.xml

and attachted whloe log file.

Thank you testCache1-1.out
<http://apache-ignite-users.70518.x6.nabble.com/file/t2778/testCache1-1.out>  



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by Andrei Aleksandrov <ae...@gmail.com>.
Hi,

Can you please attach the whole log file?

BR,
Andrei

6/9/2020 5:14 AM, kay пишет:
> Hello!
>
> I start up
>
> sh ./ignite.sh -J-DgridName=testGridName -v ./config/config-cache.xml
>
> and in config-cache.xml
>
> <property name="igniteInstanceName" value="${sys:gridName}"/>
> but server start failed.
>
> Is that not proper to set igniteInstanceName??
>
> log is here
> class org.apache.ignite.IgniteException: Failed to start manager:
> GridManagerAdapter [enabled=true,
> name=org.apache.ignite.internal.managers.communication.GridIoManager]
>           at
> org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1067)
>           at org.apache.ignite.Ignition.start(Ignition.java:349)
>           at
> org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
>   Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
> manager: GridManagerAdapter [enabled=true,
> name=org.apache.ignite.internal.managers.communication.GridIoManager]
>           at
> org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1965)
>           at
> org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1173)
>           at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2038)
>           at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
>           at
> org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
>           at
> org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
>           at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
>           at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
>           at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
>           at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
>           at org.apache.ignite.Ignition.start(Ignition.java:346)
>           ... 1 more
>   Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
> SPI: TcpCommunicationSpi [connectGate=null,
> connPlc=org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$FirstConnectionPolicy@6622fc65,
> chConnPlc=org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$4@299321e2,
> enableForcibleNodeKill=false, enableTroubleshootingLog=false,
> locAddr=42.1.188.128, locHost=intdev01/42.1.188.128, locPort=48722,
> locPortRange=1, shmemPort=-1, directBuf=true, directSndBuf=false,
> idleConnTimeout=600000, connTimeout=5000, maxConnTimeout=600000,
> reconCnt=10, sockSndBuf=32768, sockRcvBuf=32768, msgQueueLimit=0,
> slowClientQueueLimit=0, nioSrvr=GridNioServer [selectorSpins=0,
> filterChain=FilterChain[filters=[GridNioCodecFilter
> [parser=org.apache.ignite.internal.util.nio.GridDirectParser@2f17e30d,
> directMode=true], GridConnectionBytesVerifyFilter], closed=false,
> directBuf=true, tcpNoDelay=true, sockSndBuf=32768, sockRcvBuf=32768,
> writeTimeout=2000, idleTimeout=600000, skipWrite=false, skipRead=false,
> locAddr=intdev01/42.1.188.128:48722, order=LITTLE_ENDIAN, sndQueueLimit=0,
> directMode=true,
> mreg=org.apache.ignite.internal.processors.metric.MetricRegistry@71cf1b07,
> rcvdBytesCntMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@a9be6fa5,
> sentBytesCntMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@489b09ce,
> outboundMessagesQueueSizeMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@69a257d1,
> sslFilter=null, msgQueueLsnr=null, readerMoveCnt=0, writerMoveCnt=0,
> readWriteSelectorsAssign=false], shmemSrv=null, usePairedConnections=false,
> connectionsPerNode=1, tcpNoDelay=true, filterReachableAddresses=false,
> ackSndThreshold=32, unackedMsgsBufSize=0, sockWriteTimeout=2000,
> boundTcpPort=48722, boundTcpShmemPort=-1, selectorsCnt=8, selectorSpins=0,
> addrRslvr=null,
> ctxInitLatch=java.util.concurrent.CountDownLatch@181e731e[Count = 1],
> stopping=false,
> metricsLsnr=org.apache.ignite.spi.communication.tcp.TcpCommunicationMetricsListener@19648c40]
>           at
> org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:300)
>           at
> org.apache.ignite.internal.managers.communication.GridIoManager.start(GridIoManager.java:435)
>           at
> org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1960)
>           ... 11 more
>   Caused by: class org.apache.ignite.spi.IgniteSpiException: Failed to
> register SPI MBean: null
>           at
> org.apache.ignite.spi.IgniteSpiAdapter.registerMBean(IgniteSpiAdapter.java:421)
>           at
> org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.spiStart(TcpCommunicationSpi.java:2397)
>           at
> org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:297)
>           ... 13 more
>   Caused by: javax.management.MalformedObjectNameException: Invalid character
> ':' in value part of property
>           at javax.management.ObjectName.construct(ObjectName.java:618)
>           at javax.management.ObjectName.<init>(ObjectName.java:1382)
>           at
> org.apache.ignite.internal.util.IgniteUtils.makeMBeanName(IgniteUtils.java:4719)
>           at
> org.apache.ignite.internal.util.IgniteUtils.registerMBean(IgniteUtils.java:4788)
>           at
> org.apache.ignite.spi.IgniteSpiAdapter.registerMBean(IgniteSpiAdapter.java:415)
>           ... 15 more
>   Failed to start grid: Failed to start manager: GridManagerAdapter
> [enabled=true,
> name=org.apache.ignite.internal.managers.communication.GridIoManager]
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by kay <go...@gmail.com>.
Hello!

I start up 

sh ./ignite.sh -J-DgridName=testGridName -v ./config/config-cache.xml

and in config-cache.xml 

<property name="igniteInstanceName" value="${sys:gridName}"/>
but server start failed.

Is that not proper to set igniteInstanceName?? 

log is here 
class org.apache.ignite.IgniteException: Failed to start manager:
GridManagerAdapter [enabled=true,
name=org.apache.ignite.internal.managers.communication.GridIoManager]
         at
org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1067)
         at org.apache.ignite.Ignition.start(Ignition.java:349)
         at
org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
 Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
manager: GridManagerAdapter [enabled=true,
name=org.apache.ignite.internal.managers.communication.GridIoManager]
         at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1965)
         at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1173)
         at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2038)
         at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1703)
         at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117)
         at
org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
         at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921)
         at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820)
         at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690)
         at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659)
         at org.apache.ignite.Ignition.start(Ignition.java:346)
         ... 1 more
 Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
SPI: TcpCommunicationSpi [connectGate=null,
connPlc=org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$FirstConnectionPolicy@6622fc65,
chConnPlc=org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$4@299321e2,
enableForcibleNodeKill=false, enableTroubleshootingLog=false,
locAddr=42.1.188.128, locHost=intdev01/42.1.188.128, locPort=48722,
locPortRange=1, shmemPort=-1, directBuf=true, directSndBuf=false,
idleConnTimeout=600000, connTimeout=5000, maxConnTimeout=600000,
reconCnt=10, sockSndBuf=32768, sockRcvBuf=32768, msgQueueLimit=0,
slowClientQueueLimit=0, nioSrvr=GridNioServer [selectorSpins=0,
filterChain=FilterChain[filters=[GridNioCodecFilter
[parser=org.apache.ignite.internal.util.nio.GridDirectParser@2f17e30d,
directMode=true], GridConnectionBytesVerifyFilter], closed=false,
directBuf=true, tcpNoDelay=true, sockSndBuf=32768, sockRcvBuf=32768,
writeTimeout=2000, idleTimeout=600000, skipWrite=false, skipRead=false,
locAddr=intdev01/42.1.188.128:48722, order=LITTLE_ENDIAN, sndQueueLimit=0,
directMode=true,
mreg=org.apache.ignite.internal.processors.metric.MetricRegistry@71cf1b07,
rcvdBytesCntMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@a9be6fa5,
sentBytesCntMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@489b09ce,
outboundMessagesQueueSizeMetric=org.apache.ignite.internal.processors.metric.impl.LongAdderMetric@69a257d1,
sslFilter=null, msgQueueLsnr=null, readerMoveCnt=0, writerMoveCnt=0,
readWriteSelectorsAssign=false], shmemSrv=null, usePairedConnections=false,
connectionsPerNode=1, tcpNoDelay=true, filterReachableAddresses=false,
ackSndThreshold=32, unackedMsgsBufSize=0, sockWriteTimeout=2000,
boundTcpPort=48722, boundTcpShmemPort=-1, selectorsCnt=8, selectorSpins=0,
addrRslvr=null,
ctxInitLatch=java.util.concurrent.CountDownLatch@181e731e[Count = 1],
stopping=false,
metricsLsnr=org.apache.ignite.spi.communication.tcp.TcpCommunicationMetricsListener@19648c40]
         at
org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:300)
         at
org.apache.ignite.internal.managers.communication.GridIoManager.start(GridIoManager.java:435)
         at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1960)
         ... 11 more
 Caused by: class org.apache.ignite.spi.IgniteSpiException: Failed to
register SPI MBean: null
         at
org.apache.ignite.spi.IgniteSpiAdapter.registerMBean(IgniteSpiAdapter.java:421)
         at
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.spiStart(TcpCommunicationSpi.java:2397)
         at
org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:297)
         ... 13 more
 Caused by: javax.management.MalformedObjectNameException: Invalid character
':' in value part of property
         at javax.management.ObjectName.construct(ObjectName.java:618)
         at javax.management.ObjectName.<init>(ObjectName.java:1382)
         at
org.apache.ignite.internal.util.IgniteUtils.makeMBeanName(IgniteUtils.java:4719)
         at
org.apache.ignite.internal.util.IgniteUtils.registerMBean(IgniteUtils.java:4788)
         at
org.apache.ignite.spi.IgniteSpiAdapter.registerMBean(IgniteSpiAdapter.java:415)
         ... 15 more
 Failed to start grid: Failed to start manager: GridManagerAdapter
[enabled=true,
name=org.apache.ignite.internal.managers.communication.GridIoManager]









--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

${sys:} can use any system property which exists in the JVM.

If you put your gridName (or consistentId) into system property, you can
refer to it from both Ignite configuration (xml or otherwise) and log4j2
configuration.

Regards,
-- 
Ilya Kasnacheev


пн, 8 июн. 2020 г. в 04:55, kay <go...@gmail.com>:

> Hello, Thank you for reply.
>
> I know that I can put the 'cache-node-01' into the filename.
>
> But I wanna use only 1 log4j2.xml.
>
> If I use  <RollingFile name="Rolling-${sys:nodeId}"
> fileName="${sys:IGNITE_HOME}/work/log/cache-node-01-${sys:nodeId}.log"
>
> like this, I should make log4j2.xml file each node.
> So I asked a question Is there any way to get gridName parameter in
> log4j2.xml like '${sys:nodeId}'
>
> ex) ${sys:gridName} or ${sys:igniteName}
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite node log file setup

Posted by kay <go...@gmail.com>.
Hello, Thank you for reply.

I know that I can put the 'cache-node-01' into the filename.

But I wanna use only 1 log4j2.xml.

If I use  <RollingFile name="Rolling-${sys:nodeId}"
fileName="${sys:IGNITE_HOME}/work/log/cache-node-01-${sys:nodeId}.log"

like this, I should make log4j2.xml file each node.
So I asked a question Is there any way to get gridName parameter in
log4j2.xml like '${sys:nodeId}'

ex) ${sys:gridName} or ${sys:igniteName}



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite node log file setup

Posted by akorensh <al...@gmail.com>.
Hi,
   Update the file appender, and put cache-node-01 into the filename 
property as below.

   
   <RollingFile name="Rolling-${sys:nodeId}"
fileName="${sys:IGNITE_HOME}/work/log/cache-node-01-${sys:nodeId}.log"
                                
filePattern="${sys:IGNITE_HOME}/work/log/cache-node-01-${sys:nodeId}-%i-%d{yyyy-MM-dd}.log.gz">


    Use env variables in your appenders, or re-config at run time as need
be.
     see: https://apacheignite.readme.io/docs/logging#log4j2

   You can also pro-grammatically create the log4j/logj2 config before
starting a grid, and put the grid name into the fileName property.

Thanks, Alex

  




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/