rex 远程启动 关闭service

来源:互联网 发布:如何通过网络挣钱 编辑:程序博客网 时间:2024/06/07 10:45
[root@node01 my-first-rex-project]# cat Rexfile use Rex -feature => ['1.0'];user "root";password "1234567";group myservers => "192.168.137.3";desc "Get the uptime of all servers";task "uptime", group => "myservers", sub {   my $output = run "uptime";   say $output;};desc "Start Mysql Service";task "start_mysql", group => "myservers", sub {    service "mysql" => "start";};[root@node01 my-first-rex-project]# rex start_mysqlmysql 为对应操作系统的一个服务:node2:/etc/init.d#ls -ltr mysql -rwxr-xr-x 1 root root 10880 Mar 12 10:17 mysql

0 0