Previous Topic: AppLogic Knowledge Library - Backend FunctionsNext Topic: AppLogic Knowledge Library - Grid Node Boot Routine


AppLogic Knowledge Library - Controller Boot Routine

This article introduce the what is processed inside controller when controller is booted up.

Controller has serveral service which are launched in below squence at controller boot up stage

/etc/rc.d/init.d/applogic-acs The startup script for the appliance configuration service, create/update the DHCPD and HTTPD config file
/etc/rc.d/init.d/3trsh-init This is a part of the applogic controller access gateway. It initializes the special read-only directories needed for the volume access. No daemon process is started by this script
/etc/rc.d/init.d/applogic_ctl Applogic Controller Boot/Shutdown Script

Here are details of their functionalites

/etc/rc.d/init.d/applogic-acs functionalites

  1. Start up /usr/local/applogic/bin/acs-updated. It seems a bridge between client process and server process talking over socket.
  2. Generate dhcpd conf file(/etc/dhcpd.conf) based on /etc/dhcpd.conf.acs
  3. Generate httpd conf file(/etc/httpd/conf.d/z-acs-httpd.conf) to listen request coming from <dhcp server ip>:8080

/etc/rc.d/init.d/3trsh-init functionalites

  1. 1.Invoke /usr/local/applogic/bin/3trsh to creat following ro mount for scp and sftp-server executables. It's designed to use in a 'root jail' for accessing volumes mounted on the controller

    127.0.0.1:/var/local/lib/3trsh on /vol type nfs (ro,addr=127.0.0.1)
    127.0.0.1:/var/local/lib/3trsh_lib/etc on /vol/etc type nfs (ro,addr=127.0.0.1)
    127.0.0.1:/var/local/lib/3trsh_lib/lib on /vol/lib type nfs (ro,addr=127.0.0.1)

Note:

/usr/local/applogic/bin/3trsh also support following functionalites
  1. ssh to applinace to execute specfic command
  2. scp some stuffs to appliance or /vol/_implex of controller
  3. Startup the sftp server(????)
  4. 3t shell CLI

    3trsh always invoke below command to chekc permssion. if ails, prints "permssion denied"

    /usr/local/applogic/bin/3trbac authorize "user_id=$_3TUSRID" grid:login <command>
    
    
    

/etc/rc.d/init.d/applogic_ctl functionalites

  1. Change the password if it’s first time login controller
  2. Configure some kernel value
    sysctl -w vm.min_free_kbytes=32768
    sysctl -w net.ipv4.tcp_retries2=10
    
  3. Load NBD module and create NBD device
  4. Load RAID module and create RAID device
  5. Mount /vol/_impex
  6. Update license and create certification
  7. Start controller daemon
    /usr/local/applogic/bin/cmnd.sh /usr/local/applogic/bin/ctld cfgfile=/etc/applogic/applogic.conf trusted_server=<srv name>
    /etc/init.d/httpd start
    
  8. Initalize grid recovery by executing below command
    perl /usr/local/applogic/scripts/3tgridctl.pl start
    

    The recovery procdure porcess below tasks

    1. Wait until conbtroller daemon ctld is fully up("3tctl check sys" return 0)
    2. Read applogic conf file
    3. Enumerate grid node state when controller was down by going through /var/applogic/state/ha/srvs/*.desc
    4. Enumerate active app when controller was down by going through /var/applogic/state/ha/apps/* , reset app state with unknown and output to file /tmp/app_state/<app name>.state
    5. Enumerate active grid nodes whose last known state are up
    6. Wait until all grid nodes UP then connect to them
    7. Bind to controller system volumes(boot, meta, impex)
    8. Enumerate all grid node resource of mount, vm and vna.
    9. Create components description file to be recovered at /var/applogic/state/ha/recovery/<app name>/<comp name>.desc
    10. Retrive orpahn resource(mount, vm and vna) and output to /var/applogic/state/ha/recovery/orphan.desc
    11. Obtain app setting from /var/applogic/state/ha/apps/<app name>/app.desc , bind applcation with resource(cpu, memory, bandwidth, cpu capping, debug)
    12. Obtain app volume info from /var/applogic/state/ha/vols/*.desc, then bind them. the volume state may be presented as mount, repair, migrate
    13. Unshare controller graphical/text consoles
    14. Allow the CLI operation by generating file /dev/shm/applogic/cli_allow_des_ops
    15. Get application target state and current state from /var/applogic/state/ha/apps/<app name>/app.desc, then take action to restart/repair them. the statqe is outputed to /tmp/app_state/<app name>
    16. Delete orphan vm, mount and vna obtained eariler
  9. Verify grid uptime
    /usr/local/applogic/bin/3tctlmon sys check -uptime
    
  10. Start volum repair daemon 3tvolmaintd
    /usr/local/applogic/bin/3tvolmaintd_init star