You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by newigniter <to...@gmail.com> on 2019/01/09 14:14:20 UTC

How to setup multi host node discovery

Greetings.

I am new to apache ignite and I would like to set up multiple ignite nodes
each running on separate ec2 instance inside docker container. 
When I start the first ignite node, the cluster is created and now I have
one node in my cluster.
I create now new ec2 instance and start new ignite node there inside docker
container. How should my configuration look like in order for both of the
nodes joined the same cluster?

I went through Ignite Documentation for TCP/IP Discovery but can't configure
this to work.

Appreciate any help!



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

Re: How to setup multi host node discovery

Posted by newigniter <to...@gmail.com>.
Tried it. Still not working. I also tried to setup S3 discovery. 
My config is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
	
	<bean id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
		<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" />
					</bean>
				</property>
			</bean>
		</property>
		
		<property name="authenticationEnabled" value="true" />
		<property name="discoverySpi">
			<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
				<property name="ipFinder">
					<bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">
						<property name="awsCredentialsProvider">
							<bean class="com.amazonaws.auth.InstanceProfileCredentialsProvider"
/>
						</property>
						<property name="bucketName" value="deegloo-ignite-discovery-spi" />
					</bean>
				</property>
			</bean>
		</property>
	</bean>
</beans>

Also tried with secret and access keys.
Both of my nodes are started inside docker containers, each in its own ec2
instance. I opened ports 45000-45100, 47400, 47100,4710, 48100,
48101,31100,31101 on both ec2 instance and each ignite is started with
docker run --net=host command. 
I have the bucket for spi discovery created.
When I start the first node I can see that in S3 discovery bucket there are
4 entries and by the IP addresses I can tell that this is from the ec2
instance which is the host for ignite container started. 
I then activate the cluster. I now have a cluster with one node.

I then go and start the second ignite node on the separate ec2 instance.
This node is not joined to the cluster. I can activate the new cluster with
this node.

When I examine the s3 discovery bucket I can see that entries are changed
alternately: for a minute or so I see entries which have IP address value of
one instance, then I see values from another instance. Not sure if this is
how it should be? But in any case I can't get that my secondly started node
join the cluster.

Any help is appreciated. I tried a bunch of stuff and I simply can't get it
to work. 




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

Re: How to setup multi host node discovery

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

Have you tried specifying both nodes' internal IPs in configurartion?

Can you provide log thereof?

Regards,
-- 
Ilya Kasnacheev


ср, 9 янв. 2019 г. в 18:25, newigniter <to...@gmail.com>:

> Tnx for your help. Below is my config. Did you mean something like this?
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>         <bean id="grid.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>                 <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" />
>                                         </bean>
>                                 </property>
>                         </bean>
>                 </property>
>
>                 <property name="authenticationEnabled" value="true" />
>
>                 <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>
>
> 127.0.0.1
>                                                                 </value>
>
>                                                                 <value>
>
> [ec2 ip address]:47500..47509
>                                                                 </value>
>                                                         </list>
>                                                 </property>
>                                         </bean>
>                                 </property>
>                         </bean>
>                 </property>
>         </bean>
> </beans>
>
> [ec2 ip address]:47500..47509 is the ip address of the ec2 instance where
> first node was started. If I understood correctly, it is enough to provide
> only one ip address?
>
> I did that and using this configuration I started 2nd node.
>
> I connect to my first node and execute:
> ./control.sh --user ignite --password ignite --state -> CLUSTER ACTIVE
> ./control.sh --user ignite --password ignite --baseline -> only first node
> is found
> I connect to my second node and execute:
> ./control.sh --user ignite --password ignite --state -> CLUSTER IS INACTIVE
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to setup multi host node discovery

Posted by newigniter <to...@gmail.com>.
Tnx for your help. Below is my config. Did you mean something like this?

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
	
	<bean id="grid.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
		<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" />
					</bean>
				</property>
			</bean>
		</property>
		
		<property name="authenticationEnabled" value="true" />
		
		<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>
									127.0.0.1
								</value>
								
								<value>
									[ec2 ip address]:47500..47509
								</value>
							</list>
						</property>
					</bean>
				</property>
			</bean>
		</property>
	</bean>
</beans>

[ec2 ip address]:47500..47509 is the ip address of the ec2 instance where
first node was started. If I understood correctly, it is enough to provide
only one ip address? 

I did that and using this configuration I started 2nd node.

I connect to my first node and execute:
./control.sh --user ignite --password ignite --state -> CLUSTER ACTIVE
./control.sh --user ignite --password ignite --baseline -> only first node
is found
I connect to my second node and execute:
./control.sh --user ignite --password ignite --state -> CLUSTER IS INACTIVE






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

Re: How to setup multi host node discovery

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

You can just list all nodes' IPs in configuration of each node, or use S3
discovery in case of AWS.

Regards,
-- 
Ilya Kasnacheev


ср, 9 янв. 2019 г. в 17:14, newigniter <to...@gmail.com>:

> Greetings.
>
> I am new to apache ignite and I would like to set up multiple ignite nodes
> each running on separate ec2 instance inside docker container.
> When I start the first ignite node, the cluster is created and now I have
> one node in my cluster.
> I create now new ec2 instance and start new ignite node there inside docker
> container. How should my configuration look like in order for both of the
> nodes joined the same cluster?
>
> I went through Ignite Documentation for TCP/IP Discovery but can't
> configure
> this to work.
>
> Appreciate any help!
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>