8 Replies Latest reply on Sep 26, 2012 10:36 AM by Galder Zamarreño

    connect 2 servers

    vigue Newbie

      Hello!

      I want to join/connect 2 infinispan servers, running in 2 different machines.

      First, I run the first one with the script:

           ./startserver.sh -p xxx -r memcached -c config.xml -Djgroups.bind_addr="ip2"

      where the file config.xml is this:

      <infinispan>

          <global>

              <transport clusterName="demoCluster">

                  <properties>

                      <property name="configurationFile" value="jgroups.xml"/>

                  </properties>

              </transport>

              <globalJmxStatistics enabled="true"/>

          </global>

       

          <default>

              <jmxStatistics enabled="true"/>

              <clustering mode="distribution">

              <hash numOwners="2"/>

              <sync/>

              </clustering>

          </default>

       

      </infinispan>

       

      and jgroups.xml is the file jgroups-tcp.xml which is in /etc.

       

      Then, I run the second one:

           ./startserver.sh -p xxx -r memcached -c config.xml -Djgroups.bind_addr="ip1"

       

      There ir an error:

            java.net.BindException: [TCP] /172.18.0.5 is not a valid address on any local network interface

       

       

      I haven't got to connect the 2 servers, I don't know if what I have done is OK or not and I need to know how to configure Infinispan to do what I want to do.

      Well, I hope that somebody can help me.

       

      Thanks.

        • 1. Re: connect 2 servers
          Nag Ch Newbie

          I didn't use memcached but I have used  hotrodserver by  using command like this.

           

          startServer.sh -r hotrod -p port1-l host1 -c bin/distribution.xml -Djgroups.bind_addr=host1

           

          try passing in host and port.

          • 2. Re: connect 2 servers
            Mircea Markus Master

            jgroups.bind_addr should contain a valid IP address of one of your network inerfaces. Have you tried starting without this propery?

            • 3. Re: connect 2 servers
              vigue Newbie

              Nag Ch escribió:

               

              I didn't use memcached but I have used  hotrodserver by  using command like this.

               

              startServer.sh -r hotrod -p port1-l host1 -c bin/distribution.xml -Djgroups.bind_addr=host1

               

              try passing in host and port.

               

               

              I have the same problems when I run the server using the command like you said. It is said the next:

                   Caused by: org.infinispan.CacheException: java.net.BindException: [TCP] /172.18.0.5 is not a valid address on any local network interface

                   Caused by: java.net.BindException: [TCP] /172.18.0.5 is not a valid address on any local network interface

               

              I have noticed that another problem appear:

                   Error while trying to create a channel using config files: jgroups.xml

              What I have done is copy the file etc/jgroups-tcp.xml in bin and I have changed the name to jgroups.xml. Is it right?

              • 4. Re: connect 2 servers
                vigue Newbie

                Mircea Markus escribió:

                 

                jgroups.bind_addr should contain a valid IP address of one of your network inerfaces. Have you tried starting without this propery?

                 

                 

                 

                I have tried to run the server without this flag, but then, the error that appears is the next one:

                     Caused by: org.infinispan.CacheException: java.lang.Exception: Property assignment of bind_addr in TCP with original property value "IP1" and converted to null could not be assigned

                     Caused by: java.lang.Exception: Property assignment of bind_addr in TCP with original property value "IP1" and converted to null could not be assigned

                     Caused by: java.lang.Exception: Conversion of bind_addr in TCP with original property value "IP1" failed

                     Caused by: java.net.UnknownHostException: "IP1"

                 

                Besides, also appear the error that i mentionated before:

                     Error while trying to create a channel using config files: jgroups.xml

                • 5. Re: connect 2 servers
                  vigue Newbie

                  I want to join 2 servers in order to create a cluster in 'distribution' mode. I have 2 different servers, I run Infinispan in each one. I want to insert data in one machine and get the data from the other one.

                   

                  I know that I have to create de configuration file and I have to use the file called jgroups.xml. But I'm not sure about how to run the Infinispan servers, about how to use the command ./starServer.sh.

                   

                  Can anyone tell me the steps to build this cluster, please?

                  • 6. Re: connect 2 servers
                    Galder Zamarreño Master

                    @vigue, @Mircea has already said what you need to do: find out the IP addresses that connect these machines together, and use them as bind addresses respectively.

                     

                    If you're still having issues, enable TRACE logging on org.jgroups package and post the logs.

                    • 7. Re: connect 2 servers
                      vigue Newbie

                      Galder Zamarreño escribió:

                       

                      @vigue, @Mircea has already said what you need to do: find out the IP addresses that connect these machines together, and use them as bind addresses respectively.

                       

                      If you're still having issues, enable TRACE logging on org.jgroups package and post the logs.

                       

                       

                      Sorry, I know what are you trying to tell me, but I think that the IP's adresses that i'm using are right. I have 2 machines, so I use the IP of each one of them. Is there any other IP valid?

                       

                      I'm going to try enable the trace and write here the log.

                       

                      Thanks any way for all your help.

                      • 8. Re: connect 2 servers
                        Galder Zamarreño Master

                        Well, the point really is that "IP1" cannot be resolved, so some DNS issue? What about you type the IP addresses as they are, without the need to do host resolution?