centos7 集群整体操作脚本
时间:2021-03-05 12:59:52
收藏:0
阅读:0
1、在/root/bin目录创建脚本xcall.sh 2、脚本本周编写内容 [root@wd ~]# vi xcall.sh !/bin/bash for i in wd1 wd2 wd3 do echo -------------------$i-------------- ssh $i "$*" done 3、修改脚本执行权限 [root@wd1 bin]# chmod 777 xcall.sh 4、将/etc/profile文件追加到 ~/.bashrc(每个节点都要执行) [root@wd1 bin]# cat /etc/profile >> ~/.bashrc 5、测试 sh xcall.sh “执行命令” [root@wd1 bin]#sh xcall.sh ls
说明:服务器之间配置免秘钥登录
评论(0)