Local node is not added in baseline topology

classic Classic list List threaded Threaded
12 messages Options
Ali Bagewadi Ali Bagewadi
Reply | Threaded
Open this post in threaded view
|

Local node is not added in baseline topology

Hello,

I have below scenario

1)I have two server nodes i.e one on local machine and one on remote host.
2)When I start the first node the local node is added in the Baseline
topology:Here adc1c71b-c21b-47aa-8be6-6fa5ebaaa035 is the local node.

Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2

3)However when I start the second node on remote host the local node is not
included in the Baseline Topology.As per my observance the joining node
faces this problem.(Here the local node is
5a9f4e0d-fba3-4786-aa61-936d2f207333 which is not included in baseline
topology)
Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2
Number of other nodes: 1


4)Everything works fine when I add the local node using control.sh add
command.

5)As you suggested  I tried using auto adjust feature but the node is still
not added to baseline topology.

Cluster state: active
Current topology version: 2
Baseline auto adjustment enabled: softTimeout=5000
Baseline auto-adjust are not scheduled

Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2
Number of other nodes: 1
Command [BASELINE] finished with code: 0
Control utility has completed execution at: 2020-08-11T19:35:54.746204
Execution time: 1078 ms

So i am looking for the clarification for below queries:

1)Why is auto adjustment not adding the nodes available to baseline
topology.

2)Is there any api in C++ to get the node names so that I can trigger
control.sh --baseline add from the code.

Thankyou,
Ali.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
rakshita04 rakshita04
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

How to achieve the same using C++?
Are there any cluster APIs for C++?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello!

You can use control.sh. It can look up nodes as well as add them to baseline.


Unfortunately I did not see your commands so I can't know for sure. I'm not sure that auto-adjust will work for nodes added prior to enabling it.

Regards,
--
Ilya Kasnacheev


чт, 13 авг. 2020 г. в 10:17, rakshita04 <[hidden email]>:
How to achieve the same using C++?
Are there any cluster APIs for C++?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ali Bagewadi Ali Bagewadi
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello,
Thanks for the response.
However m requirements are
1)I don't want to add the nodes manually using control script as it is not
feasible to get the node id at runtime on hardware as per my requirements.
2)I have used the auto adjust command but its unable to add the local node
to baseline topology.

And Currently I am using below commands to add a node to baseline topology
and auto adjust respectively.

control.sh --baseline add consistentID
control.sh --baseline auto_adjust enable timeout 5000

Please suggest.

Thank you,
Ali



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello!

Does it happen every time (adding local node not working)? If so, can you please share exact steps to reproduce?

Regards,
--
Ilya Kasnacheev


чт, 13 авг. 2020 г. в 15:17, Ali Bagewadi <[hidden email]>:
Hello,
Thanks for the response.
However m requirements are
1)I don't want to add the nodes manually using control script as it is not
feasible to get the node id at runtime on hardware as per my requirements.
2)I have used the auto adjust command but its unable to add the local node
to baseline topology.

And Currently I am using below commands to add a node to baseline topology
and auto adjust respectively.

control.sh --baseline add consistentID
control.sh --baseline auto_adjust enable timeout 5000

Please suggest.

Thank you,
Ali



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ali Bagewadi Ali Bagewadi
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello,
Yes the local node(joining node) is left out everytime from baseline
topology.
I have mentioned steps to reproduce it.Also I have attached config files and
C++ code used to start ignite.

1)I have two server nodes i.e one on local machine and one on remote host.
2)When I start the first node the local node is added in the Baseline
topology:Here adc1c71b-c21b-47aa-8be6-6fa5ebaaa035 is the local node.

Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2

3)However when I start the second node on remote host the local node is not
included in the Baseline Topology.As per my observance the joining node
faces this problem.(Here the local node is
5a9f4e0d-fba3-4786-aa61-936d2f207333 which is not included in baseline
topology)
Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2
Number of other nodes: 1


4)Everything works fine when I add the local node using control.sh add
command.

We are using Apache Ignite with C++.Below is the snippet of starting ignite
from C++ code.
IgniteConfiguration cfg;
    cfg.springCfgPath = std::string("/home/dsudev/DataBaseConfig.xml");

    /* Start a node to access DataBase */
    Ignite node = Ignition::Start(cfg);
    node.SetActive(true);

    /* Get cache instance */
    mCache = node.GetOrCreateCache<tKey, DBStorage>(CACHE_NAME);
       
Below are the config files:

Config file for local node:

<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 id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
       
        <property name="peerClassLoadingEnabled" value="true"/>
     
     
       <property name="dataStorageConfiguration">
           <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
               <property name="defaultDataRegionConfiguration">
                   <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                           <property name="persistenceEnabled"
