Forum Discussion

jajamax_127538's avatar
jajamax_127538
Icon for Nimbostratus rankNimbostratus
Nov 20, 2003

Need a script

Let me preface by saying I'm no developer. What I need is a way to bring the a node off line prior to running a batch job that stops the service on that node. Is there a script that can pull a node offline and bring it back online 4-5 minutes later??? thanks in advance

4 Replies

  • There are examples included in the SDK that do just this. Look for the LocalLBNode sample in each of the supported languages (Perl, Java, VB, C). When you mention scripting this, perl is probably your best option.

    The specific methods you would be interested in are:

     
      
     void ITCMLocalLB::Node::set_state( 
         in IPPortDefinition[] node_defs, 
         in EnabledState state 
     ); 
      
     void ITCMLocalLB::Node::set_availability( 
         in IPPortDefinition[] node_defs, 
         in AvailabilityState state 
     ); 
      
     void ITCMLocalLB::Node::get_statistics( 
         in IPPortDefinition node_def, 
         out NodeStatistics stats 
     ); 
     

    The set_state() method will cause a forced up or down of the node while the set_availability() method is used for gracefully "draining" connections to the node by not allowing new connections to be pass on. If using this method you should watch the connections on that node with the get_statistics() method and wait until the total connections reach zero, then disable the node with the state of STATE_DISABLED.

    -Joe
  • I am trying to do the exact same thing in C, I was wondering

     

    What's the equivalent of these functions in IControl.9.4.x?

     

    I think

     

    ITCMLocalLB::Node::set_state( ..) is equivalent to LocalLBNodeAddress.set_session_enabled_state()

     

     

    and

     

    ITCMLocalLB::Node::get_statistics() is LocalLBNodeAddress.get_statistics()

     

     

    But I am not sure about the third one?

     

    Eray

     

  • Joe,

     

    Thanks for your answer. I got the difference between

     

    set_session_enabled_state() and set_session_enabled_state()

     

     

    But now I got confused between

     

    LocalLBNodeAddress and LocalLBPoolMember, it looks like they're API is almost same.

     

     

    Should I use

     

    LocalLBNodeAddress.set_monitor_state() or

     

    LocalLBPoolMember.set_monitor_state() ?

     

    What's the difference?

     

     

     

     

     

  • LocalLBNodeAddress is used globally for a given node address (10.10.10.10). LocalLBPoolMember is used for a given instance of a node server (10.10.10.10:80) within the context of a single pool.

     

     

    If you want to disable the node globally for all pools it's contained in, then use LocalLBNodeAddress. If you want to disable it for a specific server pool, use LocalLBPoolMember.

     

     

    -Joe