6 Replies Latest reply on Jul 14, 2006 11:22 AM by jatsrt

    Setup for single box cluster on 2 Alpha

    jatsrt

      Hi All,
      The way I test my clustering is to have two seperate instances of JBoss running bound to two different IP addresses,

      so --host=x and --host=y


      To do this I setup two different servers in JBoss IDE and set the start parameters.

      However in 2 Alpha, this just does not want to work.

      The list gives localhost and the first ip address of the host, but no more, so I fugure I will create the two hosts and then modify the ip address later.

      However, if you change hostname in the configuration, it still launches with the original hostname, if you edit the lauch properties, it does not allow you to change host there. I have tried to edit the .config file and have tried to edit the xml file that is created when you switch from meta data.

      I am assuming this is a bug/incomplete feature, but could someone confirm I am not missing something simple.

      Thanks,
      Jake

        • 1. Re: Setup for single box cluster on 2 Alpha
          rob.stryker

          Hi jatsrt:

          When creating a new server, you should type directly into the combo box the ip address you want. The combo box is supplied by webtools and is not filled with acceptable hosts, however, you can type directly one of the following:

          localhost
          127.0.0.1
          192.168.etc.etc

          So long as what you type in IS a local host, you should be able to create a jboss 4.0 server instance.

          Hope this helps.

          • 2. Re: Setup for single box cluster on 2 Alpha
            jatsrt

            That seems to be the problem, if I type in the primary IP address then it lets a 4.0 server be created and if I type localhost it lets it be created, if I type in anything else, including my seconday ip address it filters it out.

            BTW, this is a linux box running FC5.

            My primary is eth0 and is set to 172.16.10.205
            My secondary is eth0:0 and is set 172.16.10.203

            My host file has both ips mapped to the same hostname.

            So when I type in the ip for eth0 it is fine, but does not accept the ip for eth0:0

            -Jake

            • 3. Re: Setup for single box cluster on 2 Alpha
              rob.stryker

              jatsrt: I've created a JIRA issue for this, and also bugged it in eclipse webtools.

              JIRA: http://jira.jboss.com/jira/browse/JBIDE-340
              Eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=150531[/url]

              • 4. Re: Setup for single box cluster on 2 Alpha
                jatsrt

                I threw this together quickly and I will put this into the issues also , but why would this not work

                public boolean isLocalHost(String hostAddress) {
                 try {
                 Enumeration<NetworkInterface> interfaces = NetworkInterface
                 .getNetworkInterfaces();
                
                 while (interfaces.hasMoreElements()) {
                 NetworkInterface inter = interfaces.nextElement();
                 Enumeration<InetAddress> addresses = inter.getInetAddresses();
                
                 while (addresses.hasMoreElements()) {
                 InetAddress address = addresses.nextElement();
                 if (StringUtils.equals(hostAddress, address
                 .getHostAddress())) {
                 return true;
                 }
                 }
                 }
                 } catch (Exception e) {
                 e.printStackTrace();
                 }
                
                 return false;
                 }
                


                • 5. Re: Setup for single box cluster on 2 Alpha
                  rob.stryker

                  jatsrt: Does the code you provided work properly to solve your issue? If yes then I hope the issue gets resolved on eclipse's end.

                  Either way, thanks for submitting that and hopefully your issue is resolved by 2.0final

                  • 6. Re: Setup for single box cluster on 2 Alpha
                    jatsrt

                    Yep this returns all the ip addresses I have, also IPV6 addresses, the only problem is it would need to be extended to add support for non-numerical strings like "localhost" and "my.computer.com"