value="true"/>
                           <property name="initialSize" value="#{100L * 1024
* 1024}"/>
                           <property name="maxSize" value="#{400L * 1024 *
1024}"/>
                   </bean>
               </property>
           <property name="pageSize" value="#{4 * 1024}"/>
           <property name="storagePath"
value="/media/linux_hdd/keymanagementdata"/>
           <property name="walPath"
value="/media/linux_hdd/keymanagementdata/db/wal"/>
           <property name="walArchivePath"
value="/media/linux_hdd/keymanagementdata/db/wal/archive"/>
           </bean>
       </property>

        <property name="cacheConfiguration">
            <bean
class="org.apache.ignite.configuration.CacheConfiguration">
               
                <property name="name" value="DSU_DataBase"/>
               
                <property name="cacheMode" value="REPLICATED"/>
               
            </bean>
        </property>


       
        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                   
                   
                   
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                               
                                <value>127.0.0.1</value>
                                <value>192.168.111.112:7912</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>


Config file for remote node:


<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 id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
       
        <property name="peerClassLoadingEnabled" value="true"/>
     
     
       <property name="dataStorageConfiguration">
           <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
               <property name="defaultDataRegionConfiguration">
                   <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                           <property name="persistenceEnabled"
value="true"/>
                           <property name="initialSize" value="#{100L * 1024
* 1024}"/>
                           <property name="maxSize" value="#{400L * 1024 *
1024}"/>
                   </bean>
               </property>
           <property name="pageSize" value="#{4 * 1024}"/>
           <property name="storagePath"
value="/media/linux_hdd/keymanagementdata"/>
           <property name="walPath"
value="/media/linux_hdd/keymanagementdata/db/wal"/>
           <property name="walArchivePath"
value="/media/linux_hdd/keymanagementdata/db/wal/archive"/>
           </bean>
       </property>

        <property name="cacheConfiguration">
            <bean
class="org.apache.ignite.configuration.CacheConfiguration">
               
                <property name="name" value="DSU_DataBase"/>
               
                <property name="cacheMode" value="REPLICATED"/>
               
            </bean>
        </property>


       
        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                   
                   
                   
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                               
                                <value>127.0.0.1</value>
                                <value>192.168.111.111:7912</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Thank you,
Ali.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello!

I do not recommend doing activation right away after every node startup. It is a known anti-pattern. Please try removing this line, doing activation via control.sh.

Regards,
--
Ilya Kasnacheev


вт, 18 авг. 2020 г. в 08:01, Ali Bagewadi <[hidden email]>:
Hello,
Yes the local node(joining node) is left out everytime from baseline
topology.
I have mentioned steps to reproduce it.Also I have attached config files and
C++ code used to start ignite.

1)I have two server nodes i.e one on local machine and one on remote host.
2)When I start the first node the local node is added in the Baseline
topology:Here adc1c71b-c21b-47aa-8be6-6fa5ebaaa035 is the local node.

Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2

3)However when I start the second node on remote host the local node is not
included in the Baseline Topology.As per my observance the joining node
faces this problem.(Here the local node is
5a9f4e0d-fba3-4786-aa61-936d2f207333 which is not included in baseline
topology)
Current topology version: 2 (Coordinator:
ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, Order=1)

Baseline nodes:
    ConsistentId=adc1c71b-c21b-47aa-8be6-6fa5ebaaa035, State=ONLINE, Order=1
--------------------------------------------------------------------------------
Number of baseline nodes: 1

Other nodes:
    ConsistentId=5a9f4e0d-fba3-4786-aa61-936d2f207333, Order=2
Number of other nodes: 1


4)Everything works fine when I add the local node using control.sh add
command.

We are using Apache Ignite with C++.Below is the snippet of starting ignite
from C++ code.
IgniteConfiguration cfg;
    cfg.springCfgPath = std::string("/home/dsudev/DataBaseConfig.xml");

    /* Start a node to access DataBase */
    Ignite node = Ignition::Start(cfg);
    node.SetActive(true);

    /* Get cache instance */
    mCache = node.GetOrCreateCache<tKey, DBStorage>(CACHE_NAME);

Below are the config files:

Config file for local node:

<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 id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">

        <property name="peerClassLoadingEnabled" value="true"/>


       <property name="dataStorageConfiguration">
           <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
               <property name="defaultDataRegionConfiguration">
                   <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                           <property name="persistenceEnabled"
value="true"/>
                           <property name="initialSize" value="#{100L * 1024
* 1024}"/>
                           <property name="maxSize" value="#{400L * 1024 *
1024}"/>
                   </bean>
               </property>
           <property name="pageSize" value="#{4 * 1024}"/>
           <property name="storagePath"
value="/media/linux_hdd/keymanagementdata"/>
           <property name="walPath"
