You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by waterg <je...@gmail.com> on 2017/05/08 21:29:21 UTC

Docker cluster set up

All, 

I'm trying to set up a cluster using docker. The network setting seems to
have some problem.
Could you please take a look and advise?
I have two hosts and each will run a container. Static ip address and basic
address resolver are used.
This is part of configuration on one container. 

        <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>host1 public ip</value>
								<value>host2 public ip</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>

		 <property name="addressResolver">
			 <bean class="org.apache.ignite.configuration.BasicAddressResolver">
				 <constructor-arg>
					 <map>
						 <entry key="container 1 private ip" value="host1 public ip"/>
						 <entry key="host1" value="container 1 private ip"/>
					 </map>
				 </constructor-arg>
			 </bean>
		 </property>

The other container has the same configuration under TcpDiscoveryVmIpFinder,
but the BasicAddressResolver has ip address for host2/container2.

when I run the container, I use command "sudo docker run -p 47100:47100 -p
47500:47500 imagename"

Here's the result of docker ps on two hosts.

$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND                 
CREATED             STATUS                                                
PORTS                                                                     
NAMES
3e1e86d18b43        imagename   "/bin/sh -c $IGNITE_H"   27 seconds ago     
Up 26                                    seconds      
0.0.0.0:47100->47100/tcp, 11211/tcp, 49112/tcp, 0.0.0.0:47500->47500/tcp  
nostalgic_                                   noyce


$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND                 
CREATED             STATUS              PORTS                                                                     
NAMES
5bbd182dca5c        imagename   "/bin/sh -c $IGNITE_H"   19 minutes ago     
Up 19 minutes       0.0.0.0:47100->47100/tcp, 11211/tcp, 49112/tcp,
0.0.0.0:47500->47500/tcp   romantic_galileo


Does the settings look right? Thank you!




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Docker-cluster-set-up-tp12549.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Docker cluster set up

Posted by afedotov <al...@gmail.com>.
Also, setting --net=host when running both of containers may probably help
too.

Kind regards,
Alex.

On Wed, May 10, 2017 at 8:28 PM, waterg [via Apache Ignite Users] <
ml+s70518n12605h89@n6.nabble.com> wrote:

