Hello Anand, Ignite configuration is not reusable, because SPI stores data in internal fields. You can made copy of configuration before first start of Ignite instance.
I see a solution do it, using Spring scope bean attribute (if youuse Spring configuration) like this: <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" *scope="prototype"*> On Sun, Aug 28, 2016 at 7:19 PM, Anand Kumar Sankaran < [email protected]> wrote: > Hi > > > > I am coding a segmentation resolver that’s restarting Ignite in the case > of a Segmentation Event. > > > > I copy the current Ignite Configuration and use it to start a new Ignite. > > > > this.ignite.close(); > > > > final org.apache.ignite.configuration.IgniteConfiguration copy = new > org.apache.ignite.configuration.IgniteConfiguration(this.config); > > > > this.ignite = Ignition.*start*(copy); > > > > > > This still fails with the following message: > > > > java.lang.IllegalStateException: SPI has already been started (always > create new configuration instance for each starting Ignite instances) > [spi=TcpCommunicationSpi [connectGate=org.apache. > ignite.spi.communication.tcp.TcpCommunicationSpi$ConnectGateway@7106a8d2, > srvLsnr=org.apache.ignite.spi.communication.tcp. > TcpCommunicationSpi$2@240b62af, locAddr=null, locHost=0.0.0.0/0.0.0.0, > locPort=16500, locPortRange=50, shmemPort=-1, directBuf=true, > directSndBuf=false, idleConnTimeout=30000, connTimeout=5000, > maxConnTimeout=600000, reconCnt=10, sockSndBuf=32768, sockRcvBuf=32768, > msgQueueLimit=1024, slowClientQueueLimit=0, nioSrvr=null, shmemSrv=null, > tcpNoDelay=true, ackSndThreshold=16, unackedMsgsBufSize=0, > sockWriteTimeout=2000, lsnr=null, boundTcpPort=-1, boundTcpShmemPort=-1, > selectorsCnt=2, addrRslvr=null, rcvdMsgsCnt=103, sentMsgsCnt=105, > rcvdBytesCnt=134129, sentBytesCnt=214242, ctxInitLatch=java.util. > concurrent.CountDownLatch@6bc31a98[Count = 0], stopping=true, > metricsLsnr=org.apache.ignite.spi.communication.tcp. > TcpCommunicationSpi$3@57e640a9]] > > at org.apache.ignite.spi.IgniteSpiAdapter.onBeforeStart( > IgniteSpiAdapter.java:129) > > at org.apache.ignite.internal.managers.GridManagerAdapter. > startSpi(GridManagerAdapter.java:217) > > at org.apache.ignite.internal.managers.communication. > GridIoManager.start(GridIoManager.java:243) > > at org.apache.ignite.internal.IgniteKernal.startManager( > IgniteKernal.java:1478) > > at org.apache.ignite.internal.IgniteKernal.start( > IgniteKernal.java:828) > > at org.apache.ignite.internal.IgnitionEx$ > IgniteNamedInstance.start0(IgnitionEx.java:1740) > > at org.apache.ignite.internal.IgnitionEx$ > IgniteNamedInstance.start(IgnitionEx.java:1590) > > at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx. > java:1043) > > at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx. > java:570) > > at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx. > java:517) > > at org.apache.ignite.Ignition.start(Ignition.java:322) > > > > > > How can I restart an Ignite with the same configuration in such a case? > > > > -- > > anand > -- Vladislav Pyatkov
