Changes between Version 66 and Version 67 of flukes

Show
Ignore:
Timestamp:
10/31/12 16:38:30 (7 years ago)
Author:
ibaldin (IP: 152.54.9.21)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • flukes

    v66 v67  
    165165}}} 
    166166 
    167 For added functionality, ORCA uses [http://velocity.apache.org/engine/releases/velocity-1.5/index.html velocity templates] to create the scripts.   See the [http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html user's guide] for details about Velocity.     
    168  
    169 ORCA templates follow the Velocity syntax which can be used to replace several key pieces of data that are assigned by ORCA.     Specifically, there are one or more arrays that contains the IP addresses assigned to each instance.   There is one array of IP addresses for each group.  Each array of IP addresses is referenced using the name provided to Flukes for the group.  In addition, there is a variable called $MY_ADDR_INDEX that is the index of the IP address of the current instance within its group's array of IP addresses.  All arrays of IP addresses are accessible from any post boot script in the current request. 
    170  
    171 The following is an example post boot script that adds an entry to the /etc/hosts file for each of the instances in the request and sets the hostname of each instance to an appropriate value.  In this particular example, the first instance is assumed to be a master node named "master" while the remaining nodes are named "worker1", "worker2", etc.. The string "Group1" was used as the group name. 
    172  
    173 {{{ 
    174 #!/bin/bash 
    175    # Test script  
    176    echo "Hello from post boot script" 
    177    echo $Group1.get(0) master  >> /etc/hosts  
    178 #set ( $size = $Group1.size() - 1 ) 
    179 #foreach ( $i in [1..$size] ) 
    180    echo $Group1.get($i) worker$i >> /etc/hosts 
    181 #end 
    182 #if ( $MY_ADDR_INDEX == 0) 
    183    echo master > /etc/hostname 
    184 #else 
    185    echo worker$MY_ADDR_INDEX > /etc/hostname 
    186 #end 
    187 }}} 
    188  
    189 '''WARNING:''' due to a known bug, all script lines (not template lines) except for the first (which typically just says "#!/bin/bash" or similar) must start with white space (e.g. a tab) in order to be properly interpreted (as in the example above).  
    190167 
    191168=== !OpenFlow ===