General Questions

Expand all | Collapse all

TO start multiple nodes on the same host using the grid gain community edition

  • 1.  TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-19-2019 12:29 PM
    Is it possible to start multiple nodes on the same host using the grid gain community edition? If yes guide me configurations to change where should I change the port numbers and node configurations for each node ? 

    Thank you

    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------


  • 2.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-20-2019 03:04 AM
    Hello!

    The defaults are so that you can start multiple nodes right away without any reconfiguration. The only limitations is that you should set a different IgniteInstanceName, and should not reuse IgniteConfiguration object:

    So it's as easy as:
    Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s1");
    Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s2"));
    Ignition.start(new IgniteConfiguration().setIgniteInstanceName("s3"));

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 3.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-20-2019 07:45 AM
    IIya,
    should I configure the above statements in config or xml file ? where can I run the above commands? 

    I appreciate your time and efforts 
    Let me know.

    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------



  • 4.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-20-2019 08:11 AM
    IIya,
    Sorry my bad. I was looking to add 2 or 3 clusters on the same host not nodes. can we do it on with community version of grid gain. If yes , let me know, where should I add and configure the multi cluster environment with grid gain, when I try adding with below configuration : 
    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
    <!--Explicitly configure TCP discovery SPI to provide list of initial nodes from the first cluster.-->
    <property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
    <!-- Initial local port to listen to. -->
    <property name="localPort" value="48500"/>
    <!-- Changing local port range. This is an optional action. -->
    <property name="localPortRange" value="20"/>
    <!-- Setting up IP finder for this cluster -->
    <property name="ipFinder">
    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
    <property name="addresses">
    <list>
    <!--Addresses and port range of the nodes from the first cluster.127.0.0.1 can be replaced with actual IP addresses or host names. Port range is optional.-->
    <value>ip:48500..48520</value>
    </list>
    </property>
    </bean>
    </property>
    </bean>
    </property>

    <!-- Explicitly configure TCP communication SPI changing local
    port number for the nodes from the first cluster.-->
    <property name="communicationSpi">
    <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
    <property name="localPort" value="48100"/>
    </bean>
    </property>
    </bean>

    I am getting following error: 
    Ignite Command Line Startup, ver. 8.7.6#20190704-sha1:6449a674
    2019 Copyright(C) Apache Software Foundation

    class org.apache.ignite.IgniteException: Failed to instantiate Spring XML application context [springUrl=file:/ignite/gridgain-community-8.7.6/config/node1-config.xml, err=Line 1 in XML document from URL [file:/ignite/gridgain-community-8.7.6/config/node1-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 67; cvc-elt.1: Cannot find the declaration of element 'bean'.]
    at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1052)
    at org.apache.ignite.Ignition.start(Ignition.java:350)
    at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:300)
    Caused by: class org.apache.ignite.IgniteCheckedException: Failed to instantiate Spring XML application context [springUrl=file:/ignite/gridgain-community-8.7.6/config/node1-config.xml, err=Line 1 in XML document from URL [file:/ignite/gridgain-community-8.7.6/config/node1-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 67; cvc-elt.1: Cannot find the declaration of element 'bean'.]
    at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:391)
    at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:103)
    at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:97)
    at org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:750)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:951)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:860)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:730)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:699)
    at org.apache.ignite.Ignition.start(Ignition.java:347)
    ... 1 more
    Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from URL [file:/ignite/gridgain-community-8.7.6/config/node1-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 67; cvc-elt.1: Cannot find the declaration of element 'bean'.
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
    at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:378)
    ... 9 more
    Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 67; cvc-elt.1: Cannot find the declaration of element 'bean'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1900)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
    ... 12 more
    Failed to start grid: Failed to instantiate Spring XML application context [springUrl=file:/ignite/gridgain-community-8.7.6/config/node1-config.xml, err=Line 1 in XML document from URL [file:/ignite/gridgain-community-8.7.6/config/node1-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 67; cvc-elt.1: Cannot find the declaration of element 'bean'.]


    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------



  • 5.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-21-2019 02:03 AM
    Hello!

    First of all, I think you should fix your XML. I recommend copying over config/default-config.xml and modifying it. Root element should be <beans> with properly defined XML namespaces - that's Spring requirement.

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 6.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-21-2019 11:08 AM
    Hi IIya,
    For building the multiple clusters on the same host. Do I need to pass the multiple static IPs for mulitple cluster configuration in a single xml file or multiple xml files?. Having said that I was able to start single cluster with following below configuration but was not able to start other 2 clusters parallely.  I have changed the xml change as below and it worked:  
    <?xml version="1.0" encoding="UTF-8"?>

    <!-- This file was generated by Ignite Web Console (08/20/2019, 13:52) -->

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/util
    http://www.springframework.org/schema/util/spring-util.xsd">
    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="igniteInstanceName" value="cluster3"/>
    <property name="localHost" value="xx.xx.xx.xxxx"/>

    <property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
    <property name="ipFinder">
    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
    <property name="addresses">
    <list>
    <value>xxxxxxxxxx:47500..47510</value>
    </list>
    </property>
    </bean>
    </property>
    </bean>
    </property>

    <property name="clientConnectorConfiguration">
    <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
    <property name="host" value="xxxxx.com"/>
    <property name="port" value="10801"/>
    </bean>
    </property>

    <property name="dataStorageConfiguration">
    <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
    <property name="defaultDataRegionConfiguration">
    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
    <property name="maxSize" value="3221225472"/>
    </bean>
    </property>
    </bean>
    </property>
    </bean>
    </beans>

    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------



  • 7.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-22-2019 02:06 AM
    Hello!

    How many XML files you have is not completely relevant, it's a matter of structuring on your side.

    If you want to have several distinct clusters, make sure they use different port ranges (start + length) in their Discovery configurations. Other ports may need adjusting as well. Make sure that every cluster can discover several its nodes, to avoid situation where a single node failure will make cluster non-discoverable.

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 8.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-22-2019 08:46 AM
    Edited by kumar Pinumalla 08-22-2019 08:47 AM

    IIya,
    I have made sure I use different ports for each cluster on the same host but the first cluster successfully kick in but cluster 2, cluster 3 fails with below error: 
    [12:20:01] Failed to connect to any address from IP finder (make sure IP finder addresses are correct and firewalls are disabled on all host machines): [xxxxxxxxxxxxxxxx.com/xxxx:49500, xxxssss.com/xx.xx.xx.xx:49501, xxxssss.com/xx.xx.xx.xx:49502, xxxssss.com/xx.xx.xx.xx:49503, xxxssss.com/xx.xx.xx.xx:49504, xxxssss.com/xx.xx.xx.xx:49505, xxxssss.com/xx.xx.xx.xx:49506, xxxssss.com/xx.xx.xx.xx:49507, xxxssss.com/xx.xx.xx.xx:49508, xxxssss.com/xx.xx.xx.xx:49509, xxxssss.com/xx.xx.xx.xx:49510]
    [12:20:02] Failed to connect to any address from IP finder (make sure IP finder addresses are correct and firewalls are disabled on all host machines): [xxxssss.com/xx.xx.xx.xx:48500, xxxssss.com/xx.xx.xx.xx:48501, xxxssss.com/xx.xx.xx.xx:48502, xxxssss.com/xx.xx.xx.xx:48503, xxxssss.com/xx.xx.xx.xx:48504, xxxssss.com/xx.xx.xx.xx:48505, xxxssss.com/xx.xx.xx.xx:48506, xxxssss.com/xx.xx.xx.xx:48507, xxxssss.com/xx.xx.xx.xx:48508, xxxssss.com/xx.xx.xx.xx:48509, xxxssss.com/xx.xx.xx.xx:48510]

    how do I fix cluster server ports were 2 and 3 rd cluster are 49500 - 49510 and 48500 -48510.? 

    I have double checked if there are no firewall issues. 
    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------



  • 9.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-22-2019 08:53 AM
    Hello!

    To start, node needs to discover itself. I think the following should help (in Discovery SPI config):
    <property name="localAddress" value="xx.xxx.xx.xx"/>
    <property name="localPort" value="49500"/> <!-- will vary per cluster -->

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 10.  RE: TO start multiple nodes on the same host using the grid gain community edition

    Posted 08-26-2019 08:53 AM
    It worked for me. 

    Thanks

    ------------------------------
    kumar Pinumalla
    Data Engineer
    MES,Inc.
    2038098670
    ------------------------------



Would you attend a July Meetup?


Announcements