I have a requirement explained below.
I have 5 nodes/servers as follows.
Linux 3.10.0 (RHEL)
I am working on a Data Migration Project where I have to do the following once in every 10 steps for example in all the 5 nodes.
i. switch user to root.
sudo su -
ii. check the status of the service as follows (command)
service abc_pqr status
iii. start/stop service (commands)
service abc_pqr start
service abc_pqr stop
Once the service is turned off, the DB backup process will happen.
once the backup process is completed, the service will be turned ON.
Is there anyway I can remotely perform these steps?
I will do all these steps only in the node xyz1111 and from the same node I can do it remotely to the other nodes?
I can write a small script and I will place the script in all the nodes. Whenever I want I will trigger the script from the node xyz1111?
Note: Once I logged in to thse servers, I need to switch user to root. If I do manually, I will be prompted with Username and Password (So I need to store username and password in a file/hidden file). Because these commands will be executed only in root.
The manual process is taking time. I have given 5 nodes for example. In realtime, I will be having 10 nodes or more than that. Hence I am looking for some automation process to cut short the time.
Can anyone help us out to fix this issue?
Thanks in advance.