> Thank you Alex!
>
> On Wed, May 10, 2017 at 1:54 AM, afedotov <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=12605&i=0>> wrote:
>
>> Hi.
>> Did I get it right that containers reside on different hosts? If it's so
>> then containers won't see each other out of box. You probably need to start
>> them via docker overlay network or use Swarm.
>>
>> Kind regards,
>> Alex
>>
>> 9 мая 2017 г. 12:29 AM пользователь "waterg [via Apache Ignite Users]" <[hidden
>> email] <http:///user/SendEmail.jtp?type=node&node=12583&i=0>> написал:
>>
>> All,
>>
>> I'm trying to set up a cluster using docker. The network setting seems to
>> have some problem.
>> Could you please take a look and advise?
>> I have two hosts and each will run a container. Static ip address and
>> basic address resolver are used.
>> This is part of configuration on one container.
>>
>>         <property name="discoverySpi">
>>             <bean class="org.apache.ignite.spi.d
>> iscovery.tcp.TcpDiscoverySpi">
>>
>>                 <property name="ipFinder">
>>
>>
>>                     <bean class="org.apache.ignite.spi.d
>> iscovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
>>                         <property name="addresses">
>>                             <list>
>>
>>
>> <value>host1 public ip</value>
>>
>> <value>host2 public ip</value>
>>                             </list>
>>                         </property>
>>                     </bean>
>>                 </property>
>>             </bean>
>>         </property>
>>
>>                  <property name="addressResolver">
>>                          <bean class="org.apache.ignite.confi
>> guration.BasicAddressResolver">
>>                                  <constructor-arg>
>>                                          <map>
>>                                                  <entry key="container 1
>> private ip" value="host1 public ip"/>
>>                                                  <entry key="host1"
>> value="container 1 private ip"/>
>>                                          </map>
>>                                  </constructor-arg>
>>                          </bean>
>>                  </property>
>>
>> The other container has the same configuration under
>> TcpDiscoveryVmIpFinder, but the BasicAddressResolver has ip address for
>> host2/container2.
>>
>> when I run the container, I use command "sudo docker run -p 47100:47100
>> -p 47500:47500 imagename"
>>
>> Here's the result of docker ps on two hosts.
>>
>> $ sudo docker ps
>> CONTAINER ID        IMAGE                       COMMAND
>>  CREATED             STATUS
>> PORTS
>>  NAMES
>> 3e1e86d18b43        imagename   "/bin/sh -c $IGNITE_H"   27 seconds ago
>>    Up 26                                    seconds       0.0.0.0:47100->47100/tcp,
>> 11211/tcp, 49112/tcp, 0.0.0.0:47500->47500/tcp   nostalgic_
>>                       noyce
>>
>>
>> $ sudo docker ps
>> CONTAINER ID        IMAGE                       COMMAND
>>  CREATED             STATUS              PORTS
>>                                          NAMES
>> 5bbd182dca5c        imagename   "/bin/sh -c $IGNITE_H"   19 minutes ago
>>    Up 19 minutes       0.0.0.0:47100->47100/tcp, 11211/tcp, 49112/tcp,
>> 0.0.0.0:47500->47500/tcp   romantic_galileo
>>
>>
>> Does the settings look right? Thank you!
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://apache-ignite-users.70518.x6.nabble.com/Docker-cluste
>> r-set-up-tp12549.html
>> To start a new topic under Apache Ignite Users, email [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=12583&i=1>
>> To unsubscribe from Apache Ignite Users, click here.
>> NAML
>> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>>
>>
>> ------------------------------
>> View this message in context: Re: Docker cluster set up
>> <http://apache-ignite-users.70518.x6.nabble.com/Docker-cluster-set-up-tp12549p12583.html>
>>
>> Sent from the Apache Ignite Users mailing list archive
>> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Docker-
> cluster-set-up-tp12549p12605.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Docker-cluster-set-up-tp12549p12606.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Docker cluster set up

Posted by Jessie Lin <je...@gmail.com>.
Thank you Alex!

On Wed, May 10, 2017 at 1:54 AM, afedotov <al...@gmail.com>
wrote:

> Hi.
> Did I get it right that containers reside on different hosts? If it's so
> then containers won't see each other out of box. You probably need to start
> them via docker overlay network or use Swarm.
>
> Kind regards,
> Alex
>
> 9 мая 2017 г. 12:29 AM пользователь "waterg [via Apache Ignite Users]" <[hidden
> email] <http:///user/SendEmail.jtp?type=node&node=12583&i=0>> написал:
>
> All,
>
> I'm trying to set up a cluster using docker. The network setting seems to
> have some problem.
> Could you please take a look and advise?
> I have two hosts and each will run a container. Static ip address and
> basic address resolver are used.
> This is part of configuration on one container.
>
>         <property name="discoverySpi">
>             <bean class="org.apache.ignite.spi.d
> iscovery.tcp.TcpDiscoverySpi">
>
>                 <property name="ipFinder">
>
>
>                     <bean class="org.apache.ignite.spi.d
> iscovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
>                         <property name="addresses">
>                             <list>
>
>
> <value>host1 public ip</value>
>
> <value>host2 public ip</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>
>                  <property name="addressResolver">
>                          <bean class="org.apache.ignite.confi
> guration.BasicAddressResolver">
>                                  <constructor-arg>
>                                          <map>
>                                                  <entry key="container 1
> private ip" value="host1 public ip"/>
>                                                  <entry key="host1"
> value="container 1 private ip"/>
>                                          </map>
>                                  </constructor-arg>
>                          </bean>
>                  </property>
>
> The other container has the same configuration under
> TcpDiscoveryVmIpFinder, but the BasicAddressResolver has ip address for
> host2/container2.
>
> when I run the container, I use command "sudo docker run -p 47100:47100 -p
> 47500:47500 imagename"
>
> Here's the result of docker ps on two hosts.
>
> $ sudo docker ps
> CONTAINER ID        IMAGE                       COMMAND
>  CREATED             STATUS
> PORTS
>  NAMES
> 3e1e86d18b43        imagename   "/bin/sh -c $IGNITE_H"   27 seconds ago
>    Up 26                                    seconds       0.0.0.0:47100->47100/tcp,
> 11211/tcp, 49112/tcp, 0.0.0.0:47500->47500/tcp   nostalgic_
>                     noyce
>
>
> $ sudo docker ps
> CONTAINER ID        IMAGE                       COMMAND
>  CREATED             STATUS              PORTS
>                                          NAMES
> 5bbd182dca5c        imagename   "/bin/sh -c $IGNITE_H"   19 minutes ago
>    Up 19 minutes       0.0.0.0:47100->47100/tcp, 11211/tcp, 49112/tcp,
> 0.0.0.0:47500->47500/tcp   romantic_galileo
>
>
> Does the settings look right? Thank you!
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Docker-cluste
> r-set-up-tp12549.html
> To start a new topic under Apache Ignite Users, email [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=12583&i=1>
> To unsubscribe from Apache Ignite Users, click here.
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
> ------------------------------
> View this message in context: Re: Docker cluster set up
> <http://apache-ignite-users.70518.x6.nabble.com/Docker-cluster-set-up-tp12549p12583.html>
>
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>

Re: Docker cluster set up

Posted by afedotov <al...@gmail.com>.
Hi.
Did I get it right that containers reside on different hosts? If it's so
then containers won't see each other out of box. You probably need to start
them via docker overlay network or use Swarm.

Kind regards,
Alex

9 мая 2017 г. 12:29 AM пользователь "waterg [via Apache Ignite Users]" <
ml+s70518n12549h53@n6.nabble.com> написал:

All,

I'm trying to set up a cluster using docker. The network setting seems to
have some problem.
Could you please take a look and advise?
I have two hosts and each will run a container. Static ip address and basic
address resolver are used.
This is part of configuration on one container.

        <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>host1 public ip</value>

<value>host2 public ip</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>

                 <property name="addressResolver">
                         <bean class="org.apache.ignite.configuration.
BasicAddressResolver">
                                 <constructor-arg>
                                         <map>
                                                 <entry key="container 1
private ip" value="host1 public ip"/>
                                                 <entry key="host1"
value="container 1 private ip"/>
                                         </map>
                                 </constructor-arg>
                         </bean>
                 </property>

The other container has the same configuration under
TcpDiscoveryVmIpFinder, but the BasicAddressResolver has ip address for
host2/container2.

when I run the container, I use command "sudo docker run -p 47100:47100 -p
47500:47500 imagename"

Here's the result of docker ps on two hosts.

$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND
 CREATED             STATUS
PORTS
 NAMES
3e1e86d18b43        imagename   "/bin/sh -c $IGNITE_H"   27 seconds ago
 Up 26                                    seconds
0.0.0.0:47100->47100/tcp,
11211/tcp, 49112/tcp, 0.0.0.0:47500->47500/tcp   nostalgic_
                  noyce


$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND
 CREATED             STATUS              PORTS
                                         NAMES
5bbd182dca5c        imagename   "/bin/sh -c $IGNITE_H"   19 minutes ago
 Up 19 minutes       0.0.0.0:47100->47100/tcp, 11211/tcp, 49112/tcp,
0.0.0.0:47500->47500/tcp   romantic_galileo


Does the settings look right? Thank you!


------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://apache-ignite-users.70518.x6.nabble.com/Docker-
cluster-set-up-tp12549.html
To start a new topic under Apache Ignite Users, email
ml+s70518n1h65@n6.nabble.com
To unsubscribe from Apache Ignite Users, click here
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
.
NAML
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Docker-cluster-set-up-tp12549p12583.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.