Forum Discussion

jwlarger's avatar
jwlarger
Icon for Cirrus rankCirrus
Apr 02, 2021

How to copy files between slots on a cluster

If I create a bash script file on the primary slot, what is the syntax to copy it to the same directory on all the other slot(s) so it will be available should another slot become primary?

2 Replies

  • Whichever slot will be primary, bash script will be automatically available. copy is not needed.

     

    Did you notice issue?

    • jwlarger's avatar
      jwlarger
      Icon for Cirrus rankCirrus

      More details. This doesn't seem to follow logically:

       

      -----------------------------------------

      Sys::Cluster: default

      -----------------------------------------

      Address         "someip"/22

      Availability      available

      State          enabled

      Reason         Cluster Enabled

      Primary Slot ID     1

      Primary Selection Time 03/28/21 00:42:58

       

       -------------------------------------------------------------------------

       | Sys::Cluster Members

       | ID Address Availability State  Licensed HA    Clusterd Reason

       -------------------------------------------------------------------------

       | 1  ::    available   enabled true   standby running  Run

       | 2  ::    available   enabled true   standby running  Run

       | 3  ::    available   enabled true   standby running  Run

       | 4  ::    available   enabled true   standby running  Run

       

      So, big3d is on every slot:

      /shared/bin/ltmlogs

      [admin@somelb:/S1-green-P:Standby:In Sync] ~ # clsh ls /shared/bin/big3d

      === slot 2 addr 127.3.0.2 color green ===

      /shared/bin/big3d

      === slot 3 addr 127.3.0.3 color green ===

      /shared/bin/big3d

      === slot 4 addr 127.3.0.4 color green ===

      /shared/bin/big3d

      === slot 1 addr 127.3.0.1 color green ===

      /shared/bin/big3d

       

      I created ltmlogs, a batch file that takes a string and searches each ltm log:

       

      cat ltmlogs

      echo 'Enter search term '

      read srchtrm

      echo "ltm"   

      cat /var/log/ltm | grep $srchtrm

      echo "ltm.1.gz"   

      zcat /var/log/ltm.1.gz | grep $srchtrm

      echo "ltm.2.gz"

      zcat /var/log/ltm.2.gz | grep $srchtrm

       .... etc

       

      It exists only on slot 1, not 2, 3, or 4: 

       

      [admin@somelb:/S1-green-P:Standby:In Sync] ~ # clsh ls /shared/bin/ltmlogs

      === slot 2 addr 127.3.0.2 color green ===

      ls: /shared/bin/ltmlogs: No such file or directory

      === slot 3 addr 127.3.0.3 color green ===

      ls: /shared/bin/ltmlogs: No such file or directory

      === slot 4 addr 127.3.0.4 color green ===

      ls: /shared/bin/ltmlogs: No such file or directory

      === slot 1 addr 127.3.0.1 color green ===

      /shared/bin/ltmlogs