Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The goal is to have a script that can copy the environment of a node into another one.
The script consist in 2 bash files (one local and one remote) and a json file ("file_list.json"), which defines the  environment to be cloned:

file namepath
datadev.ko/usr/local/sbin/
kcuSim
/usr/local/sbin/
kcuStatus/usr/local/sbin/
kcu.service
/usr/lib/systemd/system/
tdetsim.service/usr/lib/systemd/system
sysctl.conf
/etc/


Install

Copy the files in a local folder accessible from each node. 
The idea is that we run node_clone from a node where we can use clush and then we run node_copy on the nodes that need to be copied.

...

This script copies the files in the file_list.json file from and to the local folder. 
It is run "remotely" directly on the selected nodes.
The script proceeds in creating local folders in the same directory the script is run (BACKUP_TEMP and DEFAULTS_TEMP).

Running node_copy.sh when on a specific node, will copy the local files (of the node) in file_list.json into the DEFAULTS_TEMP folder
Running node_copy.sh -r when on a specific node, will copy the local files (of the node) in file_list.json into  BACKUP_TEMP/date/drp_name (i.e. BACKUP_TEMP/2023-06-16/drp_srcf_cmp001/) and then will copy the files in DEFAULTS_TEMP into their respective directories, following the information in file_list.json

...

the script stops if these addresses are not provided.
The user is then asked if the cloning procedure is correct. Y continues, N stops the procedureThe script proceeds in creating local folders in the same directory the script is run (BACKUP_TEMP and DEFAULTS_TEMP).

The script proceeds in calling "clush" with root privileges running node_copy.sh in the from node. Then it runs again "clush" with root privileges on the to node but this time node_copy is called with -r option.

...