value="/media/linux_hdd/keymanagementdata/db/wal"/>
           <property name="walArchivePath"
value="/media/linux_hdd/keymanagementdata/db/wal/archive"/>
           </bean>
       </property>

        <property name="cacheConfiguration">
            <bean
class="org.apache.ignite.configuration.CacheConfiguration">

                <property name="name" value="DSU_DataBase"/>

                <property name="cacheMode" value="REPLICATED"/>

            </bean>
        </property>



        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">



                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>

                                <value>127.0.0.1</value>
                                <value>192.168.111.112:7912</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>


Config file for remote node:


<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 id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">

        <property name="peerClassLoadingEnabled" value="true"/>


       <property name="dataStorageConfiguration">
           <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
               <property name="defaultDataRegionConfiguration">
                   <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                           <property name="persistenceEnabled"
value="true"/>
                           <property name="initialSize" value="#{100L * 1024
* 1024}"/>
                           <property name="maxSize" value="#{400L * 1024 *
1024}"/>
                   </bean>
               </property>
           <property name="pageSize" value="#{4 * 1024}"/>
           <property name="storagePath"
value="/media/linux_hdd/keymanagementdata"/>
           <property name="walPath"
value="/media/linux_hdd/keymanagementdata/db/wal"/>
           <property name="walArchivePath"
value="/media/linux_hdd/keymanagementdata/db/wal/archive"/>
           </bean>
       </property>

        <property name="cacheConfiguration">
            <bean
class="org.apache.ignite.configuration.CacheConfiguration">

                <property name="name" value="DSU_DataBase"/>

                <property name="cacheMode" value="REPLICATED"/>

            </bean>
        </property>



        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">



                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>

                                <value>127.0.0.1</value>
                                <value>192.168.111.111:7912</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Thank you,
Ali.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
rakshita04 rakshita04
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

How can we do activation using C++ and not control.sh script?
Basically how do we use baseline topology feature using C++?
Are there C++ libraries for the same?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hello!

You can wait until your topology has a required number of nodes and then issue active(true), from one node (the oldest, for example).

Regards,
--
Ilya Kasnacheev


ср, 19 авг. 2020 г. в 15:16, rakshita04 <[hidden email]>:
How can we do activation using C++ and not control.sh script?
Basically how do we use baseline topology feature using C++?
Are there C++ libraries for the same?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
rakshita04 rakshita04
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology


How do we know if the required that topology has required number ?Basically
how do we know, for how long we need to wait? Is there a C++ API to check if
topology has required number of nodes?
Also in our case there will be two nodes-
1. local node
2. Remote node(configured at specific ip which we will mention in xml)
If you could please explain how to achieve this in our scenario using C++
code snippet/steps?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
rakshita04 rakshita04
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

In reply to this post by ilya.kasnacheev
How do we know if the required that topology has required number ?Basically
how do we know, for how long we need to wait? Is there a C++ API to check if
topology has required number of nodes?
Also in our case there will be two nodes-
1. local node
2. Remote node(configured at specific ip which we will mention in xml)
If you could please explain how to achieve this in our scenario using C++
code snippet/steps?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: Local node is not added in baseline topology

Hi,
  Please see here re baseline topology:
https://apacheignite.readme.io/docs/baseline-topology
  The first activation is manual. You need to start as many nodes as
necessary, wait until
   they have all initialized and are showing "cluster is inactive" in the
log then issue an
   activation request via command line/rest/programmatically etc..

   If you issue the "activate" request too early, some nodes will have fully
initialized, and some will not have,  causing the "activate" request to
establish an incorrect baseline topology. Watch the logs of all relevant
nodes to make sure they are all in a state ready to receive the "activate"
request.

look for these lines in the logs of all nodes: (the number of servers should
equal to the number of nodes you want)
][main][IgniteKernal%node1] >>> Ignite cluster is not active (limited
functionality available). Use control.(sh|bat) script or IgniteCluster
interface to activate.
[GridDiscoveryManager] Topology snapshot [ver=1, locNode=.., servers=1,
clients=0, state=INACTIVE,



from the doc:
https://apacheignite.readme.io/docs/baseline-topology#activating-the-cluster
Activating the Cluster
To achieve automatic activation for an Ignite persistence enabled cluster,
you need to manually activate the cluster the first time. This can be done
in 4 ways — via code, command line, REST API, or 3rd party tools — as
explained in the sections below.

When the cluster is activated for the first time, baseline topology is
automatically established from the current set of server nodes. Once this is
done, information about nodes that constitute the baseline topology is
persisted to disk. Then, even if you shutdown and restart the cluster, the
cluster will be activated automatically once all the nodes set in the
baseline topology are up and running.

Thanks, Alex



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