1 Reply Latest reply on Sep 14, 2010 8:20 PM by jeff.yuchang

    setting nodeName through the command line when starting jboss server.

    jeff.yuchang

      Hi,

       

      I am using JBoss AS 5.1.0.GA, started two clustering server in one machine, start with command as following:

       

      /run.sh -c all -g RiftSawPartition -u 239.255.100.100 -b 192.168.1.67  -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-default

       

      Found the node name is: 192.168.1.67:1099

       

      I am thinking that is it possible to have a customized node name, which I want to include the value that I specified for ('-c'). From the following hapartition-jboss-bean.xml, right now are are using the ${jboss.bind.address}, does it mean that we can update this to change the node name?

       

      <!-- The address used to determine the node name -->
      <property name="nodeAddress">${jboss.bind.address}</property>

       

      From the jira (https://jira.jboss.org/browse/JBAS-7779), we are able to set the node name through command line, but I want to know can we customize node name somehow in AS 5.1.0.GA version.

       

      Thanks

      Jeff

        • 1. Re: setting nodeName through the command line when starting jboss server.
          jeff.yuchang

          Looked at the code, it seems the nodeName is built as following, another question is that can I get this node name from JNDI or system variable somewhere? apart from the HaPartition service.

           

                public ClusterNode getClusterNode(Address a)
                {
                   IpAddress result = addressMap.get(a);
                   if (result == null)
                   {
                      result = (IpAddress) channel.downcall(new Event(Event.GET_PHYSICAL_ADDRESS, a));
                      if (result == null)
                      {
                         throw new IllegalStateException("Address " + a + "not registered in transport layer");
                      }
                      addressMap.put(a, result);
                   }
                   AddressPort addrPort = new AddressPort(result.getIpAddress(), Integer.valueOf(result.getPort()));
                   String id = channel.getName(a);
                   if (id == null)
                   {
                      id = addrPort.getHostAddress() + ":" + addrPort.getPort();
                   }
                   return new ClusterNodeImpl(id, a, addrPort);
                }
             }