You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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.

node_copy.sh:

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

After having copied the files in the to node, the script runs the following commands:

  • chmod -x /usr/lib/systemd/system/tdetsim.service
  • chmod -x /usr/lib/systemd/system/kcu.service
  • systemctl disable irqbalance.service
  • systemctl daemon-reload
  • systemctl start tdetsim.service

node_clone.sh:

is the "local" script that is used to run the cloning.

This script must be run in a node with clush installed, like drp-neh-ctl002. Since the FEE and SRCF are reachable by ssh, it is possible to run this script from neh to srcf systems and viceversa.
it requires as parameters the from and to node address: node_clone drp_srcf_cmp001 drp_srcf_cmp002

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 procedure

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.
file_list.jsonnode_copy.shnode_clone.sh


  • No labels