title: SharedRDD code for ignite works on setup of single server but fails with exception when additional server added
body: <p>I have 2 server nodes running collocated with spark worker. I am using shared ignite RDD to save my dataframe. My code works fine when I work with only one server node stared, if I start both server nodes code fails with </p>
  
  <p><strong>Grid is in invalid state to perform this operation. It either not started yet or has already being or have stopped [gridName=null, state=STOPPING]</strong></p>
  
  <p>DiscoverySpi is configured as below</p>
  
  <pre><code>&lt;property name="discoverySpi"&gt;
          &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"&gt;
              &lt;property name="ipFinder"&gt;
                  &lt;!--
                      Ignite provides several options for automatic discovery that can be used
                      instead os static IP based discovery. For information on all options refer
                      to our documentation: http://apacheignite.readme.io/docs/cluster-config
                  --&gt;
                  &lt;!-- Uncomment static IP finder to enable static-based discovery of initial nodes. --&gt;
                  &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"&gt;
  
                  &lt;!--&lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"&gt;--&gt;
             &lt;property name="shared" value="true"/&gt;
  
                      &lt;property name="addresses"&gt;
                          &lt;list&gt;
                              &lt;!-- In distributed environment, replace with actual host IP address. --&gt;
                              &lt;value&gt;v-in-spark-01:47500..47509&lt;/value&gt;
              &lt;value&gt;v-in-spark-02:47500..47509&lt;/value&gt;
                          &lt;/list&gt;
                      &lt;/property&gt;
                  &lt;/bean&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>I know this exception generally means ignite instanace either not started or stopped and operation tried with same, but I don't think this is the case for reasons that with single server node it works fine and also I am not explicitly closing ignite instance in my program.</p>
  
  <p>Also in my code flow I do perform operations in transaction which works, so it is like</p>
  
  <ol>
  <li>create cache1 : works fine </li>
  <li>Create cache2 : works fine </li>
  <li>put value in cache1 ; works fine </li>
  <li>igniteRDD.saveValues on cache2 : This step failes with above mentioned exception.</li>
  </ol>
  
  <p><a href="http://pastebin.com/raw/EzzKE5mU" rel="nofollow noreferrer"><strong>USE this link for complete error trace</strong></a>
  caused by part is pasted below here also</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Grid is in invalid state to perform this operation. It either not started yet or has already being or have stopped [gridName=null, state=STOPPING]
        at org.apache.ignite.internal.GridKernalGatewayImpl.illegalState(GridKernalGatewayImpl.java:190)
        at org.apache.ignite.internal.GridKernalGatewayImpl.readLock(GridKernalGatewayImpl.java:90)
        at org.apache.ignite.internal.IgniteKernal.guard(IgniteKernal.java:3151)
        at org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2739)
        at org.apache.ignite.spark.impl.IgniteAbstractRDD.ensureCache(IgniteAbstractRDD.scala:39)
        at org.apache.ignite.spark.IgniteRDD$$anonfun$saveValues$1.apply(IgniteRDD.scala:164)
        at org.apache.ignite.spark.IgniteRDD$$anonfun$saveValues$1.apply(IgniteRDD.scala:161)
        at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$28.apply(RDD.scala:883)
        at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$28.apply(RDD.scala:883)
        at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1897)
        at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1897)
        at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
        at org.apache.spark.scheduler.Task.run(Task.scala:85)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
        ... 3 more&lt;/pre&gt;
  </code></pre>